Commit 11845cd3 authored by Nikolai Kosjar's avatar Nikolai Kosjar

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: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 9921960a
......@@ -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 {
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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)
......
......@@ -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()
......
......@@ -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();
......
......@@ -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
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment