diff --git a/src/plugins/projectexplorer/abstractprocess.h b/src/libs/utils/abstractprocess.h similarity index 93% rename from src/plugins/projectexplorer/abstractprocess.h rename to src/libs/utils/abstractprocess.h index 334f8609e7109edafce2fdc8c225244564bc8491..72049c36c027be70c002f16395a9c9d27e078cde 100644 --- a/src/plugins/projectexplorer/abstractprocess.h +++ b/src/libs/utils/abstractprocess.h @@ -30,12 +30,14 @@ #ifndef ABSTRACTPROCESS_H #define ABSTRACTPROCESS_H +#include "utils_global.h" + #include <QtCore/QStringList> -namespace ProjectExplorer { -namespace Internal { +namespace Core { +namespace Utils { -class AbstractProcess +class QWORKBENCH_UTILS_EXPORT AbstractProcess { public: AbstractProcess() {} @@ -62,8 +64,8 @@ private: QStringList m_environment; }; -} //namespace Internal -} //namespace Qt4ProjectManager +} //namespace Utils +} //namespace Core #endif // ABSTRACTPROCESS_H diff --git a/src/plugins/projectexplorer/consoleprocess.h b/src/libs/utils/consoleprocess.h similarity index 92% rename from src/plugins/projectexplorer/consoleprocess.h rename to src/libs/utils/consoleprocess.h index aece7a78a8e3fd533d5ffe61737f766813546c22..6dfaaa0bb5e8f9d1824a5a18e48608b225548948 100644 --- a/src/plugins/projectexplorer/consoleprocess.h +++ b/src/libs/utils/consoleprocess.h @@ -30,6 +30,8 @@ #ifndef CONSOLEPROCESS_H #define CONSOLEPROCESS_H +#include "abstractprocess.h" + #include <QtCore/QObject> #include <QtCore/QString> #include <QtCore/QStringList> @@ -40,13 +42,10 @@ class QWinEventNotifier; #endif -#include "abstractprocess.h" - - -namespace ProjectExplorer { -namespace Internal { +namespace Core { +namespace Utils { -class ConsoleProcess : public QObject, public AbstractProcess +class QWORKBENCH_UTILS_EXPORT ConsoleProcess : public QObject, public AbstractProcess { Q_OBJECT @@ -81,7 +80,7 @@ private slots: private: PROCESS_INFORMATION *m_pid; QWinEventNotifier *processFinishedNotifier; -#elif defined(Q_OS_UNIX) +#else private: QProcess *m_process; private slots: @@ -90,7 +89,7 @@ private slots: }; -} //namespace Internal -} //namespace Qt4ProjectManager +} //namespace Utils +} //namespace Core #endif diff --git a/src/plugins/projectexplorer/consoleprocess_unix.cpp b/src/libs/utils/consoleprocess_unix.cpp similarity index 98% rename from src/plugins/projectexplorer/consoleprocess_unix.cpp rename to src/libs/utils/consoleprocess_unix.cpp index b514625ccee2ea287f4604097c3322b1391bad8a..874106cf6c9cc876affe6096d4420bba21beb55b 100644 --- a/src/plugins/projectexplorer/consoleprocess_unix.cpp +++ b/src/libs/utils/consoleprocess_unix.cpp @@ -29,7 +29,7 @@ #include "consoleprocess.h" -using namespace ProjectExplorer::Internal; +using namespace Core::Utils; ConsoleProcess::ConsoleProcess(QObject *parent) : QObject(parent) diff --git a/src/plugins/projectexplorer/consoleprocess_win.cpp b/src/libs/utils/consoleprocess_win.cpp similarity index 99% rename from src/plugins/projectexplorer/consoleprocess_win.cpp rename to src/libs/utils/consoleprocess_win.cpp index 3f4ba60d1b19ebc7f5bdfa2e05b7622f49e43125..94409bee1be00047a55ceec0c7c5fe7e9e0fc2fe 100644 --- a/src/plugins/projectexplorer/consoleprocess_win.cpp +++ b/src/libs/utils/consoleprocess_win.cpp @@ -27,15 +27,15 @@ ** **************************************************************************/ +#include "consoleprocess.h" + #include <QtCore/QDir> #include <QtCore/private/qwineventnotifier_p.h> #include <QtCore/QAbstractEventDispatcher> #include <Tlhelp32.h> -#include "consoleprocess.h" - -using namespace ProjectExplorer::Internal; +using namespace Core::Utils; ConsoleProcess::ConsoleProcess(QObject *parent) : QObject(parent) diff --git a/src/libs/utils/utils.pro b/src/libs/utils/utils.pro index d98ca1d889b210665dddeb9adea9a2308f00d43c..74f25b0488c4f3aa935c2a9d81c8df681019f5c1 100644 --- a/src/libs/utils/utils.pro +++ b/src/libs/utils/utils.pro @@ -25,6 +25,9 @@ SOURCES += \ submiteditorwidget.cpp \ synchronousprocess.cpp +win32:SOURCES += consoleprocess_win.cpp +else:SOURCES += consoleprocess_unix.cpp + HEADERS += \ utils_global.h \ reloadpromptutils.h \ @@ -45,6 +48,8 @@ HEADERS += \ fancylineedit.h \ qtcolorbutton.h \ submiteditorwidget.h \ + abstractprocess.h \ + consoleprocess.h \ synchronousprocess.h FORMS += filewizardpage.ui \ diff --git a/src/plugins/projectexplorer/applicationlauncher.h b/src/plugins/projectexplorer/applicationlauncher.h index 3a71a811bcd1667ceb5cf7946de9aac282691bac..6643da0136fb8344370a6e4b02bfdc2b0554f52f 100644 --- a/src/plugins/projectexplorer/applicationlauncher.h +++ b/src/plugins/projectexplorer/applicationlauncher.h @@ -37,10 +37,15 @@ #include <QtCore/QTextCodec> #endif +namespace Core { +namespace Utils { +class ConsoleProcess; +} +} + namespace ProjectExplorer { namespace Internal { -class ConsoleProcess; class WinGuiProcess; class ApplicationLauncher : public QObject @@ -84,7 +89,7 @@ private slots: private: QProcess *m_guiProcess; - ConsoleProcess *m_consoleProcess; + Core::Utils::ConsoleProcess *m_consoleProcess; Mode m_currentMode; #ifdef Q_OS_WIN diff --git a/src/plugins/projectexplorer/applicationlauncher_win.cpp b/src/plugins/projectexplorer/applicationlauncher_win.cpp index cc81a60c87266039045d1dbb0fe76f3a8e74069f..cb98a68dda20e7f6b14d670a92d3155859d985f0 100644 --- a/src/plugins/projectexplorer/applicationlauncher_win.cpp +++ b/src/plugins/projectexplorer/applicationlauncher_win.cpp @@ -34,6 +34,7 @@ #include <QDebug> using namespace ProjectExplorer::Internal; +using namespace Core::Utils; ApplicationLauncher::ApplicationLauncher(QObject *parent) : QObject(parent) diff --git a/src/plugins/projectexplorer/applicationlauncher_x11.cpp b/src/plugins/projectexplorer/applicationlauncher_x11.cpp index 815a1f9ff3108358f4391b3ae72719b9ba126c90..b82db98a4168c205705c51759ed8025196d12827 100644 --- a/src/plugins/projectexplorer/applicationlauncher_x11.cpp +++ b/src/plugins/projectexplorer/applicationlauncher_x11.cpp @@ -33,6 +33,7 @@ #include <QtCore/QTimer> using namespace ProjectExplorer::Internal; +using namespace Core::Utils; ApplicationLauncher::ApplicationLauncher(QObject *parent) : QObject(parent) diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index 1feeea4ebd87c6145a9c80537baa526ca7e075c9..460dd658718ded5b26b79f2810ab43034237380c 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -5,6 +5,8 @@ QT += xml \ include(../../qworkbenchplugin.pri) include(projectexplorer_dependencies.pri) include(../../shared/scriptwrapper/scriptwrapper.pri) +include(../../libs/utils/utils.pri) +INCLUDEPATH += $$PWD/../../libs/utils HEADERS += projectexplorer.h \ projectexplorer_export.h \ projectwindow.h \ @@ -37,8 +39,6 @@ HEADERS += projectexplorer.h \ editorsettingspropertiespage.h \ runconfiguration.h \ applicationlauncher.h \ - consoleprocess.h \ - abstractprocess.h \ applicationrunconfiguration.h \ runsettingspropertiespage.h \ projecttreewidget.h \ @@ -114,12 +114,10 @@ FORMS += dependenciespanel.ui \ buildstepspage.ui \ removefiledialog.ui win32 { - SOURCES += consoleprocess_win.cpp \ - applicationlauncher_win.cpp \ + SOURCES += applicationlauncher_win.cpp \ winguiprocess.cpp HEADERS += winguiprocess.h } -else:unix:SOURCES += consoleprocess_unix.cpp \ - applicationlauncher_x11.cpp +else:unix:SOURCES += applicationlauncher_x11.cpp RESOURCES += projectexplorer.qrc DEFINES += PROJECTEXPLORER_LIBRARY diff --git a/src/plugins/projectexplorer/winguiprocess.h b/src/plugins/projectexplorer/winguiprocess.h index 99b618a1706779d177474d0277c31f3b71f2b12f..9fd2a8240507e48561fff06bd8c5cd1f801a8b25 100644 --- a/src/plugins/projectexplorer/winguiprocess.h +++ b/src/plugins/projectexplorer/winguiprocess.h @@ -37,6 +37,8 @@ #include <windows.h> +using namespace Core::Utils; + namespace ProjectExplorer { namespace Internal {