]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't enable the search panel per default
authorPeter Penz <peter.penz19@gmail.com>
Sat, 13 Aug 2011 10:42:53 +0000 (12:42 +0200)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 13 Aug 2011 10:45:14 +0000 (12:45 +0200)
Assure that the search panel also stays disabled when updating
from an older Dolphin version.

BUG: 279348
FIXED-IN: 4.7.1

src/dolphinmainwindow.cpp
src/settings/dolphin_generalsettings.kcfg

index d1f1c1a8673dd41c3f380cdde291df8be974745d..f495cef54e7f8320e1c2af2e6b417083b52bca6f 100644 (file)
 #include <QToolButton>
 #include <QSplitter>
 
 #include <QToolButton>
 #include <QSplitter>
 
+namespace {
+    // Used for GeneralSettings::version() to determine whether
+    // an updated version of Dolphin is running.
+    const int CurrentDolphinVersion = 171;
+};
+
 /*
  * Menu shown when pressing the configure-button in the toolbar.
  */
 /*
  * Menu shown when pressing the configure-button in the toolbar.
  */
@@ -647,6 +653,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
     }
 
     generalSettings->setFirstRun(false);
     }
 
     generalSettings->setFirstRun(false);
+    generalSettings->setVersion(CurrentDolphinVersion);
 
     settings.save();
 
 
     settings.save();
 
@@ -1838,17 +1845,24 @@ void DolphinMainWindow::setupDockWidgets()
             searchPanel, SLOT(setUrl(KUrl)));
 #endif
 
             searchPanel, SLOT(setUrl(KUrl)));
 #endif
 
-    const bool firstRun = DolphinSettings::instance().generalSettings()->firstRun();
+    const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
+    const bool firstRun = generalSettings->firstRun();
     if (firstRun) {
         infoDock->hide();
         foldersDock->hide();
 #ifndef Q_OS_WIN
         terminalDock->hide();
 #endif
     if (firstRun) {
         infoDock->hide();
         foldersDock->hide();
 #ifndef Q_OS_WIN
         terminalDock->hide();
 #endif
+    }
+
 #ifdef HAVE_NEPOMUK
 #ifdef HAVE_NEPOMUK
+    // The search dock has been introduced with Dolphin 1.7.0. Hide it per
+    // default when updating from an older Dolphin version or when Dolphin is
+    // started the first time.
+    if (firstRun || generalSettings->version() < 170) {
         searchDock->hide();
         searchDock->hide();
-#endif
     }
     }
+#endif
 
     // Setup "Places"
     DolphinDockWidget* placesDock = new DolphinDockWidget(i18nc("@title:window", "Places"));
 
     // Setup "Places"
     DolphinDockWidget* placesDock = new DolphinDockWidget(i18nc("@title:window", "Places"));
index ee219d953064f11d3fe38fb8c710cbf87c1fa38e..c5f6f745618a578b9179236951174420d160b361 100644 (file)
             <label>Is the application started the first time (internal setting not shown in the UI)</label>
             <default>true</default>
         </entry>
             <label>Is the application started the first time (internal setting not shown in the UI)</label>
             <default>true</default>
         </entry>
+        <entry name="Version" type="Int">
+            <label>Internal version of Dolphin, containing 3 digits for mayor, minor, bugfix</label>
+            <default>0</default>
+        </entry>
         <entry name="ModifiedStartupSettings" type="Bool">
             <label>Have the startup settings been modified (internal setting not shown in the UI)</label>
             <default>false</default>
         <entry name="ModifiedStartupSettings" type="Bool">
             <label>Have the startup settings been modified (internal setting not shown in the UI)</label>
             <default>false</default>