X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fqt4.cpp;h=b8adf662ff06d35ad7d11ef9a83c31673380c790;hb=d727c4590f83751a2f28fcdfd8af3886ebeb45d8;hp=47c878ad56e7b97c832b2bc382157abeb1a5a994;hpb=0b192b63d05cddfbb291c98c20852d36272a4de3;p=vlc diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp index 47c878ad56..b8adf662ff 100644 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -244,6 +244,7 @@ static int Open( vlc_object_t *p_this ) p_intf->p_sys->p_playlist = pl_Yield( p_intf ); /* Listen to the messages */ p_intf->p_sys->p_sub = msg_Subscribe( p_intf ); + /* one settings to rule them all */ var_Create( p_this, "window_widget", VLC_VAR_ADDRESS ); return VLC_SUCCESS; @@ -323,6 +324,14 @@ static void Init( intf_thread_t *p_intf ) QApplication *app = new QApplication( argc, argv , true ); p_intf->p_sys->p_app = app; + p_intf->p_sys->mainSettings = new QSettings( +#ifdef WIN32 + QSettings::IniFormat, +#else + QSettings::NativeFormat, +#endif + QSettings::UserScope, "vlc", "vlc-qt-interface" ); + /* Icon setting FIXME: use a bigger icon ? */ if( QDate::currentDate().dayOfYear() >= 354 ) @@ -390,13 +399,12 @@ static void Init( intf_thread_t *p_intf ) if( config_GetInt( p_intf, "qt-updates-notif" ) ) { int interval = config_GetInt( p_intf, "qt-updates-days" ); - QSettings settings( "vlc", "vlc-qt-interface" ); if( QDate::currentDate() > - settings.value( "updatedate" ).toDate().addDays( interval ) ) + getSettings()->value( "updatedate" ).toDate().addDays( interval ) ) { /* The constructor of the update Dialog will do the 1st request */ UpdateDialog::getInstance( p_intf ); - settings.setValue( "updatedate", QDate::currentDate() ); + getSettings()->setValue( "updatedate", QDate::currentDate() ); } } #endif @@ -425,6 +433,9 @@ static void Init( intf_thread_t *p_intf ) /* Destroy the MainInputManager */ MainInputManager::killInstance(); + /* Delete the configuration */ + delete p_intf->p_sys->mainSettings; + /* Delete the application */ delete app;