]> git.sesse.net Git - vlc/commitdiff
Qt: first step to fix directory remembering.
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 18 Jun 2009 22:59:02 +0000 (00:59 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 19 Jun 2009 14:53:26 +0000 (16:53 +0200)
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/qt4.cpp
modules/gui/qt4/util/qt_dirs.hpp

index 4fac872ac1d593e27e119683b36a52de2217c6c7..7cd4d2bd963e1ea9369329c21981dbb814f226d1 100644 (file)
@@ -171,6 +171,7 @@ void FileOpenPanel::browseFile()
             new QListWidgetItem( toNativeSeparators( file ), ui.fileListWidg );
         item->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled );
         ui.fileListWidg->addItem( item );
+        savedirpathFromFile( file );
     }
     updateButtons();
     updateMRL();
index 3f8c2f1c2fa8e8677714c5bd63719bbd442f396b..1cae581555789b945138290c6c5a4dfbb3b18246 100644 (file)
@@ -301,6 +301,7 @@ void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
         i = 0;
         foreach( const QString &file, files )
             p_arg->psz_results[i++] = strdup( qtu( toNativeSepNoSlash( file ) ) );
+        p_intf->p_sys->filepath = qfu( p_arg->psz_results[i] );
     }
 
     /* Callback */
index 3c67343adb1dac6eb51a26ee5fc284740c8591bb..e79b14eeb41925f77b1fcc6818fbfdfe63340729 100644 (file)
@@ -490,8 +490,9 @@ static void *Thread( void *obj )
 
 
     /* Save the path */
-    config_PutPsz( p_intf, "qt-filedialog-path",
+    config_PutPsz( p_intf->p_libvlc, "qt-filedialog-path",
                    qtu( p_intf->p_sys->filepath ) );
+    msg_Dbg( p_intf, "%s", qtu( p_intf->p_sys->filepath ) );
 
     /* Delete the application automatically */
 #ifdef Q_WS_X11
index 113eb0d5c63310b1c2c77182f5ba2ec03f5c7026..5f46a6e42f25617018bdb56dd3bb70ea52e8ec45 100644 (file)
@@ -45,6 +45,7 @@ static inline QString removeTrailingSlash( QString s )
     return s;
 }
 
+#define savedirpathFromFile( a ) p_intf->p_sys->filepath = QFileInfo( a ).path()
 #define toNativeSepNoSlash( a ) toNativeSeparators( removeTrailingSlash( a ) )
 
 static inline QString colon_escape( QString s )