X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ca26d35f549c87492a56811fbeede8f795380aea..73ff57bef44984643bf1ffdb9a478095cfb78dfb:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e71790656..24da84132 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -9,7 +9,6 @@ #include "dolphinmainwindow.h" #include "dolphinmainwindowadaptor.h" -#include "config-terminal.h" #include "global.h" #include "dolphinbookmarkhandler.h" #include "dolphindockwidget.h" @@ -86,8 +85,10 @@ 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 +266,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; @@ -284,6 +285,11 @@ void DolphinMainWindow::activateWindow() KWindowSystem::activateWindow(window()->effectiveWinId()); } +bool DolphinMainWindow::isActiveWindow() +{ + return window()->isActiveWindow(); +} + void DolphinMainWindow::showCommand(CommandType command) { DolphinStatusBar* statusBar = m_activeViewContainer->statusBar(); @@ -1768,7 +1774,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 +1901,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 +1925,7 @@ void DolphinMainWindow::setupDockWidgets() const QString panelWhatsThis = xi18nc("@info:whatsthis", "To show or " "hide panels like this go to Control|Panels " "or View|Panels."); -#ifdef HAVE_BALOO +#if HAVE_BALOO actionCollection()->action(QStringLiteral("show_information_panel")) ->setWhatsThis(xi18nc("@info:whatsthis", " This toggles the " "information panel at the right side of the " @@ -1971,7 +1977,7 @@ void DolphinMainWindow::setupDockWidgets() "This allows quick switching between any folders.") + 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 +2102,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"))); @@ -2621,8 +2627,12 @@ void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job) } } -bool DolphinMainWindow::isUrlOpen(const QString& url) +bool DolphinMainWindow::isUrlOpen(const QString &url) { - return m_tabWidget->isUrlOpen(QUrl::fromUserInput((url))); + return m_tabWidget->isUrlOpen(QUrl::fromUserInput(url)); } +bool DolphinMainWindow::isUrlOrParentOpen(const QString &url) +{ + return m_tabWidget->isUrlOrParentOpen(QUrl::fromUserInput(url)); +}