forked from qt-creator/qt-creator
Core: Replace ICoreListener by std::functions
ICoreListener::coreAboutToClose() remains in the core, ICoreListener::editorAboutToClose() is handled by a new EditorManager::addCloseEditorListener() function. This removes the need for some boiler plate code resulting from the need to implement the interface in custom classes (DesignModeCoreListener, EditorClosingCoreListener, PojectEplorer::CoreListener and VcsBase::CoreListener). EditorManager::addCloseEditorListener Change-Id: Ie554c987b5455b555be6d77b77e4013639201d22 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -40,6 +40,8 @@
|
||||
#include <QMap>
|
||||
#include <QColor>
|
||||
|
||||
#include <functional>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QSettings;
|
||||
class QPrinter;
|
||||
@@ -113,6 +115,8 @@ public:
|
||||
QStringList additionalAboutInformation() const;
|
||||
void appendAboutInformation(const QString &line);
|
||||
|
||||
void addPreCloseListener(const std::function<bool()> &listener);
|
||||
|
||||
signals:
|
||||
void newItemDialogRunningChanged();
|
||||
|
||||
@@ -201,6 +205,7 @@ private:
|
||||
|
||||
QToolButton *m_toggleSideBarButton;
|
||||
QColor m_overrideColor;
|
||||
QList<std::function<bool()>> m_preCloseListeners;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user