diff options
-rw-r--r-- | src/libs/utils/appmainwindow.cpp (renamed from src/plugins/coreplugin/eventfilteringmainwindow.cpp) | 14 | ||||
-rw-r--r-- | src/libs/utils/appmainwindow.h (renamed from src/plugins/coreplugin/eventfilteringmainwindow.h) | 21 | ||||
-rw-r--r-- | src/libs/utils/utils-lib.pri | 6 | ||||
-rw-r--r-- | src/libs/utils/utils.qbs | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/coreplugin.pro | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/coreplugin.qbs | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/mainwindow.h | 5 |
8 files changed, 24 insertions, 30 deletions
diff --git a/src/plugins/coreplugin/eventfilteringmainwindow.cpp b/src/libs/utils/appmainwindow.cpp index b4a786b0ec..5eb8f4ab19 100644 --- a/src/plugins/coreplugin/eventfilteringmainwindow.cpp +++ b/src/libs/utils/appmainwindow.cpp @@ -30,7 +30,7 @@ ** **************************************************************************/ -#include "eventfilteringmainwindow.h" +#include "appmainwindow.h" #ifdef Q_OS_WIN #include <windows.h> @@ -40,8 +40,7 @@ #include <QEvent> #include <QCoreApplication> -namespace Core { -namespace Internal { +namespace Utils { /* The notification signal is delayed by using a custom event * as otherwise device removal is not detected properly @@ -52,13 +51,13 @@ public: explicit DeviceNotifyEvent(int id) : QEvent(static_cast<QEvent::Type>(id)) {} }; -EventFilteringMainWindow::EventFilteringMainWindow() : +AppMainWindow::AppMainWindow() : m_deviceEventId(QEvent::registerEventType(QEvent::User + 2)) { } #ifdef Q_OS_WIN -bool EventFilteringMainWindow::event(QEvent *event) +bool AppMainWindow::event(QEvent *event) { if (event->type() == m_deviceEventId) { event->accept(); @@ -68,7 +67,7 @@ bool EventFilteringMainWindow::event(QEvent *event) return QMainWindow::event(event); } -bool EventFilteringMainWindow::winEvent(MSG *msg, long *result) +bool AppMainWindow::winEvent(MSG *msg, long *result) { if (msg->message == WM_DEVICECHANGE) { if (msg->wParam & 0x7 /* DBT_DEVNODES_CHANGED */) { @@ -80,6 +79,5 @@ bool EventFilteringMainWindow::winEvent(MSG *msg, long *result) } #endif -} // namespace Internal -} // namespace Core +} // namespace Utils diff --git a/src/plugins/coreplugin/eventfilteringmainwindow.h b/src/libs/utils/appmainwindow.h index ae534ecd90..928adb678d 100644 --- a/src/plugins/coreplugin/eventfilteringmainwindow.h +++ b/src/libs/utils/appmainwindow.h @@ -30,28 +30,24 @@ ** **************************************************************************/ -#ifndef EVENTFILTERINGMAINWINDOW_H -#define EVENTFILTERINGMAINWINDOW_H +#ifndef APPMAINWINDOW_H +#define APPMAINWINDOW_H +#include "utils_global.h" #include <QMainWindow> -QT_BEGIN_NAMESPACE - -QT_END_NAMESPACE - -namespace Core { -namespace Internal { +namespace Utils { /*! * This class only exists because we can't include windows.h in mainwindow.cpp * because windows defines an IContext... */ -class EventFilteringMainWindow : public QMainWindow +class QTCREATOR_UTILS_EXPORT AppMainWindow : public QMainWindow { Q_OBJECT public: - EventFilteringMainWindow(); + AppMainWindow(); signals: void deviceChange(); @@ -66,7 +62,6 @@ private: const int m_deviceEventId; }; -} // Internal -} // Core +} // Utils -#endif // EVENTFILTERINGMAINWINDOW_H +#endif // APPMAINWINDOW_H diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index 505be0c768..152c0ad47d 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -96,7 +96,8 @@ SOURCES += $$PWD/environment.cpp \ $$PWD/completingtextedit.cpp \ $$PWD/json.cpp \ $$PWD/portlist.cpp \ - $$PWD/tcpportsgatherer.cpp + $$PWD/tcpportsgatherer.cpp \ + $$PWD/appmainwindow.cpp win32 { SOURCES += \ @@ -209,7 +210,8 @@ HEADERS += \ $$PWD/multitask.h \ $$PWD/runextensions.h \ $$PWD/portlist.h \ - $$PWD/tcpportsgatherer.h + $$PWD/tcpportsgatherer.h \ + $$PWD/appmainwindow.h FORMS += $$PWD/filewizardpage.ui \ $$PWD/projectintropage.ui \ diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index 9ee2a12733..7a5c757474 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -57,6 +57,8 @@ DynamicLibrary { "fancylineedit.h", "fancymainwindow.cpp", "fancymainwindow.h", + "appmainwindow.h", + "appmainwindow.cpp", "fileinprojectfinder.cpp", "fileinprojectfinder.h", "filenamevalidatinglineedit.h", diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index d7eb7b20b0..886e54f7c8 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -75,7 +75,6 @@ SOURCES += mainwindow.cpp \ dialogs/ioptionspage.cpp \ dialogs/iwizard.cpp \ settingsdatabase.cpp \ - eventfilteringmainwindow.cpp \ imode.cpp \ editormanager/systemeditor.cpp \ designmode.cpp \ @@ -170,7 +169,6 @@ HEADERS += mainwindow.h \ fileiconprovider.h \ mimedatabase.h \ settingsdatabase.h \ - eventfilteringmainwindow.h \ editormanager/systemeditor.h \ designmode.h \ editortoolbar.h \ diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index d0fbcd5c0c..92e4673622 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -46,8 +46,6 @@ QtcPlugin { "editmode.h", "editortoolbar.cpp", "editortoolbar.h", - "eventfilteringmainwindow.cpp", - "eventfilteringmainwindow.h", "externaltool.cpp", "externaltool.h", "externaltoolmanager.h", diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index baa881d204..90ba6e962a 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -126,7 +126,7 @@ using namespace Core::Internal; enum { debugMainWindow = 0 }; MainWindow::MainWindow() : - EventFilteringMainWindow(), + Utils::AppMainWindow(), m_coreImpl(new ICore(this)), m_additionalContexts(Constants::C_GLOBAL), m_settings(ExtensionSystem::PluginManager::instance()->settings()), diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index ed60198476..f510a9c50a 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -33,10 +33,11 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include "eventfilteringmainwindow.h" #include "icontext.h" #include "icore.h" +#include <utils/appmainwindow.h> + #include <QMap> #include <QColor> @@ -80,7 +81,7 @@ class StatusBarManager; class VersionDialog; class SystemEditor; -class MainWindow : public EventFilteringMainWindow +class MainWindow : public Utils::AppMainWindow { Q_OBJECT |