]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Build TerminalPanel also on Windows
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 21 Jan 2018 11:18:21 +0000 (12:18 +0100)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 10 Feb 2018 18:40:15 +0000 (19:40 +0100)
Summary:
terminalpanel.cpp *should* compile on Windows, so there is no reason to
remove it from the build and use tons of #ifdefs in dolphinmainwindow.

We still keep the terminal panel disabled on Windows
(i.e. the two remaining #ifndef Q_OS_WIN in dolphinmainwindow),
because it is probably not functional.

But at least we won't break the Windows CI every time
someone touches the terminal panel code (see e.g. 2e942237c9).

Test Plan: Builds on Linux, someone on Windows should test this patch if possible.

Reviewers: #dolphin, #craft

Differential Revision: https://phabricator.kde.org/D10006

src/CMakeLists.txt
src/dolphinmainwindow.cpp
src/dolphinmainwindow.h

index 9a8302ff14e83549843c339657e5f6fbed3838c5..89180b78056ba4177fd5dc983b8226efcd7f9c0d 100644 (file)
@@ -224,6 +224,7 @@ set(dolphinstatic_SRCS
     panels/folders/foldersitemlistwidget.cpp
     panels/folders/treeviewcontextmenu.cpp
     panels/folders/folderspanel.cpp
+    panels/terminal/terminalpanel.cpp
     search/dolphinfacetswidget.cpp
     search/dolphinsearchbox.cpp
     settings/general/behaviorsettingspage.cpp
@@ -266,10 +267,6 @@ kconfig_add_kcfg_files(dolphinstatic_SRCS GENERATE_MOC
     settings/dolphin_versioncontrolsettings.kcfgc
 )
 
-if(NOT WIN32)
-   set(dolphinstatic_SRCS ${dolphinstatic_SRCS} panels/terminal/terminalpanel.cpp)
-endif()
-
 qt5_add_resources(dolphinstatic_SRCS dolphin.qrc)
 
 add_library(dolphinstatic STATIC ${dolphinstatic_SRCS})
index d3e2fd90753e729f27e72e96fb502cdd24adc5bf..da241e20e5016a845961b646b389425ed9c018a7 100644 (file)
@@ -33,6 +33,7 @@
 #include "panels/folders/folderspanel.h"
 #include "panels/places/placespanel.h"
 #include "panels/information/informationpanel.h"
+#include "panels/terminal/terminalpanel.h"
 #include "settings/dolphinsettingsdialog.h"
 #include "statusbar/dolphinstatusbar.h"
 #include "views/dolphinviewactionhandler.h"
 #include "views/viewproperties.h"
 #include "views/dolphinnewfilemenuobserver.h"
 
-#ifndef Q_OS_WIN
-#include "panels/terminal/terminalpanel.h"
-#endif
-
 #include "dolphin_generalsettings.h"
 
 #include <KActionCollection>
@@ -100,9 +97,7 @@ DolphinMainWindow::DolphinMainWindow() :
     m_controlButton(nullptr),
     m_updateToolBarTimer(nullptr),
     m_lastHandleUrlStatJob(nullptr),
-#ifndef Q_OS_WIN
     m_terminalPanel(nullptr),
-#endif
     m_placesPanel(nullptr),
     m_tearDownFromPlacesRequested(false)
 {
@@ -631,11 +626,9 @@ void DolphinMainWindow::togglePanelLockState()
 
 void DolphinMainWindow::slotTerminalPanelVisibilityChanged()
 {
-#ifndef Q_OS_WIN
     if (m_terminalPanel->isHiddenInVisibleWindow()) {
         m_activeViewContainer->view()->setFocus();
     }
-#endif
 }
 
 void DolphinMainWindow::goBack()
@@ -1025,7 +1018,6 @@ void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
 
 void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath)
 {
-#ifndef Q_OS_WIN
     if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
         m_tearDownFromPlacesRequested = true;
         m_terminalPanel->goHome();
@@ -1033,17 +1025,14 @@ void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mo
     } else {
         m_placesPanel->proceedWithTearDown();
     }
-#endif
 }
 
 void DolphinMainWindow::slotStorageTearDownExternallyRequested(const QString& mountPath)
 {
-#ifndef Q_OS_WIN
     if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
         m_tearDownFromPlacesRequested = false;
         m_terminalPanel->goHome();
     }
-#endif
 }
 
 void DolphinMainWindow::setupActions()
@@ -1368,9 +1357,7 @@ void DolphinMainWindow::setupDockWidgets()
     panelsMenu->addAction(ac->action(QStringLiteral("show_places_panel")));
     panelsMenu->addAction(ac->action(QStringLiteral("show_information_panel")));
     panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel")));
-#ifndef Q_OS_WIN
     panelsMenu->addAction(ac->action(QStringLiteral("show_terminal_panel")));
-#endif
     panelsMenu->addSeparator();
     panelsMenu->addAction(lockLayoutAction);
 }
index e81793b0f23e052cd64a60e3102b0228f9a25632..5e900e930d9fb40ec1e5dfa4a44df27426064e36 100644 (file)
@@ -47,9 +47,7 @@ class KNewFileMenu;
 class QToolButton;
 class QIcon;
 class PlacesPanel;
-#ifndef Q_OS_WIN
 class TerminalPanel;
-#endif
 
 /**
  * @short Main window for Dolphin.
@@ -517,9 +515,7 @@ private:
 
     KIO::Job* m_lastHandleUrlStatJob;
 
-#ifndef Q_OS_WIN
     TerminalPanel* m_terminalPanel;
-#endif
     PlacesPanel* m_placesPanel;
     bool m_tearDownFromPlacesRequested;
 };