From: Jean-Baptiste Kempf Date: Fri, 8 Feb 2008 04:36:19 +0000 (+0000) Subject: Qt4 - Remove the qt-pl-showflags from preferences and put it in QSettings,because... X-Git-Tag: 0.9.0-test0~2826 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e4dd19a55d71b69934b3a54a838a866ab212942a;p=vlc Qt4 - Remove the qt-pl-showflags from preferences and put it in QSettings,because there is no way a normal being get it right. --- diff --git a/modules/gui/qt4/components/playlist/playlist_item.cpp b/modules/gui/qt4/components/playlist/playlist_item.cpp index 701f60dd51..3d52abd8f9 100644 --- a/modules/gui/qt4/components/playlist/playlist_item.cpp +++ b/modules/gui/qt4/components/playlist/playlist_item.cpp @@ -1,10 +1,11 @@ /***************************************************************************** * playlist_item.cpp : Manage playlist item **************************************************************************** - * Copyright (C) 2006-2007 the VideoLAN team + * Copyright © 2006-2008 the VideoLAN team * $Id$ * * Authors: Clément Stenac + * Jean-Baptiste Kempf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -65,7 +66,8 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m ) } else { - i_showflags = config_GetInt( model->p_intf, "qt-pl-showflags" ); + QSettings settings( "vlc", "vlc-qt-interface" ); + i_showflags = settings.value( "qt-pl-showflags" ).toInt(); updateColumnHeaders(); } } diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp index 994b39b767..e77e7d7d03 100644 --- a/modules/gui/qt4/components/playlist/playlist_model.cpp +++ b/modules/gui/qt4/components/playlist/playlist_model.cpp @@ -98,8 +98,8 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */ PLModel::~PLModel() { - config_PutInt( p_intf, "qt-pl-showflags", rootItem->i_showflags ); - config_SaveConfigFile( p_intf, NULL ); + QSettings settings( "vlc", "vlc-qt-interface" ); + settings.setValue( "qt-pl-showflags", rootItem->i_showflags ); delCallbacks(); delete rootItem; } diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index d187a2d99c..fc8756d7d6 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -474,6 +474,7 @@ inline void MainInterface::askForPrivacy() } config_PutInt( p_intf, "qt-privacy-ask" , 0 ); + /* We have to save here because the user may not launch Prefs */ config_SaveConfigFile( p_intf, NULL ); } } diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp index 530d57ad2a..d78cba0973 100644 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -1,7 +1,7 @@ /***************************************************************************** * qt4.cpp : QT4 interface **************************************************************************** - * Copyright (C) 2006-2007 the VideoLAN team + * Copyright © 2006-2008 the VideoLAN team * $Id$ * * Authors: Clément Stenac @@ -93,11 +93,6 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); " This option only works with Windows and " \ "X11 with composite extensions." ) -#define SHOWFLAGS_TEXT N_( "Define what columns to show in playlist window" ) -#define SHOWFLAGS_LONGTEXT N_( "Enter the sum of the options that you want: \n" \ - "Title: 1; Duration: 2; Artist: 4; Genre: 8; " \ - "Copyright: 16; Collection/album: 32; Rating: 256." ) - #define ERROR_TEXT N_( "Show unimportant error and warnings dialogs" ) #define UPDATER_TEXT N_( "Activate the updates availability notification" ) @@ -187,13 +182,6 @@ vlc_module_begin(); UPDATER_DAYS_TEXT, VLC_FALSE ); #endif - add_integer( "qt-pl-showflags", - VLC_META_ENGINE_ARTIST|VLC_META_ENGINE_TITLE| - VLC_META_ENGINE_DURATION|VLC_META_ENGINE_COLLECTION, - NULL, SHOWFLAGS_TEXT, - SHOWFLAGS_LONGTEXT, VLC_TRUE ); - change_autosave(); - add_bool( "qt-open-detail", VLC_FALSE, NULL, VIEWDETAIL_TEXT, VIEWDETAIL_TEXT, VLC_FALSE );