forked from qt-creator/qt-creator
isSystemVersion property to isAutodetected property
This commit is contained in:
@@ -98,7 +98,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
|
|||||||
|
|
||||||
for (int i = 0; i < m_versions.count(); ++i) {
|
for (int i = 0; i < m_versions.count(); ++i) {
|
||||||
const QtVersion * const version = m_versions.at(i);
|
const QtVersion * const version = m_versions.at(i);
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem(version->isSystemVersion()? autoItem : manualItem);
|
QTreeWidgetItem *item = new QTreeWidgetItem(version->isAutodetected()? autoItem : manualItem);
|
||||||
item->setText(0, version->name());
|
item->setText(0, version->name());
|
||||||
item->setText(1, QDir::toNativeSeparators(version->path()));
|
item->setText(1, QDir::toNativeSeparators(version->path()));
|
||||||
item->setData(0, Qt::UserRole, version->uniqueId());
|
item->setData(0, Qt::UserRole, version->uniqueId());
|
||||||
@@ -241,11 +241,11 @@ void QtOptionsPageWidget::updateState()
|
|||||||
{
|
{
|
||||||
int currentIndex = indexForTreeItem(m_ui->qtdirList->currentItem());
|
int currentIndex = indexForTreeItem(m_ui->qtdirList->currentItem());
|
||||||
bool enabled = (currentIndex >= 0);
|
bool enabled = (currentIndex >= 0);
|
||||||
bool isSystemVersion = (enabled
|
bool isAutodetected = (enabled
|
||||||
&& m_versions.at(currentIndex)->isSystemVersion());
|
&& m_versions.at(currentIndex)->isAutodetected());
|
||||||
m_ui->delButton->setEnabled(enabled && !isSystemVersion);
|
m_ui->delButton->setEnabled(enabled && !isAutodetected);
|
||||||
m_ui->nameEdit->setEnabled(enabled && !isSystemVersion);
|
m_ui->nameEdit->setEnabled(enabled && !isAutodetected);
|
||||||
m_ui->qtPath->setEnabled(enabled && !isSystemVersion);
|
m_ui->qtPath->setEnabled(enabled && !isAutodetected);
|
||||||
m_ui->mingwPath->setEnabled(enabled);
|
m_ui->mingwPath->setEnabled(enabled);
|
||||||
|
|
||||||
bool hasLog = enabled && !m_ui->qtdirList->currentItem()->data(2, Qt::UserRole).toString().isEmpty();
|
bool hasLog = enabled && !m_ui->qtdirList->currentItem()->data(2, Qt::UserRole).toString().isEmpty();
|
||||||
|
|||||||
@@ -85,10 +85,15 @@ QtVersionManager::QtVersionManager()
|
|||||||
id = getUniqueId();
|
id = getUniqueId();
|
||||||
else if (id > m_idcount)
|
else if (id > m_idcount)
|
||||||
m_idcount = id;
|
m_idcount = id;
|
||||||
|
bool isAutodetected;
|
||||||
|
if (s->contains("isAutodetected"))
|
||||||
|
isAutodetected = s->value("isAutodetected", false).toBool();
|
||||||
|
else // compatibility
|
||||||
|
isAutodetected = s->value("IsSystemVersion", false).toBool();
|
||||||
QtVersion *version = new QtVersion(s->value("Name").toString(),
|
QtVersion *version = new QtVersion(s->value("Name").toString(),
|
||||||
s->value("Path").toString(),
|
s->value("Path").toString(),
|
||||||
id,
|
id,
|
||||||
s->value("IsSystemVersion", false).toBool());
|
isAutodetected);
|
||||||
version->setMingwDirectory(s->value("MingwDirectory").toString());
|
version->setMingwDirectory(s->value("MingwDirectory").toString());
|
||||||
version->setMsvcVersion(s->value("msvcVersion").toString());
|
version->setMsvcVersion(s->value("msvcVersion").toString());
|
||||||
m_versions.append(version);
|
m_versions.append(version);
|
||||||
@@ -193,7 +198,7 @@ void QtVersionManager::writeVersionsIntoSettings()
|
|||||||
s->setValue("Id", m_versions.at(i)->uniqueId());
|
s->setValue("Id", m_versions.at(i)->uniqueId());
|
||||||
s->setValue("MingwDirectory", m_versions.at(i)->mingwDirectory());
|
s->setValue("MingwDirectory", m_versions.at(i)->mingwDirectory());
|
||||||
s->setValue("msvcVersion", m_versions.at(i)->msvcVersion());
|
s->setValue("msvcVersion", m_versions.at(i)->msvcVersion());
|
||||||
s->setValue("IsSystemVersion", m_versions.at(i)->isSystemVersion());
|
s->setValue("isAutodetected", m_versions.at(i)->isAutodetected());
|
||||||
}
|
}
|
||||||
s->endArray();
|
s->endArray();
|
||||||
}
|
}
|
||||||
@@ -283,7 +288,7 @@ void QtVersionManager::updateSystemVersion()
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (QtVersion *version, m_versions) {
|
foreach (QtVersion *version, m_versions) {
|
||||||
if (version->isSystemVersion()) {
|
if (version->isAutodetected()) { //TODO this needs to additionally check for the autodetectionsource
|
||||||
version->setPath(systemQtPath);
|
version->setPath(systemQtPath);
|
||||||
version->setName(tr("Qt in PATH"));
|
version->setName(tr("Qt in PATH"));
|
||||||
haveSystemVersion = true;
|
haveSystemVersion = true;
|
||||||
@@ -349,9 +354,9 @@ void QtVersionManager::setNewQtVersions(QList<QtVersion *> newVersions, int newD
|
|||||||
/// QtVersion
|
/// QtVersion
|
||||||
///
|
///
|
||||||
|
|
||||||
QtVersion::QtVersion(const QString &name, const QString &path, int id, bool isSystemVersion)
|
QtVersion::QtVersion(const QString &name, const QString &path, int id, bool isAutodetected)
|
||||||
: m_name(name),
|
: m_name(name),
|
||||||
m_isSystemVersion(isSystemVersion),
|
m_isAutodetected(isAutodetected),
|
||||||
m_hasDebuggingHelper(false),
|
m_hasDebuggingHelper(false),
|
||||||
m_notInstalled(false),
|
m_notInstalled(false),
|
||||||
m_defaultConfigIsDebug(true),
|
m_defaultConfigIsDebug(true),
|
||||||
@@ -370,7 +375,7 @@ QtVersion::QtVersion(const QString &name, const QString &path, int id, bool isSy
|
|||||||
|
|
||||||
QtVersion::QtVersion(const QString &name, const QString &path)
|
QtVersion::QtVersion(const QString &name, const QString &path)
|
||||||
: m_name(name),
|
: m_name(name),
|
||||||
m_isSystemVersion(false),
|
m_isAutodetected(false),
|
||||||
m_hasDebuggingHelper(false),
|
m_hasDebuggingHelper(false),
|
||||||
m_mkspecUpToDate(false),
|
m_mkspecUpToDate(false),
|
||||||
m_versionInfoUpToDate(false),
|
m_versionInfoUpToDate(false),
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class QtVersion
|
|||||||
friend class QtVersionManager;
|
friend class QtVersionManager;
|
||||||
public:
|
public:
|
||||||
QtVersion(const QString &name, const QString &path);
|
QtVersion(const QString &name, const QString &path);
|
||||||
QtVersion(const QString &name, const QString &path, int id, bool isSystemVersion = false);
|
QtVersion(const QString &name, const QString &path, int id, bool isAutodetected = false);
|
||||||
QtVersion()
|
QtVersion()
|
||||||
:m_name(QString::null), m_id(-1), m_toolChain(0)
|
:m_name(QString::null), m_id(-1), m_toolChain(0)
|
||||||
{ setPath(QString::null); }
|
{ setPath(QString::null); }
|
||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
|
|
||||||
bool isValid() const; //TOOD check that the dir exists and the name is non empty
|
bool isValid() const; //TOOD check that the dir exists and the name is non empty
|
||||||
bool isInstalled() const;
|
bool isInstalled() const;
|
||||||
bool isSystemVersion() const { return m_isSystemVersion; }
|
bool isAutodetected() const { return m_isAutodetected; }
|
||||||
|
|
||||||
QString name() const;
|
QString name() const;
|
||||||
QString path() const;
|
QString path() const;
|
||||||
@@ -129,7 +129,7 @@ private:
|
|||||||
QString m_mingwDirectory;
|
QString m_mingwDirectory;
|
||||||
QString m_msvcVersion;
|
QString m_msvcVersion;
|
||||||
int m_id;
|
int m_id;
|
||||||
bool m_isSystemVersion;
|
bool m_isAutodetected;
|
||||||
bool m_hasDebuggingHelper;
|
bool m_hasDebuggingHelper;
|
||||||
|
|
||||||
mutable bool m_mkspecUpToDate;
|
mutable bool m_mkspecUpToDate;
|
||||||
|
|||||||
Reference in New Issue
Block a user