Commit 4e4dad70 authored by Daniel Teske's avatar Daniel Teske
Browse files

QtVersion: Move string constants to QtSupport::Constants



As I need them in two different places

Change-Id: Ic782253916615f43cc43016bbd3d52cfae5ec407
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent f82bcf22
...@@ -63,8 +63,6 @@ using namespace QtSupport; ...@@ -63,8 +63,6 @@ using namespace QtSupport;
using namespace QtSupport::Internal; using namespace QtSupport::Internal;
using namespace Utils; using namespace Utils;
static const char QTVERSIONID[] = "Id";
static const char QTVERSIONNAME[] = "Name";
static const char QTVERSIONAUTODETECTED[] = "isAutodetected"; static const char QTVERSIONAUTODETECTED[] = "isAutodetected";
static const char QTVERSIONAUTODETECTIONSOURCE []= "autodetectionSource"; static const char QTVERSIONAUTODETECTIONSOURCE []= "autodetectionSource";
static const char QTVERSIONQMAKEPATH[] = "QMakePath"; static const char QTVERSIONQMAKEPATH[] = "QMakePath";
...@@ -380,10 +378,10 @@ void BaseQtVersion::setId(int id) ...@@ -380,10 +378,10 @@ void BaseQtVersion::setId(int id)
void BaseQtVersion::fromMap(const QVariantMap &map) void BaseQtVersion::fromMap(const QVariantMap &map)
{ {
m_id = map.value(QLatin1String(QTVERSIONID)).toInt(); 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 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::instance()->getUniqueId();
m_displayName = map.value(QLatin1String(QTVERSIONNAME)).toString(); m_displayName = map.value(QLatin1String(Constants::QTVERSIONNAME)).toString();
m_isAutodetected = map.value(QLatin1String(QTVERSIONAUTODETECTED)).toBool(); m_isAutodetected = map.value(QLatin1String(QTVERSIONAUTODETECTED)).toBool();
if (m_isAutodetected) if (m_isAutodetected)
m_autodetectionSource = map.value(QLatin1String(QTVERSIONAUTODETECTIONSOURCE)).toString(); m_autodetectionSource = map.value(QLatin1String(QTVERSIONAUTODETECTIONSOURCE)).toString();
...@@ -396,8 +394,8 @@ void BaseQtVersion::fromMap(const QVariantMap &map) ...@@ -396,8 +394,8 @@ void BaseQtVersion::fromMap(const QVariantMap &map)
QVariantMap BaseQtVersion::toMap() const QVariantMap BaseQtVersion::toMap() const
{ {
QVariantMap result; QVariantMap result;
result.insert(QLatin1String(QTVERSIONID), uniqueId()); result.insert(QLatin1String(Constants::QTVERSIONID), uniqueId());
result.insert(QLatin1String(QTVERSIONNAME), displayName()); result.insert(QLatin1String(Constants::QTVERSIONNAME), displayName());
result.insert(QLatin1String(QTVERSIONAUTODETECTED), isAutodetected()); result.insert(QLatin1String(QTVERSIONAUTODETECTED), isAutodetected());
if (isAutodetected()) if (isAutodetected())
result.insert(QLatin1String(QTVERSIONAUTODETECTIONSOURCE), autodetectionSource()); result.insert(QLatin1String(QTVERSIONAUTODETECTIONSOURCE), autodetectionSource());
......
...@@ -43,6 +43,10 @@ const char DESKTOPQT[] = "Qt4ProjectManager.QtVersion.Desktop"; ...@@ -43,6 +43,10 @@ const char DESKTOPQT[] = "Qt4ProjectManager.QtVersion.Desktop";
const char SIMULATORQT[] = "Qt4ProjectManager.QtVersion.Simulator"; const char SIMULATORQT[] = "Qt4ProjectManager.QtVersion.Simulator";
const char WINCEQT[] = "Qt4ProjectManager.QtVersion.WinCE"; const char WINCEQT[] = "Qt4ProjectManager.QtVersion.WinCE";
// BaseQtVersion settings
static const char QTVERSIONID[] = "Id";
static const char QTVERSIONNAME[] = "Name";
//Qt Features //Qt Features
const char FEATURE_QT[] = "QtSupport.Wizards.FeatureQt"; const char FEATURE_QT[] = "QtSupport.Wizards.FeatureQt";
const char FEATURE_QWIDGETS[] = "QtSupport.Wizards.FeatureQWidgets"; const char FEATURE_QWIDGETS[] = "QtSupport.Wizards.FeatureQWidgets";
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "qtversionfactory.h" #include "qtversionfactory.h"
#include "baseqtversion.h" #include "baseqtversion.h"
#include "qtfeatureprovider.h" #include "qtfeatureprovider.h"
#include "qtsupportconstants.h"
// only for legay restore // only for legay restore
#include <projectexplorer/gcctoolchain.h> #include <projectexplorer/gcctoolchain.h>
...@@ -309,7 +310,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) ...@@ -309,7 +310,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal)
if (debug) if (debug)
qDebug() << " Qt version found with same autodetection source" << autoDetectionSource << " => Migrating id:" << id; qDebug() << " Qt version found with same autodetection source" << autoDetectionSource << " => Migrating id:" << id;
m_versions.remove(id); m_versions.remove(id);
qtversionMap[QLatin1String("Id")] = id; qtversionMap[QLatin1String(Constants::QTVERSIONID)] = id;
delete v; delete v;
if (BaseQtVersion *qtv = factory->restore(type, qtversionMap)) { if (BaseQtVersion *qtv = factory->restore(type, qtversionMap)) {
......
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