Bug 360940 - Cannot save file
Summary: Cannot save file
Status: RESOLVED DUPLICATE of bug 349610
Alias: None
Product: kwordquiz
Classification: Applications
Component: general (show other bugs)
Version: 0.9.2
Platform: Kubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: Peter Hedlund
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-24 14:02 UTC by michael.gius
Modified: 2016-03-24 19:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description michael.gius 2016-03-24 14:02:58 UTC
When trying to save or saveas a file, an error occurs and the file is not saved.

Reproducible: Always


Actual Results:  
Error: The file is not writable

or: The file is locked by another process.

Expected Results:  
The file is saved.

The error occurs on Kubuntu 15.10 and did not occur in 12.04.

FIX: use url.toLocalFile() instead of url in save method

With the patch below the source compiles and saving files is again possible.

diff --git a/src/kwordquiz.cpp b/src/kwordquiz.cpp
index ccbc5ef..e655d93 100644
--- a/src/kwordquiz.cpp
+++ b/src/kwordquiz.cpp
@@ -919,7 +919,7 @@ bool KWordQuizApp::saveDocAsFileName(KEduVocDocument *document)
       else {
         if (m_dirWatch->contains(document->url().toLocalFile()))
           m_dirWatch->removeFile(document->url().toLocalFile());
-        result = document->saveAs(url, KEduVocDocument::Automatic);
+        result = document->saveAs(url.toLocalFile(), KEduVocDocument::Automatic);
         if (result == KEduVocDocument::NoError) {
           m_dirWatch->addFile(url.path());
           fileOpenRecent->addUrl(url);
Comment 1 Christoph Feck 2016-03-24 19:22:11 UTC
Thanks for the investigation. The fix was applied to libkeduvocdocument.

*** This bug has been marked as a duplicate of bug 349610 ***