diff --git a/src/libs/advanceddockingsystem/dockcontainerwidget.cpp b/src/libs/advanceddockingsystem/dockcontainerwidget.cpp index f2e2b6b2063..0e283fcbc64 100644 --- a/src/libs/advanceddockingsystem/dockcontainerwidget.cpp +++ b/src/libs/advanceddockingsystem/dockcontainerwidget.cpp @@ -16,6 +16,7 @@ #include "floatingdockcontainer.h" #include +#include #include #include #include diff --git a/src/libs/utils/id.cpp b/src/libs/utils/id.cpp index 45e42708288..2f0bdbd4eea 100644 --- a/src/libs/utils/id.cpp +++ b/src/libs/utils/id.cpp @@ -82,7 +82,7 @@ static QHash stringFromId; static IdCache idFromString; static QReadWriteLock s_cacheMutex; -static quintptr theId(const char *str, int n = 0) +static quintptr theId(const char *str, int n) { QTC_ASSERT(str && *str, return 0); StringHolder sh(str, n); @@ -107,11 +107,6 @@ static quintptr theId(const char *str, int n = 0) return res; } -static quintptr theId(const QByteArray &ba) -{ - return theId(ba.constData(), ba.size()); -} - /*! \fn Utils::Id::Id(quintptr uid) \internal @@ -181,11 +176,12 @@ Key Id::toKey() const \sa toString(), fromSetting() */ -Id Id::fromString(const QString &name) +Id Id::fromString(const QStringView name) { if (name.isEmpty()) return Id(); - return Id(theId(name.toUtf8())); + const QByteArray ba = name.toUtf8(); + return Id(theId(ba.data(), ba.size())); } /*! @@ -199,9 +195,9 @@ Id Id::fromString(const QString &name) \sa toString(), fromSetting() */ -Id Id::fromName(const QByteArray &name) +Id Id::fromName(const QByteArrayView name) { - return Id(theId(name)); + return Id(theId(name.data(), name.size())); } /*! @@ -228,7 +224,7 @@ Id Id::fromSetting(const QVariant &variant) const QByteArray ba = variant.toString().toUtf8(); if (ba.isEmpty()) return Id(); - return Id(theId(ba)); + return Id(theId(ba.data(), ba.size())); } QSet Id::fromStringList(const QStringList &list) @@ -252,7 +248,7 @@ QStringList Id::toStringList(const QSet &ids) Id Id::withSuffix(int suffix) const { const QByteArray ba = name() + QByteArray::number(suffix); - return Id(ba.constData()); + return Id(theId(ba.data(), ba.size())); } /*! @@ -262,17 +258,17 @@ Id Id::withSuffix(int suffix) const Id Id::withSuffix(const char *suffix) const { const QByteArray ba = name() + suffix; - return Id(ba.constData()); + return Id(theId(ba.data(), ba.size())); } /*! \overload */ -Id Id::withSuffix(const QString &suffix) const +Id Id::withSuffix(const QStringView suffix) const { const QByteArray ba = name() + suffix.toUtf8(); - return Id(ba.constData()); + return Id(theId(ba.data(), ba.size())); } /*! @@ -286,10 +282,9 @@ Id Id::withSuffix(const QString &suffix) const Id Id::withPrefix(const char *prefix) const { const QByteArray ba = prefix + name(); - return Id(ba.constData()); + return Id(theId(ba.data(), ba.size())); } - bool Id::operator==(const char *name) const { QReadLocker lock(&s_cacheMutex); diff --git a/src/libs/utils/id.h b/src/libs/utils/id.h index 62b70353450..4b18736d5cf 100644 --- a/src/libs/utils/id.h +++ b/src/libs/utils/id.h @@ -29,7 +29,7 @@ public: Id withSuffix(int suffix) const; Id withSuffix(const char *suffix) const; - Id withSuffix(const QString &suffix) const; + Id withSuffix(const QStringView suffix) const; Id withPrefix(const char *prefix) const; QByteArray name() const; @@ -47,8 +47,8 @@ public: bool alphabeticallyBefore(Id other) const; quintptr uniqueIdentifier() const { return m_id; } // Avoid. - static Id fromString(const QString &str); // FIXME: avoid. - static Id fromName(const QByteArray &ba); // FIXME: avoid. + static Id fromString(const QStringView str); // FIXME: avoid. + static Id fromName(const QByteArrayView ba); // FIXME: avoid. static Id fromSetting(const QVariant &variant); // Good to use. static QSet fromStringList(const QStringList &list); diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index cc824e1343a..25b9444a7a4 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -441,12 +441,12 @@ AndroidDeviceInfo AndroidDevice::androidDeviceInfoFromIDevice(const IDevice *dev Id AndroidDevice::idFromDeviceInfo(const AndroidDeviceInfo &info) { const QString id = (info.type == IDevice::Hardware ? info.serialNumber : info.avdName); - return Id(Constants::ANDROID_DEVICE_ID).withSuffix(':' + id); + return Id(Constants::ANDROID_DEVICE_ID).withSuffix(':').withSuffix(id); } Id AndroidDevice::idFromAvdInfo(const CreateAvdInfo &info) { - return Id(Constants::ANDROID_DEVICE_ID).withSuffix(':' + info.name); + return Id(Constants::ANDROID_DEVICE_ID).withSuffix(':').withSuffix(info.name); } QStringList AndroidDevice::supportedAbis() const @@ -650,10 +650,10 @@ static void handleDevicesListChange(const QString &serialNumber) if (isEmulator) { const QString avdName = emulatorName(serial); - const Id avdId = Id(Constants::ANDROID_DEVICE_ID).withSuffix(':' + avdName); + const Id avdId = Id(Constants::ANDROID_DEVICE_ID).withSuffix(':').withSuffix(avdName); devMgr->setDeviceState(avdId, state); } else { - const Id id = Id(Constants::ANDROID_DEVICE_ID).withSuffix(':' + serial); + const Id id = Id(Constants::ANDROID_DEVICE_ID).withSuffix(':').withSuffix(serial); QString displayName = AndroidConfig::getProductModel(serial); // Check if the device is connected via WiFi. A sample serial of such devices can be // like: "192.168.1.190:5555" diff --git a/src/plugins/boot2qt/device-detection/devicedetector.cpp b/src/plugins/boot2qt/device-detection/devicedetector.cpp index bc4fbcee665..60e71def4ad 100644 --- a/src/plugins/boot2qt/device-detection/devicedetector.cpp +++ b/src/plugins/boot2qt/device-detection/devicedetector.cpp @@ -75,8 +75,9 @@ void DeviceDetector::handleDeviceEvent(QdbDeviceTracker::DeviceEventType eventTy return; } - const Utils::Id deviceId = Constants::QdbHardwareDevicePrefix.withSuffix(':' + serial); - const auto messagePrefix = Tr::tr("Device \"%1\" %2").arg(serial); + const Utils::Id deviceId = + Utils::Id(Constants::QdbHardwareDevicePrefix).withSuffix(':').withSuffix(serial); + const QString messagePrefix = Tr::tr("Device \"%1\" %2").arg(serial); DeviceManager * const dm = DeviceManager::instance(); if (eventType == QdbDeviceTracker::NewDevice) { diff --git a/src/plugins/boot2qt/qdbconstants.h b/src/plugins/boot2qt/qdbconstants.h index 40bdd4a5272..690b2fb3e07 100644 --- a/src/plugins/boot2qt/qdbconstants.h +++ b/src/plugins/boot2qt/qdbconstants.h @@ -16,7 +16,7 @@ const char QdbDeployConfigurationId[] = "Qt4ProjectManager.Qdb.QdbDeployConfigur const char QdbStopApplicationStepId[] = "Qdb.StopApplicationStep"; const char QdbMakeDefaultAppStepId[] = "Qdb.MakeDefaultAppStep"; -const Utils::Id QdbHardwareDevicePrefix = "QdbHardwareDevice"; +const char QdbHardwareDevicePrefix[] = "QdbHardwareDevice"; const char AppcontrollerFilepath[] = "/usr/bin/appcontroller"; } // namespace Constants diff --git a/src/plugins/coreplugin/progressmanager/processprogress.cpp b/src/plugins/coreplugin/progressmanager/processprogress.cpp index e3769f54ca9..357b0846f64 100644 --- a/src/plugins/coreplugin/progressmanager/processprogress.cpp +++ b/src/plugins/coreplugin/progressmanager/processprogress.cpp @@ -97,7 +97,7 @@ ProcessProgress::ProcessProgress(Process *process) d->m_futureInterface.reportStarted(); const QString name = d->displayName(); - const auto id = Id::fromString(name + ".action"); + const Id id = Id::fromString(name).withSuffix(".action"); if (d->m_parser) { d->m_futureProgress = ProgressManager::addTask(d->m_futureInterface.future(), name, id); } else { diff --git a/src/plugins/coreplugin/progressmanager/taskprogress.cpp b/src/plugins/coreplugin/progressmanager/taskprogress.cpp index 72838aef90f..bfdbe727541 100644 --- a/src/plugins/coreplugin/progressmanager/taskprogress.cpp +++ b/src/plugins/coreplugin/progressmanager/taskprogress.cpp @@ -120,7 +120,7 @@ TaskProgress::TaskProgress(TaskTree *taskTree) d->m_futureInterface.reportStarted(); d->advanceProgress(0); - const Id id = d->m_id.isValid() ? d->m_id : Id::fromString(d->m_displayName + ".action"); + const Id id = d->m_id.isValid() ? d->m_id : Id::fromString(d->m_displayName).withSuffix(".action"); d->m_futureProgress = ProgressManager::addTask(d->m_futureInterface.future(), d->m_displayName, id); d->m_futureProgress->setKeepOnFinish(d->m_keep); diff --git a/src/plugins/gitlab/gitlabclonedialog.cpp b/src/plugins/gitlab/gitlabclonedialog.cpp index ae5390e941b..2eaae7cda21 100644 --- a/src/plugins/gitlab/gitlabclonedialog.cpp +++ b/src/plugins/gitlab/gitlabclonedialog.cpp @@ -133,7 +133,7 @@ void GitLabCloneDialog::updateUi() void GitLabCloneDialog::cloneProject() { VersionControlBase *vc = static_cast( - Core::VcsManager::versionControl(Id::fromString("G.Git"))); + Core::VcsManager::versionControl(Id("G.Git"))); QTC_ASSERT(vc, return); const QStringList extraArgs = m_submodulesCB->isChecked() ? QStringList{ "--recursive" } : QStringList{}; diff --git a/src/plugins/lua/bindings/fetch.cpp b/src/plugins/lua/bindings/fetch.cpp index f998db4f536..e59538a7a19 100644 --- a/src/plugins/lua/bindings/fetch.cpp +++ b/src/plugins/lua/bindings/fetch.cpp @@ -204,7 +204,7 @@ void addFetchModule() } Utils::InfoBarEntry entry{ - Utils::Id::fromString("Fetch" + pluginName), + Utils::Id("Fetch").withSuffix(pluginName), Tr::tr("Allow the extension \"%1\" to fetch data from the internet?") .arg(pluginName)}; entry.setDetailsWidgetCreator([pluginName, url] { @@ -221,16 +221,16 @@ void addFetchModule() }); entry.addCustomButton(Tr::tr("Always Allow"), [mod, pluginName, fetch]() { mod->setAllowedToFetch(pluginName, Module::IsAllowed::Yes); - Core::ICore::infoBar()->removeInfo(Utils::Id::fromString("Fetch" + pluginName)); + Core::ICore::infoBar()->removeInfo(Utils::Id("Fetch").withSuffix(pluginName)); fetch(); }); entry.addCustomButton(Tr::tr("Allow Once"), [pluginName, fetch]() { - Core::ICore::infoBar()->removeInfo(Utils::Id::fromString("Fetch" + pluginName)); + Core::ICore::infoBar()->removeInfo(Utils::Id("Fetch").withSuffix(pluginName)); fetch(); }); entry.setCancelButtonInfo(Tr::tr("Deny"), [mod, notAllowed, pluginName]() { - Core::ICore::infoBar()->removeInfo(Utils::Id::fromString("Fetch" + pluginName)); + Core::ICore::infoBar()->removeInfo(Utils::Id("Fetch").withSuffix(pluginName)); mod->setAllowedToFetch(pluginName, Module::IsAllowed::No); notAllowed(); }); diff --git a/src/plugins/lua/bindings/install.cpp b/src/plugins/lua/bindings/install.cpp index a5e77d1e521..a2123f3d8aa 100644 --- a/src/plugins/lua/bindings/install.cpp +++ b/src/plugins/lua/bindings/install.cpp @@ -351,8 +351,9 @@ void addInstallModule() return; } - const Utils::Id infoBarId = Utils::Id::fromString( - "Install" + pluginSpec->name + QString::number(qHash(installOptionsList))); + const Utils::Id infoBarId = Utils::Id("Install") + .withSuffix(pluginSpec->name) + .withSuffix(QString::number(qHash(installOptionsList))); InfoBarEntry entry(infoBarId, msg, InfoBarEntry::GlobalSuppression::Enabled); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index 7b2a5bda023..c435921b195 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -159,7 +159,7 @@ static JsonWizardFactory::Generator parseGenerator(const QVariant &value, QStrin *errorMessage = Tr::tr("Generator has no typeId set."); return gen; } - Id typeId = Id::fromString(QLatin1String(Constants::GENERATOR_ID_PREFIX) + strVal); + Id typeId = Id(Constants::GENERATOR_ID_PREFIX).withSuffix(strVal); JsonWizardGeneratorFactory *factory = findOr(generatorFactories(), nullptr, [typeId](JsonWizardGeneratorFactory *f) { return f->canCreate(typeId); }); if (!factory) { @@ -326,7 +326,7 @@ std::pair JsonWizardFactory::screenSizeInfoFromPage(const QStr * pages[i] is the page of type `pageType` and data[j] is the data item with name ScreenFactor */ - const Utils::Id id = Utils::Id::fromString(Constants::PAGE_ID_PREFIX + pageType); + const Utils::Id id = Utils::Id(Constants::PAGE_ID_PREFIX).withSuffix(pageType); const auto it = std::find_if(std::cbegin(m_pages), std::cend(m_pages), [&id](const Page &page) { return page.typeId == id; @@ -393,7 +393,7 @@ JsonWizardFactory::Page JsonWizardFactory::parsePage(const QVariant &value, QStr *errorMessage = Tr::tr("Page has no typeId set."); return p; } - Id typeId = Id::fromString(QLatin1String(Constants::PAGE_ID_PREFIX) + strVal); + Id typeId = Id(Constants::PAGE_ID_PREFIX).withSuffix(strVal); JsonWizardPageFactory *factory = Utils::findOr(pageFactories(), nullptr, [typeId](JsonWizardPageFactory *f) { return f->canCreate(typeId); }); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp index b85641f9c31..8fd3b4ecc23 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp @@ -259,13 +259,14 @@ bool JsonWizardGenerator::allDone(const JsonWizard *wizard, JsonWizard::Generato void JsonWizardGeneratorFactory::setTypeIdsSuffixes(const QStringList &suffixes) { - m_typeIds = Utils::transform(suffixes, [](QString suffix) - { return Id::fromString(QString::fromLatin1(Constants::GENERATOR_ID_PREFIX) + suffix); }); + m_typeIds = Utils::transform(suffixes, [](QString suffix) { + return Id(Constants::GENERATOR_ID_PREFIX).withSuffix(suffix); + }); } void JsonWizardGeneratorFactory::setTypeIdsSuffix(const QString &suffix) { - setTypeIdsSuffixes(QStringList() << suffix); + setTypeIdsSuffixes({suffix}); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp index 0961cfa9064..4b2589228e5 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.cpp @@ -9,19 +9,16 @@ namespace ProjectExplorer { -// -------------------------------------------------------------------- -// JsonWizardPageFactory: -// -------------------------------------------------------------------- - void JsonWizardPageFactory::setTypeIdsSuffixes(const QStringList &suffixes) { m_typeIds = Utils::transform(suffixes, [](const QString &suffix) { - return Utils::Id::fromString(QString::fromLatin1(Constants::PAGE_ID_PREFIX) + suffix);}); + return Utils::Id(Constants::PAGE_ID_PREFIX).withSuffix(suffix); + }); } void JsonWizardPageFactory::setTypeIdsSuffix(const QString &suffix) { - setTypeIdsSuffixes(QStringList() << suffix); + setTypeIdsSuffixes({suffix}); } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectimporter.cpp b/src/plugins/projectexplorer/projectimporter.cpp index 9c12b89c8b9..8cd4d2359c0 100644 --- a/src/plugins/projectexplorer/projectimporter.cpp +++ b/src/plugins/projectexplorer/projectimporter.cpp @@ -38,7 +38,7 @@ static Utils::Id fullId(Utils::Id id) const QString idStr = id.toString(); QTC_ASSERT(!idStr.startsWith(prefix), return Utils::Id::fromString(idStr)); - return Utils::Id::fromString(prefix + idStr); + return Utils::Id::fromString(prefix).withSuffix(idStr); } static bool hasOtherUsers(Utils::Id id, const QVariant &v, Kit *k) diff --git a/src/plugins/projectexplorer/workspaceproject.cpp b/src/plugins/projectexplorer/workspaceproject.cpp index 53b77f91fcf..840941bda55 100644 --- a/src/plugins/projectexplorer/workspaceproject.cpp +++ b/src/plugins/projectexplorer/workspaceproject.cpp @@ -26,21 +26,21 @@ #include #include -const QLatin1StringView FOLDER_MIMETYPE{"inode/directory"}; -const QLatin1StringView WORKSPACE_MIMETYPE{"text/x-workspace-project"}; -const QLatin1StringView WORKSPACE_PROJECT_ID{"ProjectExplorer.WorkspaceProject"}; -const QLatin1StringView WORKSPACE_PROJECT_RUNCONFIG_ID{"WorkspaceProject.RunConfiguration:"}; - -const QLatin1StringView PROJECT_NAME_KEY{"project.name"}; -const QLatin1StringView FILES_EXCLUDE_KEY{"files.exclude"}; -const QLatin1StringView EXCLUDE_ACTION_ID{"ProjectExplorer.ExcludeFromWorkspace"}; -const QLatin1StringView RESCAN_ACTION_ID{"ProjectExplorer.RescanWorkspace"}; - using namespace Utils; using namespace Core; namespace ProjectExplorer { +const QLatin1StringView FOLDER_MIMETYPE{"inode/directory"}; +const QLatin1StringView WORKSPACE_MIMETYPE{"text/x-workspace-project"}; +const char WORKSPACE_PROJECT_ID[] = "ProjectExplorer.WorkspaceProject"; +const char WORKSPACE_PROJECT_RUNCONFIG_ID[] = "WorkspaceProject.RunConfiguration:"; + +const QLatin1StringView PROJECT_NAME_KEY{"project.name"}; +const QLatin1StringView FILES_EXCLUDE_KEY{"files.exclude"}; +const char EXCLUDE_ACTION_ID[] = "ProjectExplorer.ExcludeFromWorkspace"; +const char RESCAN_ACTION_ID[] = "ProjectExplorer.RescanWorkspace"; + const expected_str projectDefinition(const Project *project) { if (auto fileContents = project->projectFilePath().fileContents()) @@ -231,8 +231,8 @@ public: WorkspaceProjectRunConfigurationFactory() { registerRunConfiguration( - Id::fromString(WORKSPACE_PROJECT_RUNCONFIG_ID)); - addSupportedProjectType(Id::fromString(WORKSPACE_PROJECT_ID)); + Id(WORKSPACE_PROJECT_RUNCONFIG_ID)); + addSupportedProjectType(WORKSPACE_PROJECT_ID); } }; @@ -243,7 +243,7 @@ public: { setProduct(); addSupportedRunMode(Constants::NORMAL_RUN_MODE); - addSupportedRunConfig(Id::fromString(WORKSPACE_PROJECT_RUNCONFIG_ID)); + addSupportedRunConfig(WORKSPACE_PROJECT_RUNCONFIG_ID); } }; @@ -268,7 +268,7 @@ public: registerBuildConfiguration ("WorkspaceProject.BuildConfiguration"); - setSupportedProjectType(Id::fromString(WORKSPACE_PROJECT_ID)); + setSupportedProjectType(WORKSPACE_PROJECT_ID); setBuildGenerator([](const Kit *, const FilePath &projectPath, bool forSetup) { BuildInfo info; @@ -298,7 +298,7 @@ public: projectFilePath().writeFileContents(QJsonDocument(projectJson).toJson()); } - setId(Id::fromString(WORKSPACE_PROJECT_ID)); + setId(WORKSPACE_PROJECT_ID); setDisplayName(projectDirectory().fileName()); setBuildSystemCreator(); } @@ -347,8 +347,8 @@ void setupWorkspaceProject(QObject *guard) ProjectManager::registerProjectType(WORKSPACE_MIMETYPE); QAction *excludeAction = nullptr; - ActionBuilder(guard, Id::fromString(EXCLUDE_ACTION_ID)) - .setContext(Id::fromString(WORKSPACE_PROJECT_ID)) + ActionBuilder(guard, EXCLUDE_ACTION_ID) + .setContext(WORKSPACE_PROJECT_ID) .setText(Tr::tr("Exclude from Project")) .addToContainer(Constants::M_FOLDERCONTEXT, Constants::G_FOLDER_OTHER) .addToContainer(Constants::M_FILECONTEXT, Constants::G_FILE_OTHER) @@ -363,8 +363,8 @@ void setupWorkspaceProject(QObject *guard) }); QAction *rescanAction = nullptr; - ActionBuilder(guard, Id::fromString(RESCAN_ACTION_ID)) - .setContext(Id::fromString(WORKSPACE_PROJECT_ID)) + ActionBuilder(guard, RESCAN_ACTION_ID) + .setContext(WORKSPACE_PROJECT_ID) .setText(Tr::tr("Rescan Workspace")) .addToContainer(Constants::M_PROJECTCONTEXT, Constants::G_PROJECT_REBUILD) .bindContextAction(&rescanAction) diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index a203fb68674..c22b84dd61e 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -347,7 +347,7 @@ void DesignModeWidget::setup() // Create menu action auto command = Core::ActionManager::registerAction(dockWidget->toggleViewAction(), - actionToggle.withSuffix(uniqueId + "Widget"), + actionToggle.withSuffix(uniqueId).withSuffix("Widget"), designContext); command->setAttribute(Core::Command::CA_Hide); viewCommands.append(command); @@ -368,8 +368,7 @@ void DesignModeWidget::setup() // Create menu action auto command = Core::ActionManager::registerAction(dockWidget->toggleViewAction(), - actionToggle.withSuffix( - widgetInfo.uniqueId + "Widget"), + actionToggle.withSuffix(widgetInfo.uniqueId).withSuffix("Widget"), designContext); command->setAttribute(Core::Command::CA_Hide); viewCommands.append(command); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index a8d940c6efc..354425867fe 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -225,7 +225,7 @@ static QSet versionedIds(const QByteArray &prefix, int major, int minor) if (major < 0) return result; - const QByteArray majorStr = QString::number(major).toLatin1(); + const QByteArray majorStr = QByteArray::number(major); const QByteArray featureMajor = prefix + majorStr; const QByteArray featureDotMajor = prefix + '.' + majorStr; @@ -233,9 +233,8 @@ static QSet versionedIds(const QByteArray &prefix, int major, int minor) result.insert(Id::fromName(featureDotMajor)); for (int i = 0; i <= minor; ++i) { - const QByteArray minorStr = QString::number(i).toLatin1(); - result.insert(Id::fromName(featureMajor + '.' + minorStr)); - result.insert(Id::fromName(featureDotMajor + '.' + minorStr)); + result.insert(Id::fromName(featureMajor).withSuffix('.').withSuffix(i)); + result.insert(Id::fromName(featureDotMajor).withSuffix('.').withSuffix(i)); } // FIXME: Terrible hack. Get rid of using version numbers as tags!