Clang: Break dependency to visible Core::EditorManager::visibleEditors()

Change-Id: I4157cd190a8c00b07c0e2f3eeeab18409f2405b7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2016-01-11 11:54:27 +01:00
parent e134dfcad4
commit cc1ed420c2
5 changed files with 26 additions and 0 deletions

View File

@@ -27,6 +27,8 @@
#include "cpptoolsbridgeinterface.h" #include "cpptoolsbridgeinterface.h"
#include <QList>
namespace CppTools { namespace CppTools {
std::unique_ptr<CppToolsBridgeInterface> CppToolsBridge::m_interface; std::unique_ptr<CppToolsBridgeInterface> CppToolsBridge::m_interface;
@@ -56,4 +58,9 @@ void CppToolsBridge::finishedRefreshingSourceFiles(const QSet<QString> &filePath
m_interface->finishedRefreshingSourceFiles(filePaths); m_interface->finishedRefreshingSourceFiles(filePaths);
} }
QList<Core::IEditor *> CppToolsBridge::visibleEditors()
{
return m_interface->visibleEditors();
}
} // namespace CppTools } // namespace CppTools

View File

@@ -32,6 +32,10 @@
#include <memory> #include <memory>
namespace Core {
class IEditor;
}
namespace CppTools { namespace CppTools {
class CppEditorDocumentHandle; class CppEditorDocumentHandle;
class BaseEditorDocumentProcessor; class BaseEditorDocumentProcessor;
@@ -47,6 +51,7 @@ public:
static QString projectPartIdForFile(const QString &filePath); static QString projectPartIdForFile(const QString &filePath);
static BaseEditorDocumentProcessor *baseEditorDocumentProcessor(const QString &filePath); static BaseEditorDocumentProcessor *baseEditorDocumentProcessor(const QString &filePath);
static void finishedRefreshingSourceFiles(const QSet<QString> &filePaths); static void finishedRefreshingSourceFiles(const QSet<QString> &filePaths);
static QList<Core::IEditor *> visibleEditors();
private: private:
static std::unique_ptr<CppToolsBridgeInterface> m_interface; static std::unique_ptr<CppToolsBridgeInterface> m_interface;

View File

@@ -32,6 +32,10 @@ QT_BEGIN_NAMESPACE
class QString; class QString;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
class IEditor;
}
namespace CppTools { namespace CppTools {
class CppEditorDocumentHandle; class CppEditorDocumentHandle;
class BaseEditorDocumentProcessor; class BaseEditorDocumentProcessor;
@@ -44,6 +48,8 @@ public:
virtual QString projectPartIdForFile(const QString &filePath) const = 0; virtual QString projectPartIdForFile(const QString &filePath) const = 0;
virtual BaseEditorDocumentProcessor *baseEditorDocumentProcessor(const QString &filePath) const = 0; virtual BaseEditorDocumentProcessor *baseEditorDocumentProcessor(const QString &filePath) const = 0;
virtual void finishedRefreshingSourceFiles(const QSet<QString> &filePaths) const = 0; virtual void finishedRefreshingSourceFiles(const QSet<QString> &filePaths) const = 0;
virtual QList<Core::IEditor *> visibleEditors() const = 0;
}; };
} // namespace CppTools } // namespace CppTools

View File

@@ -30,6 +30,8 @@
#include "projectpart.h" #include "projectpart.h"
#include "editordocumenthandle.h" #include "editordocumenthandle.h"
#include <coreplugin/editormanager/editormanager.h>
namespace CppTools { namespace CppTools {
namespace Internal { namespace Internal {
@@ -86,6 +88,11 @@ void CppToolsBridgeQtCreatorImplementation::finishedRefreshingSourceFiles(
CppModelManager::instance()->finishedRefreshingSourceFiles(filePaths); CppModelManager::instance()->finishedRefreshingSourceFiles(filePaths);
} }
QList<Core::IEditor *> CppToolsBridgeQtCreatorImplementation::visibleEditors() const
{
return Core::EditorManager::visibleEditors();
}
} // namespace Internal } // namespace Internal
} // namespace CppTools } // namespace CppTools

View File

@@ -39,6 +39,7 @@ public:
QString projectPartIdForFile(const QString &filePath) const override; QString projectPartIdForFile(const QString &filePath) const override;
BaseEditorDocumentProcessor *baseEditorDocumentProcessor(const QString &filePath) const override; BaseEditorDocumentProcessor *baseEditorDocumentProcessor(const QString &filePath) const override;
void finishedRefreshingSourceFiles(const QSet<QString> &filePaths) const override; void finishedRefreshingSourceFiles(const QSet<QString> &filePaths) const override;
QList<Core::IEditor *> visibleEditors() const override;
}; };
} // namespace Internal } // namespace Internal