summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@digia.com>2014-05-19 11:17:39 -0400
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-06-10 15:12:50 +0200
commit11845cd3dca8a0c15a7bc775f511f86c9c1d6860 (patch)
tree30b8de3df347f9c285fb8c477e573e217481f4bf
parent9921960a72d6541d386b2fa7e2a93c32849fa4cd (diff)
downloadqt-creator-11845cd3dca8a0c15a7bc775f511f86c9c1d6860.tar.gz
CppTools: Unexport some internal classes.
Unexports CppModelManager, CppSourceProcessor and CppToolsPlugin. Now only some constructor signatures mention "Internal::" in the exported symbols: % nm --extern-only --demangle ./lib/qtcreator/plugins/libCppTools.so | grep "Internal::" CppTools::CppClassesFilter::CppClassesFilter(CppTools::Internal::CppLocatorData*) CppTools::CppClassesFilter::CppClassesFilter(CppTools::Internal::CppLocatorData*) CppTools::CppEditorSupport::CppEditorSupport(CppTools::Internal::CppModelManager*, TextEditor::BaseTextEditor*) CppTools::CppEditorSupport::CppEditorSupport(CppTools::Internal::CppModelManager*, TextEditor::BaseTextEditor*) Change-Id: I167c21a6dc03cf02230c95fde66cf404e40df36f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
-rw-r--r--src/plugins/cppeditor/cppcodemodelinspectordialog.cpp12
-rw-r--r--src/plugins/cppeditor/fileandtokenactions_test.cpp4
-rw-r--r--src/plugins/cpptools/cppmodelmanager.h4
-rw-r--r--src/plugins/cpptools/cppmodelmanagerinterface.h6
-rw-r--r--src/plugins/cpptools/cppsourceprocessor.h2
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.cpp5
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.h4
-rw-r--r--src/plugins/cpptools/cpptoolsreuse.cpp13
-rw-r--r--src/plugins/cpptools/cpptoolsreuse.h1
9 files changed, 31 insertions, 20 deletions
diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
index 28034343de..311afa5914 100644
--- a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
+++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
@@ -1336,7 +1336,7 @@ void CppCodeModelInspectorDialog::onWorkingCopyDocumentSelected(const QModelInde
void CppCodeModelInspectorDialog::refresh()
{
- CppTools::Internal::CppModelManager *cmm = CppTools::Internal::CppModelManager::instance();
+ CppTools::CppModelManagerInterface *cmmi = CppTools::CppModelManagerInterface::instance();
const int oldSnapshotIndex = m_ui->snapshotSelector->currentIndex();
const bool selectEditorRelevant
@@ -1346,7 +1346,7 @@ void CppCodeModelInspectorDialog::refresh()
m_snapshotInfos->clear();
m_ui->snapshotSelector->clear();
- const CPlusPlus::Snapshot globalSnapshot = cmm->snapshot();
+ const CPlusPlus::Snapshot globalSnapshot = cmmi->snapshot();
CppCodeModelInspector::Dumper dumper(globalSnapshot);
m_snapshotModel->setGlobalSnapshot(globalSnapshot);
@@ -1359,7 +1359,7 @@ void CppCodeModelInspectorDialog::refresh()
TextEditor::BaseTextEditor *editor = currentEditor();
CppEditorSupport *editorSupport = 0;
if (editor) {
- editorSupport = cmm->cppEditorSupport(editor);
+ editorSupport = cmmi->cppEditorSupport(editor);
if (editorSupport) {
const CPlusPlus::Snapshot editorSnapshot = editorSupport->snapshotUpdater()->snapshot();
m_snapshotInfos->append(SnapshotInfo(editorSnapshot, SnapshotInfo::EditorSnapshot));
@@ -1415,7 +1415,7 @@ void CppCodeModelInspectorDialog::refresh()
? editorSupport->snapshotUpdater()->currentProjectPart()
: ProjectPart::Ptr();
- const QList<CppModelManagerInterface::ProjectInfo> projectInfos = cmm->projectInfos();
+ const QList<CppModelManagerInterface::ProjectInfo> projectInfos = cmmi->projectInfos();
dumper.dumpProjectInfos(projectInfos);
m_projectPartsModel->configure(projectInfos, editorsProjectPart);
m_projectPartsView->resizeColumns(ProjectPartsModel::ColumnCount);
@@ -1431,7 +1431,7 @@ void CppCodeModelInspectorDialog::refresh()
}
// Working Copy
- const CppModelManagerInterface::WorkingCopy workingCopy = cmm->workingCopy();
+ const CppModelManagerInterface::WorkingCopy workingCopy = cmmi->workingCopy();
dumper.dumpWorkingCopy(workingCopy);
m_workingCopyModel->configure(workingCopy);
m_workingCopyView->resizeColumns(WorkingCopyModel::ColumnCount);
@@ -1446,7 +1446,7 @@ void CppCodeModelInspectorDialog::refresh()
}
// Merged entities
- dumper.dumpMergedEntities(cmm->includePaths(), cmm->frameworkPaths(), cmm->definedMacros());
+ dumper.dumpMergedEntities(cmmi->includePaths(), cmmi->frameworkPaths(), cmmi->definedMacros());
}
enum DocumentTabs {
diff --git a/src/plugins/cppeditor/fileandtokenactions_test.cpp b/src/plugins/cppeditor/fileandtokenactions_test.cpp
index 95eb390860..9d61ed29f2 100644
--- a/src/plugins/cppeditor/fileandtokenactions_test.cpp
+++ b/src/plugins/cppeditor/fileandtokenactions_test.cpp
@@ -37,7 +37,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <cpptools/cppmodelmanagerinterface.h>
-#include <cpptools/cpptoolsplugin.h>
+#include <cpptools/cpptoolsreuse.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
@@ -502,7 +502,7 @@ void SwitchHeaderSourceFileAction::run(CPPEditorWidget *)
{
// Switch Header/Source
IEditor *editorBefore = EditorManager::currentEditor();
- CppTools::Internal::CppToolsPlugin::instance()->switchHeaderSource();
+ CppTools::switchHeaderSource();
QApplication::processEvents();
// Go back
diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h
index 9187500573..98f72a30c6 100644
--- a/src/plugins/cpptools/cppmodelmanager.h
+++ b/src/plugins/cpptools/cppmodelmanager.h
@@ -30,8 +30,6 @@
#ifndef CPPMODELMANAGER_H
#define CPPMODELMANAGER_H
-#include "cpptools_global.h"
-
#include "cppmodelmanagerinterface.h"
#include <projectexplorer/project.h>
@@ -52,7 +50,7 @@ namespace Internal {
class CppFindReferences;
-class CPPTOOLS_EXPORT CppModelManager : public CppTools::CppModelManagerInterface
+class CppModelManager : public CppTools::CppModelManagerInterface
{
Q_OBJECT
diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h
index 5bd7be3cc2..2e04a333ce 100644
--- a/src/plugins/cpptools/cppmodelmanagerinterface.h
+++ b/src/plugins/cpptools/cppmodelmanagerinterface.h
@@ -239,8 +239,6 @@ public:
virtual QList<ProjectPart::Ptr> projectPartFromDependencies(const QString &fileName) const = 0;
virtual ProjectPart::Ptr fallbackProjectPart() const = 0;
- virtual QStringList includePaths() = 0;
-
virtual void addExtraEditorSupport(CppTools::AbstractEditorSupport *editorSupport) = 0;
virtual void removeExtraEditorSupport(CppTools::AbstractEditorSupport *editorSupport) = 0;
virtual CppEditorSupport *cppEditorSupport(TextEditor::BaseTextEditor *textEditor) = 0;
@@ -270,6 +268,10 @@ public:
virtual void setIncludePaths(const QStringList &includePaths) = 0;
virtual void enableGarbageCollector(bool enable) = 0;
+ virtual QStringList includePaths() = 0;
+ virtual QStringList frameworkPaths() = 0;
+ virtual QByteArray definedMacros() = 0;
+
signals:
/// Project data might be locked while this is emitted.
void aboutToRemoveFiles(const QStringList &files);
diff --git a/src/plugins/cpptools/cppsourceprocessor.h b/src/plugins/cpptools/cppsourceprocessor.h
index f734ad3eab..cd386fb0a0 100644
--- a/src/plugins/cpptools/cppsourceprocessor.h
+++ b/src/plugins/cpptools/cppsourceprocessor.h
@@ -22,7 +22,7 @@ namespace Internal {
class CppModelManager;
// Documentation inside.
-class CPPTOOLS_EXPORT CppSourceProcessor: public CPlusPlus::Client
+class CppSourceProcessor: public CPlusPlus::Client
{
Q_DISABLE_COPY(CppSourceProcessor)
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp
index d9fee99923..7e9f1d061d 100644
--- a/src/plugins/cpptools/cpptoolsplugin.cpp
+++ b/src/plugins/cpptools/cpptoolsplugin.cpp
@@ -197,10 +197,7 @@ StringTable &CppToolsPlugin::stringTable()
void CppToolsPlugin::switchHeaderSource()
{
- QString otherFile = correspondingHeaderOrSource(
- EditorManager::currentDocument()->filePath());
- if (!otherFile.isEmpty())
- EditorManager::openEditor(otherFile);
+ CppTools::switchHeaderSource();
}
void CppToolsPlugin::switchHeaderSourceInNextSplit()
diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h
index 95bb05d779..a3e137c640 100644
--- a/src/plugins/cpptools/cpptoolsplugin.h
+++ b/src/plugins/cpptools/cpptoolsplugin.h
@@ -52,7 +52,7 @@ class CppModelManager;
struct CppFileSettings;
class CppCodeModelSettings;
-class CPPTOOLS_EXPORT CppToolsPlugin : public ExtensionSystem::IPlugin
+class CppToolsPlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CppTools.json")
@@ -80,8 +80,8 @@ public slots:
void switchHeaderSource();
void switchHeaderSourceInNextSplit();
-private slots:
#ifdef WITH_TESTS
+private slots:
// Init/Cleanup methods implemented in cppheadersource_test.cpp
void initTestCase();
void cleanupTestCase();
diff --git a/src/plugins/cpptools/cpptoolsreuse.cpp b/src/plugins/cpptools/cpptoolsreuse.cpp
index b71ceeecac..bb2d52c401 100644
--- a/src/plugins/cpptools/cpptoolsreuse.cpp
+++ b/src/plugins/cpptools/cpptoolsreuse.cpp
@@ -29,14 +29,18 @@
#include "cpptoolsreuse.h"
+#include <coreplugin/editormanager/editormanager.h>
+
#include <cplusplus/Overview.h>
#include <cplusplus/LookupContext.h>
+#include <utils/qtcassert.h>
#include <QSet>
#include <QTextDocument>
#include <QTextCursor>
#include <QStringRef>
+
using namespace CPlusPlus;
namespace CppTools {
@@ -187,4 +191,13 @@ bool isQtKeyword(const QStringRef &text)
return false;
}
+void switchHeaderSource()
+{
+ const Core::IDocument *currentDocument = Core::EditorManager::currentDocument();
+ QTC_ASSERT(currentDocument, return);
+ const QString otherFile = correspondingHeaderOrSource(currentDocument->filePath());
+ if (!otherFile.isEmpty())
+ Core::EditorManager::openEditor(otherFile);
+}
+
} // CppTools
diff --git a/src/plugins/cpptools/cpptoolsreuse.h b/src/plugins/cpptools/cpptoolsreuse.h
index 87b1e5eb3e..53faf9ef89 100644
--- a/src/plugins/cpptools/cpptoolsreuse.h
+++ b/src/plugins/cpptools/cpptoolsreuse.h
@@ -57,6 +57,7 @@ bool CPPTOOLS_EXPORT isValidIdentifier(const QString &s);
bool CPPTOOLS_EXPORT isQtKeyword(const QStringRef &text);
QString CPPTOOLS_EXPORT correspondingHeaderOrSource(const QString &fileName, bool *wasHeader = 0);
+void CPPTOOLS_EXPORT switchHeaderSource();
} // CppTools