forked from qt-creator/qt-creator
ProjectExplorer: Handle more Qt deprecations
Change-Id: I12895e65c14ca2723f6aea02c33b30659c30735a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -950,12 +950,12 @@ QVariant CheckBoxField::toSettings() const
|
||||
|
||||
std::unique_ptr<QStandardItem> createStandardItemFromListItem(const QVariant &item, QString *errorMessage)
|
||||
{
|
||||
if (item.type() == QVariant::List) {
|
||||
if (item.typeId() == QVariant::List) {
|
||||
*errorMessage = Tr::tr("No JSON lists allowed inside List items.");
|
||||
return {};
|
||||
}
|
||||
auto standardItem = std::make_unique<QStandardItem>();
|
||||
if (item.type() == QVariant::Map) {
|
||||
if (item.typeId() == QVariant::Map) {
|
||||
QVariantMap tmp = item.toMap();
|
||||
const QString key = JsonWizardFactory::localizedString(consumeValue(tmp, "trKey", QString()).toString());
|
||||
const QVariant value = consumeValue(tmp, "value", key);
|
||||
@@ -985,7 +985,7 @@ ListField::~ListField() = default;
|
||||
|
||||
bool ListField::parseData(const QVariant &data, QString *errorMessage)
|
||||
{
|
||||
if (data.type() != QVariant::Map) {
|
||||
if (data.typeId() != QVariant::Map) {
|
||||
*errorMessage = Tr::tr("%1 (\"%2\") data is not an object.").arg(type(), name());
|
||||
return false;
|
||||
}
|
||||
@@ -1011,7 +1011,7 @@ bool ListField::parseData(const QVariant &data, QString *errorMessage)
|
||||
*errorMessage = Tr::tr("%1 (\"%2\") \"items\" missing.").arg(type(), name());
|
||||
return false;
|
||||
}
|
||||
if (value.type() != QVariant::List) {
|
||||
if (value.typeId() != QVariant::List) {
|
||||
*errorMessage = Tr::tr("%1 (\"%2\") \"items\" is not a JSON list.").arg(type(), name());
|
||||
return false;
|
||||
}
|
||||
|
@@ -386,7 +386,7 @@ void ArgumentsAspect::fromMap(const QVariantMap &map)
|
||||
{
|
||||
QVariant args = map.value(settingsKey());
|
||||
// Until 3.7 a QStringList was stored for Remote Linux
|
||||
if (args.type() == QVariant::StringList)
|
||||
if (args.typeId() == QVariant::StringList)
|
||||
m_arguments = ProcessArgs::joinArgs(args.toStringList(), OsTypeLinux);
|
||||
else
|
||||
m_arguments = args.toString();
|
||||
|
@@ -455,7 +455,7 @@ QVariantMap UserFileVersion14Upgrader::upgrade(const QVariantMap &map)
|
||||
{
|
||||
QVariantMap result;
|
||||
for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) {
|
||||
if (it.value().type() == QVariant::Map)
|
||||
if (it.value().typeId() == QVariant::Map)
|
||||
result.insert(it.key(), upgrade(it.value().toMap()));
|
||||
else if (it.key() == "AutotoolsProjectManager.AutotoolsBuildConfiguration.BuildDirectory"
|
||||
|| it.key() == "CMakeProjectManager.CMakeBuildConfiguration.BuildDirectory"
|
||||
@@ -710,7 +710,7 @@ QVariantMap UserFileVersion17Upgrader::upgrade(const QVariantMap &map)
|
||||
|
||||
QVariant UserFileVersion17Upgrader::process(const QVariant &entry)
|
||||
{
|
||||
switch (entry.type()) {
|
||||
switch (entry.typeId()) {
|
||||
case QVariant::List: {
|
||||
QVariantList result;
|
||||
for (const QVariant &item : entry.toList())
|
||||
@@ -738,7 +738,7 @@ QVariantMap UserFileVersion18Upgrader::upgrade(const QVariantMap &map)
|
||||
|
||||
QVariant UserFileVersion18Upgrader::process(const QVariant &entry)
|
||||
{
|
||||
switch (entry.type()) {
|
||||
switch (entry.typeId()) {
|
||||
case QVariant::List:
|
||||
return Utils::transform(entry.toList(), &UserFileVersion18Upgrader::process);
|
||||
case QVariant::Map:
|
||||
@@ -792,7 +792,7 @@ QVariant UserFileVersion19Upgrader::process(const QVariant &entry, const QString
|
||||
"QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath"};
|
||||
static const QStringList dyldKeys = {"Qbs.RunConfiguration.UseDyldImageSuffix",
|
||||
"QmakeProjectManager.QmakeRunConfiguration.UseDyldImageSuffix"};
|
||||
switch (entry.type()) {
|
||||
switch (entry.typeId()) {
|
||||
case QVariant::List:
|
||||
return Utils::transform(entry.toList(),
|
||||
std::bind(&UserFileVersion19Upgrader::process, std::placeholders::_1, path));
|
||||
@@ -827,7 +827,7 @@ QVariantMap UserFileVersion20Upgrader::upgrade(const QVariantMap &map)
|
||||
|
||||
QVariant UserFileVersion20Upgrader::process(const QVariant &entry)
|
||||
{
|
||||
switch (entry.type()) {
|
||||
switch (entry.typeId()) {
|
||||
case QVariant::List:
|
||||
return Utils::transform(entry.toList(), &UserFileVersion20Upgrader::process);
|
||||
case QVariant::Map:
|
||||
@@ -853,7 +853,7 @@ QVariantMap UserFileVersion21Upgrader::upgrade(const QVariantMap &map)
|
||||
|
||||
QVariant UserFileVersion21Upgrader::process(const QVariant &entry)
|
||||
{
|
||||
switch (entry.type()) {
|
||||
switch (entry.typeId()) {
|
||||
case QVariant::List:
|
||||
return Utils::transform(entry.toList(), &UserFileVersion21Upgrader::process);
|
||||
case QVariant::Map: {
|
||||
|
Reference in New Issue
Block a user