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>
This commit is contained in:
Nikolai Kosjar
2014-05-19 11:17:39 -04:00
parent 9921960a72
commit 11845cd3dc
9 changed files with 31 additions and 20 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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)

View File

@@ -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()

View File

@@ -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();

View File

@@ -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

View File

@@ -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