Remove temporarily file after we open it
authorMohammed Sameer <msameer@foolab.org>
Mon, 4 Feb 2013 08:55:51 +0000 (10:55 +0200)
committerMohammed Sameer <msameer@foolab.org>
Mon, 4 Feb 2013 08:55:51 +0000 (10:55 +0200)
This avoids leaving stall files if anything happens

src/mountprotector.cpp

index 05ce4ba..619cdff 100644 (file)
@@ -62,6 +62,10 @@ bool MountProtector::lock() {
     return false;
   }
 
+  if (!QFile::remove(m_file->fileName())) {
+    qmlInfo(this) << "Failed to remove temporarily file" << m_file->fileName();
+  }
+
   return true;
 }