Commit b4b9ba7e authored by hjk's avatar hjk Committed by hjk

cpptools: use static CppToolsPlugin functions instead of indirect access

Saves a symbol.

Change-Id: Id949799852560a3e22da9c0a858b399c6ab3d6e1
Reviewed-on: http://codereview.qt.nokia.com/1295Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent de789e35
......@@ -87,7 +87,7 @@ using namespace CPlusPlus;
enum { debug = 0 };
CppToolsPlugin *CppToolsPlugin::m_instance = 0;
static CppToolsPlugin *m_instance = 0;
CppToolsPlugin::CppToolsPlugin() :
m_modelManager(0),
......@@ -310,9 +310,9 @@ QString CppToolsPlugin::correspondingHeaderOrSourceI(const QString &fileName) co
return QString();
}
QString CppToolsPlugin::correspondingHeaderOrSource(const QString &fileName) const
QString CppToolsPlugin::correspondingHeaderOrSource(const QString &fileName)
{
const QString rc = correspondingHeaderOrSourceI(fileName);
const QString rc = m_instance->correspondingHeaderOrSourceI(fileName);
if (debug)
qDebug() << Q_FUNC_INFO << fileName << rc;
return rc;
......
......@@ -64,8 +64,6 @@ class CppToolsPlugin : public ExtensionSystem::IPlugin
Q_DISABLE_COPY(CppToolsPlugin)
Q_OBJECT
public:
static CppToolsPlugin *instance() { return m_instance; }
CppToolsPlugin();
~CppToolsPlugin();
......@@ -73,7 +71,7 @@ public:
void extensionsInitialized();
ShutdownFlag aboutToShutdown();
CppModelManager *cppModelManager() { return m_modelManager; }
QString correspondingHeaderOrSource(const QString &fileName) const;
static QString correspondingHeaderOrSource(const QString &fileName);
private slots:
void switchHeaderSource();
......@@ -85,8 +83,6 @@ private:
CppModelManager *m_modelManager;
QSharedPointer<CppFileSettings> m_fileSettings;
CppToolsSettings *m_settings;
static CppToolsPlugin *m_instance;
};
} // namespace Internal
......
......@@ -330,8 +330,7 @@ QList<InsertionLocation> InsertionPointLocator::methodDefinition(
declaration->fileNameLength());
QString target = declFileName;
if (!isSourceFile(declFileName)) {
Internal::CppToolsPlugin *cpptools = Internal::CppToolsPlugin::instance();
QString candidate = cpptools->correspondingHeaderOrSource(declFileName);
QString candidate = Internal::CppToolsPlugin::correspondingHeaderOrSource(declFileName);
if (!candidate.isEmpty())
target = candidate;
}
......
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