[vlc-devel] commit: Qt: store the filedialog path in Qt setings, instead of vlc config (internal option, btw) (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Jun 19 17:12:05 CEST 2009


vlc | branch: 1.0-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jun 19 01:05:58 2009 +0200| [b2033eff56dbd0258d30d3c3a3dd400bb9d1c615] | committer: Jean-Baptiste Kempf 

Qt: store the filedialog path in Qt setings, instead of vlc config (internal option, btw)

This simplifies a bit the code, should solve the issue reported over and over by the users.
(cherry picked from commit 34102147f3c10d5b60c084e0fea7fee20c91e7bb)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/qt4.cpp |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 8cdef8b..90a5ae4 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -95,8 +95,6 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
 #define TITLE_LONGTEXT N_( "Show the name of the song or video in the " \
                            "controler window title." )
 
-#define FILEDIALOG_PATH_TEXT N_( "Path to use in openfile dialog" )
-
 #define NOTIFICATION_TEXT N_( "Show notification popup on track change" )
 #define NOTIFICATION_LONGTEXT N_( \
     "Show a notification popup with the artist and track name when " \
@@ -198,10 +196,6 @@ vlc_module_begin ()
               COMPLETEVOL_LONGTEXT, true )
     add_bool( "qt-autosave-volume", false, NULL, SAVEVOL_TEXT,
               SAVEVOL_TEXT, true )
-    add_string( "qt-filedialog-path", NULL, NULL, FILEDIALOG_PATH_TEXT,
-                FILEDIALOG_PATH_TEXT, true )
-        change_autosave ()
-        change_internal ()
 
     add_bool( "qt-embedded-open", false, NULL, QT_NATIVEOPEN_TEXT,
                QT_NATIVEOPEN_TEXT, false )
@@ -457,12 +451,8 @@ static void *Thread( void *obj )
     app.setQuitOnLastWindowClosed( false );
 
     /* Retrieve last known path used in file browsing */
-    {
-        char *psz_path = config_GetPsz( p_intf, "qt-filedialog-path" );
-        p_intf->p_sys->filepath =
-            EMPTY_STR( psz_path ) ? config_GetHomeDir() : qfu( psz_path );
-        free( psz_path );
-    }
+    p_intf->p_sys->filepath =
+         getSettings()->value( "filedialog-path", config_GetHomeDir() ).toString();
 
     /* Launch */
     app.exec();
@@ -493,6 +483,9 @@ static void *Thread( void *obj )
     /* Delete the recentsMRL object before the configuration */
     RecentsMRL::killInstance();
 
+    /* Save the path */
+    getSettings()->setValue( "filedialog-path", p_intf->p_sys->filepath );
+
     /* Delete the configuration. Application has to be deleted after that. */
     delete p_intf->p_sys->mainSettings;
 
@@ -500,10 +493,6 @@ static void *Thread( void *obj )
     MainInputManager::killInstance();
 
 
-    /* Save the 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




More information about the vlc-devel mailing list