[vlc-devel] commit: Qt: first step to fix directory remembering. (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Jun 19 16:53:59 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jun 19 00:59:02 2009 +0200| [5f621072ec348a36e1c5444e92803c262150f08b] | committer: Jean-Baptiste Kempf 

Qt: first step to fix directory remembering.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5f621072ec348a36e1c5444e92803c262150f08b
---

 modules/gui/qt4/components/open_panels.cpp |    1 +
 modules/gui/qt4/dialogs_provider.cpp       |    1 +
 modules/gui/qt4/qt4.cpp                    |    3 ++-
 modules/gui/qt4/util/qt_dirs.hpp           |    1 +
 4 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index 4fac872..7cd4d2b 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -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();
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 3f8c2f1..1cae581 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -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 */
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 3c67343..e79b14e 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -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
diff --git a/modules/gui/qt4/util/qt_dirs.hpp b/modules/gui/qt4/util/qt_dirs.hpp
index 113eb0d..5f46a6e 100644
--- a/modules/gui/qt4/util/qt_dirs.hpp
+++ b/modules/gui/qt4/util/qt_dirs.hpp
@@ -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 )




More information about the vlc-devel mailing list