forked from qt-creator/qt-creator
CorePlugin: Use static VariableManager functions where appropriate
Change-Id: Ie3d34a829522e15b2a56c0fcc696e60163a9be32 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -2520,7 +2520,7 @@ QString EditorManager::windowTitleVcsTopic()
|
||||
|
||||
void EditorManager::updateVariable(const QByteArray &variable)
|
||||
{
|
||||
if (VariableManager::instance()->isFileVariable(variable, kCurrentDocumentPrefix)) {
|
||||
if (VariableManager::isFileVariable(variable, kCurrentDocumentPrefix)) {
|
||||
QString value;
|
||||
IDocument *document = currentDocument();
|
||||
if (document) {
|
||||
|
||||
@@ -276,7 +276,7 @@ Utils::AbstractMacroExpander *VariableManager::macroExpander()
|
||||
* 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.
|
||||
*/
|
||||
VariableManager *VariableManager::instance()
|
||||
QObject *VariableManager::instance()
|
||||
{
|
||||
return variableManagerInstance;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class CORE_EXPORT VariableManager : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static VariableManager *instance();
|
||||
static QObject *instance();
|
||||
|
||||
static void insert(const QByteArray &variable, const QString &value);
|
||||
static bool remove(const QByteArray &variable);
|
||||
|
||||
@@ -117,18 +117,18 @@ void QtSupportPlugin::updateVariable(const QByteArray &variable)
|
||||
|
||||
ProjectExplorer::Project *project = ProjectExplorer::ProjectExplorerPlugin::currentProject();
|
||||
if (!project || !project->activeTarget()) {
|
||||
Core::VariableManager::instance()->remove(variable);
|
||||
Core::VariableManager::remove(variable);
|
||||
return;
|
||||
}
|
||||
|
||||
const BaseQtVersion *qtVersion = QtKitInformation::qtVersion(project->activeTarget()->kit());
|
||||
if (!qtVersion) {
|
||||
Core::VariableManager::instance()->remove(variable);
|
||||
Core::VariableManager::remove(variable);
|
||||
return;
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user