]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Do not create instance of GeneralSettings just to access static members
authorAlexander Lohnau <alexander.lohnau@gmx.de>
Fri, 11 Dec 2020 19:05:15 +0000 (20:05 +0100)
committerAlexander Lohnau <alexander.lohnau@gmx.de>
Fri, 11 Dec 2020 19:06:51 +0000 (20:06 +0100)
src/dolphinmainwindow.cpp

index beec95c6c6ef3adc3df528e770088f3d01da8d0e..27949fb1776f4cde60da6ba4bde111ad57a33fd3 100644 (file)
@@ -134,10 +134,9 @@ DolphinMainWindow::DolphinMainWindow() :
     connect(undoManager, &KIO::FileUndoManager::jobRecordingFinished,
             this, &DolphinMainWindow::showCommand);
 
-    GeneralSettings* generalSettings = GeneralSettings::self();
-    const bool firstRun = (generalSettings->version() < 200);
+    const bool firstRun = (GeneralSettings::version() < 200);
     if (firstRun) {
-        generalSettings->setViewPropsTimestamp(QDateTime::currentDateTime());
+        GeneralSettings::setViewPropsTimestamp(QDateTime::currentDateTime());
     }
 
     setAcceptDrops(true);
@@ -174,7 +173,7 @@ DolphinMainWindow::DolphinMainWindow() :
             this, &DolphinMainWindow::updatePasteAction);
 
     QAction* toggleFilterBarAction = actionCollection()->action(QStringLiteral("toggle_filter"));
-    toggleFilterBarAction->setChecked(generalSettings->filterBar());
+    toggleFilterBarAction->setChecked(GeneralSettings::filterBar());
 
     if (firstRun) {
         menuBar()->setVisible(false);