Commit 0ed9b97a authored by hjk's avatar hjk

QtVersionManager et al: Code cosmetics

Apply static 'pattern' for QtVersionManager, de-noise using code.

Change-Id: Id66ac90094cd7312d1e72abbdbce4c02b078456e
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 32d98862
......@@ -762,7 +762,7 @@ void AndroidConfigurations::updateAutomaticKitList()
}
QMap<Abi::Architecture, QList<QtSupport::BaseQtVersion *> > qtVersionsForArch;
foreach (QtSupport::BaseQtVersion *qtVersion, QtSupport::QtVersionManager::instance()->versions()) {
foreach (QtSupport::BaseQtVersion *qtVersion, QtSupport::QtVersionManager::versions()) {
if (qtVersion->type() != QLatin1String(Constants::ANDROIDQT))
continue;
QList<Abi> qtAbis = qtVersion->qtAbis();
......
......@@ -248,7 +248,7 @@ bool AndroidSettingsWidget::checkNDK(const Utils::FileName &location)
toolchainsForArch.insert(ati.architecture);
QSet<ProjectExplorer::Abi::Architecture> qtVersionsForArch;
foreach (QtSupport::BaseQtVersion *qtVersion, QtSupport::QtVersionManager::instance()->versions()) {
foreach (QtSupport::BaseQtVersion *qtVersion, QtSupport::QtVersionManager::versions()) {
if (qtVersion->type() != QLatin1String(Constants::ANDROIDQT) || qtVersion->qtAbis().isEmpty())
continue;
qtVersionsForArch.insert(qtVersion->qtAbis().first().architecture());
......
......@@ -65,6 +65,7 @@
#include <limits.h>
using namespace ProjectExplorer;
using namespace QtSupport;
using namespace RemoteLinux;
namespace Madde {
......@@ -102,7 +103,7 @@ MaemoQemuManager::MaemoQemuManager(QObject *parent)
m_qemuAction->setVisible(false);
// listen to Qt version changes to update the start button
connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>)));
// listen to project add, remove and startup changes to udate start button
......@@ -176,10 +177,9 @@ void MaemoQemuManager::qtVersionsChanged(const QList<int> &added, const QList<in
{
QList<int> uniqueIds;
uniqueIds << added << removed << changed;
QtSupport::QtVersionManager *manager = QtSupport::QtVersionManager::instance();
foreach (int uniqueId, uniqueIds) {
if (manager->isValidId(uniqueId)) {
MaemoQtVersion *version = dynamic_cast<MaemoQtVersion *>(manager->version(uniqueId));
if (QtVersionManager::isValidId(uniqueId)) {
MaemoQtVersion *version = dynamic_cast<MaemoQtVersion *>(QtVersionManager::version(uniqueId));
if (version) {
MaemoQemuRuntime runtime
......@@ -300,7 +300,7 @@ void MaemoQemuManager::startRuntime()
Project *p = ProjectExplorerPlugin::instance()->session()->startupProject();
if (!p)
return;
QtSupport::BaseQtVersion *version;
BaseQtVersion *version;
if (!targetUsesMatchingRuntimeConfig(p->activeTarget(), &version)) {
qWarning("Strange: Qemu button was enabled, but target does not match.");
return;
......@@ -458,7 +458,7 @@ void MaemoQemuManager::toggleStarterButton(Target *target)
{
int uniqueId = -1;
if (target) {
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
BaseQtVersion *version = QtKitInformation::qtVersion(target->kit());
if (version)
uniqueId = version->uniqueId();
}
......@@ -494,7 +494,7 @@ bool MaemoQemuManager::sessionHasMaemoTarget() const
}
bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
QtSupport::BaseQtVersion **qtVersion)
BaseQtVersion **qtVersion)
{
if (!target)
return false;
......@@ -506,7 +506,7 @@ bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
if (!mrc)
return false;
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
BaseQtVersion *version = QtKitInformation::qtVersion(target->kit());
if (!version || !m_runtimes.value(version->uniqueId(), MaemoQemuRuntime()).isValid())
return false;
......
......@@ -101,7 +101,7 @@ QWidget *DesignDocument::centralWidget() const
QString DesignDocument::pathToQt() const
{
QtSupport::BaseQtVersion *activeQtVersion = QtSupport::QtVersionManager::instance()->version(m_qtVersionId);
QtSupport::BaseQtVersion *activeQtVersion = QtSupport::QtVersionManager::version(m_qtVersionId);
if (activeQtVersion && (activeQtVersion->qtVersion() >= QtSupport::QtVersionNumber(4, 7, 1))
&& (activeQtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
|| activeQtVersion->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)))
......
......@@ -34,7 +34,7 @@ DesignDocument *ViewManager::currentDesignDocument() const
QString ViewManager::pathToQt() const
{
QtSupport::BaseQtVersion *activeQtVersion = QtSupport::QtVersionManager::instance()->version(currentDesignDocument()->qtVersionId());
QtSupport::BaseQtVersion *activeQtVersion = QtSupport::QtVersionManager::version(currentDesignDocument()->qtVersionId());
if (activeQtVersion && (activeQtVersion->qtVersion() >= QtSupport::QtVersionNumber(4, 7, 1))
&& (activeQtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
|| activeQtVersion->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)))
......
......@@ -121,8 +121,8 @@ bool BlackBerryConfiguration::isAutoDetected() const
bool BlackBerryConfiguration::isActive() const
{
BaseQtVersion *qt4Version = QtVersionManager::instance()->qtVersionForQMakeBinary(m_qmake4BinaryFile);
BaseQtVersion *qt5Version = QtVersionManager::instance()->qtVersionForQMakeBinary(m_qmake5BinaryFile);
BaseQtVersion *qt4Version = QtVersionManager::qtVersionForQMakeBinary(m_qmake4BinaryFile);
BaseQtVersion *qt5Version = QtVersionManager::qtVersionForQMakeBinary(m_qmake5BinaryFile);
return (qt4Version || qt5Version);
}
......@@ -184,7 +184,7 @@ void BlackBerryConfiguration::setupConfigurationPerQtVersion(const FileName &qma
if (!qtVersion->qtAbis().isEmpty())
tc->setTargetAbi(qtVersion->qtAbis().first());
// register
QtVersionManager::instance()->addVersion(qtVersion);
QtVersionManager::addVersion(qtVersion);
ToolChainManager::registerToolChain(tc);
KitManager::registerKit(deviceKit);
KitManager::registerKit(simulatorKit);
......@@ -197,7 +197,7 @@ BaseQtVersion *BlackBerryConfiguration::createQtVersion(const FileName &qmakePat
return 0;
QString cpuDir = m_qnxEnv.value(QLatin1String("CPUVARDIR"));
BaseQtVersion *version = QtVersionManager::instance()->qtVersionForQMakeBinary(qmakePath);
BaseQtVersion *version = QtVersionManager::qtVersionForQMakeBinary(qmakePath);
if (version) {
if (!m_isAutoDetected)
QMessageBox::warning(0, QObject::tr("Qt Version Already Known"),
......@@ -332,8 +332,8 @@ bool BlackBerryConfiguration::activate()
void BlackBerryConfiguration::deactivate()
{
BaseQtVersion *qt4Version = QtVersionManager::instance()->qtVersionForQMakeBinary(m_qmake4BinaryFile);
BaseQtVersion *qt5Version = QtVersionManager::instance()->qtVersionForQMakeBinary(m_qmake5BinaryFile);
BaseQtVersion *qt4Version = QtVersionManager::qtVersionForQMakeBinary(m_qmake4BinaryFile);
BaseQtVersion *qt5Version = QtVersionManager::qtVersionForQMakeBinary(m_qmake5BinaryFile);
if (qt4Version || qt5Version) {
foreach (Kit *kit, KitManager::kits()) {
if (qt4Version && qt4Version == QtKitInformation::qtVersion(kit))
......@@ -344,10 +344,10 @@ void BlackBerryConfiguration::deactivate()
}
if (qt4Version)
QtVersionManager::instance()->removeVersion(qt4Version);
QtVersionManager::removeVersion(qt4Version);
if (qt5Version)
QtVersionManager::instance()->removeVersion(qt5Version);
QtVersionManager::removeVersion(qt5Version);
}
......
......@@ -199,7 +199,7 @@ void BlackBerryConfigurationManager::clearInvalidConfigurations()
}
if (!isValid) {
QtSupport::QtVersionManager::instance()->removeVersion(QtSupport::QtKitInformation::qtVersion(kit));
QtSupport::QtVersionManager::removeVersion(QtSupport::QtKitInformation::qtVersion(kit));
ToolChainManager::deregisterToolChain(ToolChainKitInformation::toolChain(kit));
KitManager::deregisterKit(kit);
}
......
......@@ -509,8 +509,8 @@ Qt4BuildConfigurationFactory::Qt4BuildConfigurationFactory(QObject *parent) :
{
update();
QtVersionManager *vm = QtVersionManager::instance();
connect(vm, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
connect(QtVersionManager::instance(),
SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(update()));
}
......
......@@ -50,6 +50,8 @@
#include <QScrollArea>
#include <QVBoxLayout>
using namespace QtSupport;
namespace Qt4ProjectManager {
namespace Internal {
......@@ -279,12 +281,12 @@ void TargetSetupPage::reset()
m_firstWidget = 0;
}
ProjectExplorer::Kit *TargetSetupPage::createTemporaryKit(QtSupport::BaseQtVersion *version,
ProjectExplorer::Kit *TargetSetupPage::createTemporaryKit(BaseQtVersion *version,
bool temporaryVersion,
const Utils::FileName &parsedSpec)
{
ProjectExplorer::Kit *k = new ProjectExplorer::Kit;
QtSupport::QtKitInformation::setQtVersion(k, version);
QtKitInformation::setQtVersion(k, version);
ProjectExplorer::ToolChainKitInformation::setToolChain(k, version->preferredToolChain(parsedSpec));
QmakeKitInformation::setMkspec(k, parsedSpec);
......@@ -394,25 +396,23 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
QStringList makefiles = QDir(path.toString()).entryList(QStringList(QLatin1String("Makefile*")));
QtSupport::BaseQtVersion *version = 0;
BaseQtVersion *version = 0;
bool temporaryVersion = false;
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
bool found = false;
foreach (const QString &file, makefiles) {
// find interesting makefiles
QString makefile = path.toString() + QLatin1Char('/') + file;
Utils::FileName qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
Utils::FileName qmakeBinary = QtVersionManager::findQMakeBinaryFromMakefile(makefile);
QFileInfo fi = qmakeBinary.toFileInfo();
Utils::FileName canonicalQmakeBinary = Utils::FileName::fromString(fi.canonicalFilePath());
if (canonicalQmakeBinary.isEmpty())
continue;
if (QtSupport::QtVersionManager::makefileIsFor(makefile, m_proFilePath) != QtSupport::QtVersionManager::SameProject)
if (QtVersionManager::makefileIsFor(makefile, m_proFilePath) != QtVersionManager::SameProject)
continue;
// Find version:
foreach (QtSupport::BaseQtVersion *v, vm->versions()) {
foreach (BaseQtVersion *v, QtVersionManager::versions()) {
QFileInfo vfi = v->qmakeCommand().toFileInfo();
Utils::FileName current = Utils::FileName::fromString(vfi.canonicalFilePath());
if (current == canonicalQmakeBinary) {
......@@ -424,17 +424,17 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
// Create a new version if not found:
if (!version) {
// Do not use the canonical path here...
version = QtSupport::QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary);
version = QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary);
if (!version)
continue;
vm->addVersion(version);
QtVersionManager::addVersion(version);
temporaryVersion = true;
}
// find qmake arguments and mkspec
QPair<QtSupport::BaseQtVersion::QmakeBuildConfigs, QString> makefileBuildConfig =
QtSupport::QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
QPair<BaseQtVersion::QmakeBuildConfigs, QString> makefileBuildConfig =
QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig());
QString additionalArguments = makefileBuildConfig.second;
Utils::FileName parsedSpec =
......@@ -452,7 +452,7 @@ void TargetSetupPage::import(const Utils::FileName &path, const bool silent)
// Find profiles (can be more than one, e.g. (Linux-)Desktop and embedded linux):
QList<ProjectExplorer::Kit *> kitList;
foreach (ProjectExplorer::Kit *k, ProjectExplorer::KitManager::kits()) {
QtSupport::BaseQtVersion *profileVersion = QtSupport::QtKitInformation::qtVersion(k);
BaseQtVersion *profileVersion = QtKitInformation::qtVersion(k);
Utils::FileName profileSpec = QmakeKitInformation::mkspec(k);
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
if (profileSpec.isEmpty() && profileVersion)
......@@ -548,10 +548,9 @@ void TargetSetupPage::handleKitAddition(ProjectExplorer::Kit *k)
void TargetSetupPage::handleKitRemoval(ProjectExplorer::Kit *k)
{
QtSupport::QtVersionManager *vm = QtSupport::QtVersionManager::instance();
QtSupport::BaseQtVersion *version = vm->version(k->value(QT_IS_TEMPORARY, -1).toInt());
BaseQtVersion *version = QtVersionManager::version(k->value(QT_IS_TEMPORARY, -1).toInt());
if (version)
vm->removeVersion(version);
QtVersionManager::removeVersion(version);
if (m_ignoreUpdates)
return;
......@@ -699,7 +698,7 @@ bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project)
QList<ProjectExplorer::Target *> targets = project->targets();
int activeTargetPriority = 0;
foreach (ProjectExplorer::Target *t, targets) {
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(t->kit());
BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(t->kit());
if (t->kit() == ProjectExplorer::KitManager::defaultKit()) {
activeTarget = t;
activeTargetPriority = 3;
......
......@@ -132,7 +132,7 @@ bool QtVersionNumber::operator >=(const QtVersionNumber &b) const
///////////////
int BaseQtVersion::getUniqueId()
{
return QtVersionManager::instance()->getUniqueId();
return QtVersionManager::getUniqueId();
}
BaseQtVersion::BaseQtVersion(const FileName &qmakeCommand, bool isAutodetected, const QString &autodetectionSource)
......@@ -385,7 +385,7 @@ void BaseQtVersion::fromMap(const QVariantMap &map)
{
m_id = map.value(QLatin1String(Constants::QTVERSIONID)).toInt();
if (m_id == -1) // this happens on adding from installer, see updateFromInstaller => get a new unique id
m_id = QtVersionManager::instance()->getUniqueId();
m_id = QtVersionManager::getUniqueId();
m_displayName = map.value(QLatin1String(Constants::QTVERSIONNAME)).toString();
m_isAutodetected = map.value(QLatin1String(QTVERSIONAUTODETECTED)).toBool();
if (m_isAutodetected)
......
......@@ -79,8 +79,7 @@ public:
int findHighestQtVersion()
{
QtVersionManager *versionManager = QtVersionManager::instance();
QList <BaseQtVersion *> qtVersions = versionManager->validVersions();
QList<BaseQtVersion *> qtVersions = QtVersionManager::validVersions();
BaseQtVersion *newVersion = 0;
......@@ -115,8 +114,7 @@ public:
clear();
// prioritize default qt version
QtVersionManager *versionManager = QtVersionManager::instance();
QList <BaseQtVersion *> qtVersions = versionManager->validVersions();
QList<BaseQtVersion *> qtVersions = QtVersionManager::validVersions();
ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit();
BaseQtVersion *defaultVersion = QtKitInformation::qtVersion(defaultKit);
if (defaultVersion && qtVersions.contains(defaultVersion))
......@@ -542,8 +540,7 @@ QStringList ExamplesListModel::exampleSources(QString *examplesInstallPath, QStr
const QStringList pattern(QLatin1String("*.xml"));
// prioritize default qt version
QtVersionManager *versionManager = QtVersionManager::instance();
QList <BaseQtVersion *> qtVersions = versionManager->validVersions();
QList<BaseQtVersion *> qtVersions = QtVersionManager::validVersions();
ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit();
BaseQtVersion *defaultVersion = QtKitInformation::qtVersion(defaultKit);
if (defaultVersion && qtVersions.contains(defaultVersion))
......
......@@ -102,7 +102,7 @@ public:
private slots:
void finish(int qtId, const QString &output, DebuggingHelperBuildTask::Tools tools)
{
BaseQtVersion *version = QtVersionManager::instance()->version(qtId);
BaseQtVersion *version = QtVersionManager::version(qtId);
QTC_ASSERT(tools == DebuggingHelperBuildTask::QmlDump, return);
QString errorMessage;
......
......@@ -50,10 +50,8 @@ QtKitConfigWidget::QtKitConfigWidget(ProjectExplorer::Kit *k, bool sticky) :
m_combo = new QComboBox;
m_combo->addItem(tr("None"), -1);
QtVersionManager *mgr = QtVersionManager::instance();
QList<BaseQtVersion *> versions = mgr->versions();
QList<int> versionIds;
foreach (BaseQtVersion *v, versions)
foreach (BaseQtVersion *v, QtVersionManager::versions())
versionIds.append(v->uniqueId());
versionsChanged(versionIds, QList<int>(), QList<int>());
......@@ -64,7 +62,7 @@ QtKitConfigWidget::QtKitConfigWidget(ProjectExplorer::Kit *k, bool sticky) :
connect(m_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(currentWasChanged(int)));
connect(mgr, SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(versionsChanged(QList<int>,QList<int>,QList<int>)));
connect(m_manageButton, SIGNAL(clicked()), this, SLOT(manageQtVersions()));
......@@ -105,10 +103,8 @@ QWidget *QtKitConfigWidget::buttonWidget() const
void QtKitConfigWidget::versionsChanged(const QList<int> &added, const QList<int> &removed,
const QList<int> &changed)
{
QtVersionManager *mgr = QtVersionManager::instance();
foreach (const int id, added) {
BaseQtVersion *v = mgr->version(id);
BaseQtVersion *v = QtVersionManager::version(id);
QTC_CHECK(v);
if (!v->isValid())
continue;
......@@ -122,7 +118,7 @@ void QtKitConfigWidget::versionsChanged(const QList<int> &added, const QList<int
}
foreach (const int id, changed) {
BaseQtVersion *v = mgr->version(id);
BaseQtVersion *v = QtVersionManager::version(id);
int pos = findQtVersion(id);
if (pos >= 0) // We do not include invalid Qt versions, so do not try to remove those.
m_combo->setItemText(pos, v->displayName());
......
......@@ -55,7 +55,6 @@ QtKitInformation::QtKitInformation()
QVariant QtKitInformation::defaultValue(ProjectExplorer::Kit *k) const
{
Q_UNUSED(k);
QtVersionManager *mgr = QtVersionManager::instance();
// find "Qt in PATH":
Utils::FileName qmake = Utils::BuildableHelperLibrary::findSystemQt(Utils::Environment::systemEnvironment());
......@@ -63,7 +62,7 @@ QVariant QtKitInformation::defaultValue(ProjectExplorer::Kit *k) const
if (qmake.isEmpty())
return -1;
QList<BaseQtVersion *> versionList = mgr->versions();
QList<BaseQtVersion *> versionList = QtVersionManager::versions();
BaseQtVersion *fallBack = 0;
foreach (BaseQtVersion *v, versionList) {
if (qmake == v->qmakeCommand())
......@@ -80,7 +79,7 @@ QVariant QtKitInformation::defaultValue(ProjectExplorer::Kit *k) const
QList<ProjectExplorer::Task> QtKitInformation::validate(const ProjectExplorer::Kit *k) const
{
QList<ProjectExplorer::Task> result;
QTC_ASSERT(QtVersionManager::instance()->isLoaded(), return result);
QTC_ASSERT(QtVersionManager::isLoaded(), return result);
BaseQtVersion *version = qtVersion(k);
if (!version)
return result;
......@@ -89,7 +88,7 @@ QList<ProjectExplorer::Task> QtKitInformation::validate(const ProjectExplorer::K
void QtKitInformation::fix(ProjectExplorer::Kit *k)
{
QTC_ASSERT(QtVersionManager::instance()->isLoaded(), return);
QTC_ASSERT(QtVersionManager::isLoaded(), return);
BaseQtVersion *version = qtVersion(k);
if (!version && qtVersionId(k) >= 0) {
qWarning("Qt version is no longer known, removing from kit \"%s\".", qPrintable(k->displayName()));
......@@ -143,7 +142,7 @@ int QtKitInformation::qtVersionId(const ProjectExplorer::Kit *k)
id = -1;
} else {
QString source = data.toString();
foreach (BaseQtVersion *v, QtVersionManager::instance()->versions()) {
foreach (BaseQtVersion *v, QtVersionManager::versions()) {
if (v->autodetectionSource() != source)
continue;
id = v->uniqueId();
......@@ -160,7 +159,7 @@ void QtKitInformation::setQtVersionId(ProjectExplorer::Kit *k, const int id)
BaseQtVersion *QtKitInformation::qtVersion(const ProjectExplorer::Kit *k)
{
return QtVersionManager::instance()->version(qtVersionId(k));
return QtVersionManager::version(qtVersionId(k));
}
void QtKitInformation::setQtVersion(ProjectExplorer::Kit *k, const BaseQtVersion *v)
......
......@@ -153,8 +153,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent)
m_manualItem->setFlags(Qt::ItemIsEnabled);
QList<int> additions;
QList<BaseQtVersion *> versions = QtVersionManager::instance()->versions();
foreach (BaseQtVersion *v, versions)
foreach (BaseQtVersion *v, QtVersionManager::versions())
additions.append(v->uniqueId());
updateQtVersions(additions, QList<int>(), QList<int>());
......@@ -529,8 +528,6 @@ void QtOptionsPageWidget::showDebuggingBuildLog(const QTreeWidgetItem *currentIt
void QtOptionsPageWidget::updateQtVersions(const QList<int> &additions, const QList<int> &removals,
const QList<int> &changes)
{
QtVersionManager *vm = QtVersionManager::instance();
QList<QTreeWidgetItem *> toRemove;
QList<int> toAdd = additions;
......@@ -566,7 +563,7 @@ void QtOptionsPageWidget::updateQtVersions(const QList<int> &additions, const QL
// Add changed/added items:
foreach (int a, toAdd) {
BaseQtVersion *version = vm->version(a)->clone();
BaseQtVersion *version = QtVersionManager::version(a)->clone();
m_versions.append(version);
QTreeWidgetItem *item = new QTreeWidgetItem;
......@@ -1058,8 +1055,7 @@ void QtOptionsPageWidget::apply()
disconnect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(updateQtVersions(QList<int>,QList<int>,QList<int>)));
QtVersionManager *vm = QtVersionManager::instance();
vm->setNewQtVersions(versions());
QtVersionManager::setNewQtVersions(versions());
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(updateQtVersions(QList<int>,QList<int>,QList<int>)));
......
......@@ -102,12 +102,12 @@ void QtSupportPlugin::extensionsInitialized()
connect(Core::VariableManager::instance(), SIGNAL(variableUpdateRequested(QByteArray)),
this, SLOT(updateVariable(QByteArray)));
QtVersionManager::instance()->extensionsInitialized();
QtVersionManager::extensionsInitialized();
}
bool QtSupportPlugin::delayedInitialize()
{
return QtVersionManager::instance()->delayedInitialize();
return QtVersionManager::delayedInitialize();
}
void QtSupportPlugin::updateVariable(const QByteArray &variable)
......
This diff is collapsed.
......@@ -62,40 +62,39 @@ class QTSUPPORT_EXPORT QtVersionManager : public QObject
friend class BaseQtVersion;
friend class Internal::QtOptionsPageWidget;
public:
static QtVersionManager *instance();
static QObject *instance();
QtVersionManager();
~QtVersionManager();
void extensionsInitialized();
bool delayedInitialize();
static void extensionsInitialized();
static bool delayedInitialize();
bool isLoaded() const;
static bool isLoaded();
// This will *always* return at least one (Qt in Path), even if that is
// unconfigured.
QList<BaseQtVersion *> versions() const;
QList<BaseQtVersion *> validVersions() const;
static QList<BaseQtVersion *> versions();
static QList<BaseQtVersion *> validVersions();
// Note: DO NOT STORE THIS POINTER!
// The QtVersionManager will delete it at random times and you will
// need to get a new pointer by calling this method again!
BaseQtVersion *version(int id) const;
static BaseQtVersion *version(int id);
BaseQtVersion *qtVersionForQMakeBinary(const Utils::FileName &qmakePath);
static BaseQtVersion *qtVersionForQMakeBinary(const Utils::FileName &qmakePath);
void addVersion(BaseQtVersion *version);
void removeVersion(BaseQtVersion *version);
static void addVersion(BaseQtVersion *version);
static void removeVersion(BaseQtVersion *version);
// Static Methods
enum MakefileCompatible { CouldNotParse, DifferentProject, SameProject };
static MakefileCompatible makefileIsFor(const QString &makefile, const QString &proFile);
static QPair<BaseQtVersion::QmakeBuildConfigs, QString> scanMakeFile(const QString &makefile,
BaseQtVersion::QmakeBuildConfigs defaultBuildConfig);
static Utils::FileName findQMakeBinaryFromMakefile(const QString &directory);
bool isValidId(int id) const;
static bool isValidId(int id);
Core::FeatureSet availableFeatures(const QString &platformName) const;
QStringList availablePlatforms() const;
QString displayNameForPlatform(const QString &string) const;
static Core::FeatureSet availableFeatures(const QString &platformName);
static QStringList availablePlatforms();
static QString displayNameForPlatform(const QString &string);
signals:
// content of BaseQtVersion objects with qmake path might have changed
......@@ -120,27 +119,18 @@ private:
QString *additionalArguments);
static BaseQtVersion::QmakeBuildConfigs qmakeBuildConfigFromCmdArgs(QList<QMakeAssignment> *assignments,
BaseQtVersion::QmakeBuildConfigs defaultBuildConfig);
bool restoreQtVersions();
void findSystemQt();
void saveQtVersions();
void updateDocumentation();
static bool restoreQtVersions();
static void findSystemQt();
static void saveQtVersions();
static void updateDocumentation();
// Used by QtOptionsPage
void setNewQtVersions(QList<BaseQtVersion *> newVersions);
static void setNewQtVersions(QList<BaseQtVersion *> newVersions);
// Used by QtVersion
int getUniqueId();
void addNewVersionsFromInstaller();
static int getUniqueId();
static void addNewVersionsFromInstaller();
static int indexOfVersionInList(const BaseQtVersion * const version, const QList<BaseQtVersion *> &list);
void updateUniqueIdToIndexMap();
QMap<int, BaseQtVersion *> m_versions;
int m_idcount;
// managed by QtProjectManagerPlugin
static QtVersionManager *m_self;
Utils::FileSystemWatcher *m_configFileWatcher;
QTimer *m_fileWatcherTimer;
Utils::PersistentSettingsWriter *m_writer;
static void updateUniqueIdToIndexMap();
};
} // namespace QtSupport
......
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