]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open_panels.cpp
Stop allocating QSettings all the time everywhere.
[vlc] / modules / gui / qt4 / components / open_panels.cpp
index 27ee2733045ababcd96737a6ddef2b551ed87aa9..a37dc279d2562c650b197a7624abadc102954d8a 100644 (file)
@@ -44,7 +44,8 @@
 #include <QDirModel>
 #include <QScrollArea>
 #include <QUrl>
-#include <QSettings>
+
+#define I_DEVICE_TOOLTIP "Select the device or the VIDEO_TS directory"
 
 /**************************************************************************
  * Open Files and subtitles                                               *
@@ -76,9 +77,8 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     dialogBox->setFileMode( QFileDialog::ExistingFiles );
     dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
 #if HAS_QT43
-    QSettings settings( "vlc", "vlc-qt-interface" );
     dialogBox->restoreState(
-            settings.value( "file-dialog-state" ).toByteArray() );
+            getSettings()->value( "file-dialog-state" ).toByteArray() );
 #endif
 
     /* We don't want to see a grip in the middle of the window, do we? */
@@ -143,8 +143,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 FileOpenPanel::~FileOpenPanel()
 {
 #if HAS_QT43
-    QSettings settings( "vlc", "vlc-qt-interface" );
-    settings.setValue( "file-dialog-state", dialogBox->saveState() );
+    getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
 #endif
 }
 
@@ -227,6 +226,9 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     b_firstvcd = true;
     b_firstcdda = true;
 
+    ui.browseDiscButton->setToolTip( I_DEVICE_TOOLTIP );
+    ui.deviceCombo->setToolTip( I_DEVICE_TOOLTIP );
+
 #if WIN32 /* Disc drives probing for Windows */
     char szDrives[512];
     szDrives[0] = '\0';
@@ -398,7 +400,7 @@ void DiscOpenPanel::updateMRL()
 void DiscOpenPanel::browseDevice()
 {
     QString dir = QFileDialog::getExistingDirectory( 0,
-            qtr("Open a device or a VIDEO_TS directory") );
+            qtr( I_DEVICE_TOOLTIP ) );
     if (!dir.isEmpty()) {
         ui.deviceCombo->setEditText( dir );
     }