]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Use cmakedefine01
[dolphin.git] / src / dolphinmainwindow.cpp
index 77bf8698153be98bccbac5a884d2c8dd01e1b70b..1ee9fcb1f9fa4a54e0c4e66472fe07972ce5697a 100644 (file)
@@ -9,7 +9,7 @@
 #include "dolphinmainwindow.h"
 
 #include "dolphinmainwindowadaptor.h"
-#include "config-terminal.h"
+#include "config-dolphin.h"
 #include "global.h"
 #include "dolphinbookmarkhandler.h"
 #include "dolphindockwidget.h"
 
 namespace {
     // Used for GeneralSettings::version() to determine whether
-    // an updated version of Dolphin is running.
-    const int CurrentDolphinVersion = 201;
+    // an updated version of Dolphin is running, so as to migrate
+    // removed/renamed ...etc config entries; increment it in such
+    // cases
+    const int CurrentDolphinVersion = 202;
     // The maximum number of entries in the back/forward popup menu
     const int MaxNumberOfNavigationentries = 12;
     // The maximum number of "Activate Tab" shortcuts
@@ -265,7 +267,7 @@ bool DolphinMainWindow::isFoldersPanelEnabled() const
 
 bool DolphinMainWindow::isInformationPanelEnabled() const
 {
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
     return actionCollection()->action(QStringLiteral("show_information_panel"))->isChecked();
 #else
     return false;
@@ -1095,7 +1097,7 @@ void DolphinMainWindow::openTerminalHere()
     QList<QUrl> urls = {};
 
     for (const KFileItem& item : m_activeViewContainer->view()->selectedItems()) {
-        QUrl url = item.url();
+        QUrl url = item.targetUrl();
         if (item.isFile()) {
             url.setPath(QFileInfo(url.path()).absolutePath());
         }
@@ -1768,7 +1770,7 @@ void DolphinMainWindow::setupActions()
         actionCollection()->setDefaultShortcut(openTerminalHere, Qt::SHIFT | Qt::ALT | Qt::Key_F4);
         connect(openTerminalHere, &QAction::triggered, this, &DolphinMainWindow::openTerminalHere);
 
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
         QAction* focusTerminalPanel = actionCollection()->addAction(QStringLiteral("focus_terminal_panel"));
         focusTerminalPanel->setText(i18nc("@action:inmenu Tools", "Focus Terminal Panel"));
         focusTerminalPanel->setIcon(QIcon::fromTheme(QStringLiteral("swap-panels")));
@@ -1895,7 +1897,7 @@ void DolphinMainWindow::setupDockWidgets()
     infoDock->setObjectName(QStringLiteral("infoDock"));
     infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
 
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
     InformationPanel* infoPanel = new InformationPanel(infoDock);
     infoPanel->setCustomContextMenuActions({lockLayoutAction});
     connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl);
@@ -1919,7 +1921,7 @@ void DolphinMainWindow::setupDockWidgets()
     const QString panelWhatsThis = xi18nc("@info:whatsthis", "<para>To show or "
         "hide panels like this go to <interface>Control|Panels</interface> "
         "or <interface>View|Panels</interface>.</para>");
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
     actionCollection()->action(QStringLiteral("show_information_panel"))
         ->setWhatsThis(xi18nc("@info:whatsthis", "<para> This toggles the "
         "<emphasis>information</emphasis> panel at the right side of the "
@@ -1971,7 +1973,7 @@ void DolphinMainWindow::setupDockWidgets()
         "This allows quick switching between any folders.</para>") + panelWhatsThis);
 
     // Setup "Terminal"
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
     if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
         DolphinDockWidget* terminalDock = new DolphinDockWidget(i18nc("@title:window Shell terminal", "Terminal"));
         terminalDock->setLocked(lock);
@@ -2096,7 +2098,7 @@ void DolphinMainWindow::setupDockWidgets()
     panelsMenu->setPopupMode(QToolButton::InstantPopup);
     const KActionCollection* ac = actionCollection();
     panelsMenu->addAction(ac->action(QStringLiteral("show_places_panel")));
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
     panelsMenu->addAction(ac->action(QStringLiteral("show_information_panel")));
 #endif
     panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel")));