CorePlugin: Use static VariableManager functions where appropriate

Change-Id: Ie3d34a829522e15b2a56c0fcc696e60163a9be32
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
hjk
2013-08-29 15:08:04 +02:00
parent 24ccd50015
commit e1823072a1
4 changed files with 6 additions and 6 deletions

View File

@@ -2520,7 +2520,7 @@ QString EditorManager::windowTitleVcsTopic()
void EditorManager::updateVariable(const QByteArray &variable) void EditorManager::updateVariable(const QByteArray &variable)
{ {
if (VariableManager::instance()->isFileVariable(variable, kCurrentDocumentPrefix)) { if (VariableManager::isFileVariable(variable, kCurrentDocumentPrefix)) {
QString value; QString value;
IDocument *document = currentDocument(); IDocument *document = currentDocument();
if (document) { if (document) {

View File

@@ -276,7 +276,7 @@ Utils::AbstractMacroExpander *VariableManager::macroExpander()
* Returns the variable manager instance, for connecting to signals. All other methods are static * Returns the variable manager instance, for connecting to signals. All other methods are static
* and should be called as class methods, not through the instance. * and should be called as class methods, not through the instance.
*/ */
VariableManager *VariableManager::instance() QObject *VariableManager::instance()
{ {
return variableManagerInstance; return variableManagerInstance;
} }

View File

@@ -50,7 +50,7 @@ class CORE_EXPORT VariableManager : public QObject
Q_OBJECT Q_OBJECT
public: public:
static VariableManager *instance(); static QObject *instance();
static void insert(const QByteArray &variable, const QString &value); static void insert(const QByteArray &variable, const QString &value);
static bool remove(const QByteArray &variable); static bool remove(const QByteArray &variable);

View File

@@ -117,18 +117,18 @@ void QtSupportPlugin::updateVariable(const QByteArray &variable)
ProjectExplorer::Project *project = ProjectExplorer::ProjectExplorerPlugin::currentProject(); ProjectExplorer::Project *project = ProjectExplorer::ProjectExplorerPlugin::currentProject();
if (!project || !project->activeTarget()) { if (!project || !project->activeTarget()) {
Core::VariableManager::instance()->remove(variable); Core::VariableManager::remove(variable);
return; return;
} }
const BaseQtVersion *qtVersion = QtKitInformation::qtVersion(project->activeTarget()->kit()); const BaseQtVersion *qtVersion = QtKitInformation::qtVersion(project->activeTarget()->kit());
if (!qtVersion) { if (!qtVersion) {
Core::VariableManager::instance()->remove(variable); Core::VariableManager::remove(variable);
return; return;
} }
QString value = qtVersion->qmakeProperty(variable == kHostBins ? "QT_HOST_BINS" : "QT_INSTALL_BINS"); QString value = qtVersion->qmakeProperty(variable == kHostBins ? "QT_HOST_BINS" : "QT_INSTALL_BINS");
Core::VariableManager::instance()->insert(variable, value); Core::VariableManager::insert(variable, value);
} }
Q_EXPORT_PLUGIN(QtSupportPlugin) Q_EXPORT_PLUGIN(QtSupportPlugin)