[vlmc-devel] commit: MainWindow: Clears temporary files on exit. (Rohit Yadav )

git at videolan.org git at videolan.org
Sat Oct 30 14:15:40 CEST 2010


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Sat Oct 30 17:57:12 2010 +0530| [31d8299421f2ec48a58084b79f839df80091d3fb] | committer: Rohit Yadav 

MainWindow: Clears temporary files on exit.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=31d8299421f2ec48a58084b79f839df80091d3fb
---

 src/Gui/MainWindow.cpp |    9 +++++++++
 src/Gui/MainWindow.h   |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 9538a00..ea3c2ac 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -577,6 +577,14 @@ MainWindow::checkFolders()
         dirUtil.mkdir( VLMC_GET_STRING( "general/TempFolderLocation" ) );
 }
 
+void
+MainWindow::clearTemporaryFiles()
+{
+    QDir dirUtil;
+    if( dirUtil.cd( VLMC_GET_STRING( "general/TempFolderLocation" ) ) )
+        foreach ( const QString &file, dirUtil.entryList( QDir::Files ) )
+            dirUtil.remove( file );
+}
 
 //Private slots definition
 
@@ -759,6 +767,7 @@ bool
 MainWindow::saveSettings()
 {
     GUIProjectManager   *pm = GUIProjectManager::getInstance();
+    clearTemporaryFiles();
     if ( pm->askForSaveIfModified() )
     {
         QSettings s;
diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h
index eb4ee70..802577a 100644
--- a/src/Gui/MainWindow.h
+++ b/src/Gui/MainWindow.h
@@ -68,6 +68,7 @@ private:
     void        createNotificationZone();
     void        createGlobalPreferences();
     void        createProjectPreferences();
+    void        clearTemporaryFiles();
     void        initVlmcPreferences();
     void        loadVlmcPreferences( const QString& subPart );
     void        loadGlobalProxySettings();



More information about the Vlmc-devel mailing list