From f65954d9033cbd1d342ecb6c202920a0df992dc7 Mon Sep 17 00:00:00 2001 From: Niels Weber Date: Thu, 21 Mar 2013 10:32:40 +0100 Subject: Remove previously deprecated Pages config.xml element. Change-Id: I909c81896186ef5191d1dac799296da26e37072f Reviewed-by: Karsten Heimrich --- doc/installerfw.qdoc | 4 - src/libs/installer/packagemanagergui.cpp | 135 ++++++--------------- src/libs/installer/packagemanagergui.h | 7 -- src/libs/installer/settings.cpp | 65 +--------- src/libs/installer/settings.h | 3 - tests/auto/installer/settings/data/full_config.xml | 122 ------------------- tests/auto/installer/settings/tst_settings.cpp | 1 - 7 files changed, 39 insertions(+), 298 deletions(-) diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc index f47eb4b6c..c89e3f92a 100644 --- a/doc/installerfw.qdoc +++ b/doc/installerfw.qdoc @@ -257,10 +257,6 @@ \row \o TargetConfigurationFile \o Filename for the configuration file on the target. Default is components.xml. - \row - \o Pages - \o Custom strings for labels in the installer pages. Deprecated, - see \l{Translating Pages} instead. \endtable */ diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index 49bf546e5..f0e0ba13c 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -698,41 +698,6 @@ PackageManagerCore *PackageManagerPage::packageManagerCore() const return m_core; } -QVariantHash PackageManagerPage::elementsForPage(const QString &pageName) const -{ - const QVariant variant = m_core->settings().value(pageName); - - QVariantHash hash; - if (variant.canConvert()) - hash = variant.value(); - return hash; -} - -QString PackageManagerPage::titleForPage(const QString &pageName, const QString &value) const -{ - return titleFromHash(m_core->settings().titlesForPage(pageName), value); -} - -QString PackageManagerPage::subTitleForPage(const QString &pageName, const QString &value) const -{ - return titleFromHash(m_core->settings().subTitlesForPage(pageName), value); -} - -QString PackageManagerPage::titleFromHash(const QVariantHash &hash, const QString &value) const -{ - QString defaultValue = hash.value(QLatin1String("Default")).toString(); - if (defaultValue.isEmpty()) - defaultValue = value; - - if (m_core->isUpdater()) - return hash.value(QLatin1String("Updater"), defaultValue).toString(); - if (m_core->isInstaller()) - return hash.value(QLatin1String("Installer"), defaultValue).toString(); - if (m_core->isPackageManager()) - return hash.value(QLatin1String("PackageManager"), defaultValue).toString(); - return hash.value(QLatin1String("Uninstaller"), defaultValue).toString(); -} - QPixmap PackageManagerPage::watermarkPixmap() const { return QPixmap(m_core->value(QLatin1String("WatermarkPixmap"))); @@ -851,15 +816,12 @@ IntroductionPage::IntroductionPage(PackageManagerCore *core) { setObjectName(QLatin1String("IntroductionPage")); setPixmap(QWizard::WatermarkPixmap, watermarkPixmap()); - setSubTitle(subTitleForPage(QLatin1String("IntroductionPage"))); - setTitle(titleForPage(QLatin1String("IntroductionPage"), tr("Setup - %1")).arg(productName())); + setTitle(tr("Setup - %1").arg(productName())); m_msgLabel = new QLabel(this); m_msgLabel->setWordWrap(true); m_msgLabel->setObjectName(QLatin1String("MessageLabel")); - const QVariantHash hash = elementsForPage(QLatin1String("IntroductionPage")); - m_msgLabel->setText(hash.value(QLatin1String("MessageLabel"), tr("Welcome to the %1 " - "Setup Wizard.")).toString().arg(productName())); + m_msgLabel->setText(tr("Welcome to the %1 Setup Wizard.").arg(productName())); QVBoxLayout *layout = new QVBoxLayout(this); setLayout(layout); @@ -918,7 +880,7 @@ LicenseAgreementPage::LicenseAgreementPage(PackageManagerCore *core) setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("LicenseAgreementPage")); - setTitle(titleForPage(QLatin1String("LicenseAgreementPage"), tr("License Agreement"))); + setTitle(tr("License Agreement")); m_licenseListWidget = new QListWidget(this); m_licenseListWidget->setObjectName(QLatin1String("LicenseListWidget")); @@ -1045,11 +1007,10 @@ void LicenseAgreementPage::updateUi() rejectButtonText = tr("I do not accept the licenses."); } - setSubTitle(subTitleForPage(QLatin1String("LicenseAgreementPage"), subTitleText)); + setSubTitle(subTitleText); - const QVariantHash hash = elementsForPage(QLatin1String("LicenseAgreementPage")); - m_acceptLabel->setText(hash.value(QLatin1String("AcceptLicenseLabel"), acceptButtonText).toString()); - m_rejectLabel->setText(hash.value(QLatin1String("RejectLicenseLabel"), rejectButtonText).toString()); + m_acceptLabel->setText(acceptButtonText); + m_rejectLabel->setText(rejectButtonText); } @@ -1100,17 +1061,15 @@ public: m_checkDefault = new QPushButton; connect(m_checkDefault, SIGNAL(clicked()), this, SLOT(selectDefault())); - const QVariantHash hash = q->elementsForPage(QLatin1String("ComponentSelectionPage")); if (m_core->isInstaller()) { m_checkDefault->setObjectName(QLatin1String("SelectDefaultComponentsButton")); m_checkDefault->setShortcut(QKeySequence(ComponentSelectionPage::tr("Alt+A", "select default components"))); - m_checkDefault->setText(hash.value(QLatin1String("SelectDefaultComponentsButton"), ComponentSelectionPage::tr("Def&ault")) - .toString()); + m_checkDefault->setText(ComponentSelectionPage::tr("Def&ault")); } else { m_checkDefault->setEnabled(false); m_checkDefault->setObjectName(QLatin1String("ResetComponentsButton")); m_checkDefault->setShortcut(QKeySequence(ComponentSelectionPage::tr("Alt+R", "reset to already installed components"))); - m_checkDefault->setText(hash.value(QLatin1String("ResetComponentsButton"), ComponentSelectionPage::tr("&Reset")).toString()); + m_checkDefault->setText(ComponentSelectionPage::tr("&Reset")); } hlayout = new QHBoxLayout; hlayout->addWidget(m_checkDefault); @@ -1120,15 +1079,14 @@ public: connect(m_checkAll, SIGNAL(clicked()), this, SLOT(selectAll())); m_checkAll->setObjectName(QLatin1String("SelectAllComponentsButton")); m_checkAll->setShortcut(QKeySequence(ComponentSelectionPage::tr("Alt+S", "select all components"))); - m_checkAll->setText(hash.value(QLatin1String("SelectAllComponentsButton"), ComponentSelectionPage::tr("&Select All")).toString()); + m_checkAll->setText(ComponentSelectionPage::tr("&Select All")); m_uncheckAll = new QPushButton; hlayout->addWidget(m_uncheckAll); connect(m_uncheckAll, SIGNAL(clicked()), this, SLOT(deselectAll())); m_uncheckAll->setObjectName(QLatin1String("DeselectAllComponentsButton")); m_uncheckAll->setShortcut(QKeySequence(ComponentSelectionPage::tr("Alt+D", "deselect all components"))); - m_uncheckAll->setText(hash.value(QLatin1String("DeselectAllComponentsButton"), ComponentSelectionPage::tr("&Deselect All")) - .toString()); + m_uncheckAll->setText(ComponentSelectionPage::tr("&Deselect All")); hlayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); @@ -1194,9 +1152,8 @@ public slots: return; if (component->updateUncompressedSize() > 0) { - m_sizeLabel->setText(q->elementsForPage(QLatin1String("ComponentSelectionPage")) - .value(QLatin1String("ComponentSizeLabel"), ComponentSelectionPage::tr("This component " - "will occupy approximately %1 on your hard disk drive.")).toString() + m_sizeLabel->setText(ComponentSelectionPage::tr("This component " + "will occupy approximately %1 on your hard disk drive.") .arg(humanReadableSize(component->value(scUncompressedSizeSum).toLongLong()))); } } @@ -1260,7 +1217,7 @@ ComponentSelectionPage::ComponentSelectionPage(PackageManagerCore *core) setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("ComponentSelectionPage")); - setTitle(titleForPage(QLatin1String("ComponentSelectionPage"), tr("Select Components"))); + setTitle(tr("Select Components")); } ComponentSelectionPage::~ComponentSelectionPage() @@ -1282,7 +1239,7 @@ void ComponentSelectionPage::entering() if (core->isInstaller()) index = 1; if (core->isUninstaller()) index = 2; if (core->isPackageManager()) index = 3; - setSubTitle(subTitleForPage(QLatin1String("ComponentSelectionPage"), tr(strings[index]))); + setSubTitle(tr(strings[index])); d->updateTreeView(); setModified(isComplete()); @@ -1353,17 +1310,14 @@ TargetDirectoryPage::TargetDirectoryPage(PackageManagerCore *core) setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("TargetDirectoryPage")); - setSubTitle(subTitleForPage(QLatin1String("TargetDirectoryPage"))); - setTitle(titleForPage(QLatin1String("TargetDirectoryPage"), tr("Installation Folder"))); + setTitle(tr("Installation Folder")); QVBoxLayout *layout = new QVBoxLayout(this); QLabel *msgLabel = new QLabel(this); msgLabel->setWordWrap(true); msgLabel->setObjectName(QLatin1String("MessageLabel")); - const QVariantHash hash = elementsForPage(QLatin1String("TargetDirectoryPage")); - msgLabel->setText(hash.value(QLatin1String("MessageLabel"), tr("Please specify the folder " - "where %1 will be installed.")).toString().arg(productName())); + msgLabel->setText(tr("Please specify the folder where %1 will be installed.").arg(productName())); layout->addWidget(msgLabel); QHBoxLayout *hlayout = new QHBoxLayout; @@ -1377,8 +1331,7 @@ TargetDirectoryPage::TargetDirectoryPage(PackageManagerCore *core) browseButton->setObjectName(QLatin1String("BrowseDirectoryButton")); connect(browseButton, SIGNAL(clicked()), this, SLOT(dirRequested())); browseButton->setShortcut(QKeySequence(tr("Alt+R", "browse file system to choose a file"))); - browseButton->setText(hash.value(QLatin1String("BrowseDirectoryButton"), tr("B&rowse...")) - .toString()); + browseButton->setText(tr("B&rowse...")); hlayout->addWidget(browseButton); layout->addLayout(hlayout); @@ -1412,12 +1365,10 @@ void TargetDirectoryPage::initializePage() bool TargetDirectoryPage::validatePage() { - const QVariantHash hash = elementsForPage(QLatin1String("TargetDirectoryPage")); if (targetDir().isEmpty()) { MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), - QLatin1String("EmptyTargetDirectoryMessage"), tr("Error"), hash - .value(QLatin1String("EmptyTargetDirectoryMessage"), tr("The install directory cannot be " - "empty, please specify a valid folder.")).toString(), QMessageBox::Ok); + QLatin1String("EmptyTargetDirectoryMessage"), tr("Error"), tr("The install directory cannot be " + "empty, please specify a valid folder."), QMessageBox::Ok); return false; } @@ -1430,9 +1381,8 @@ bool TargetDirectoryPage::validatePage() // it exists, but is not empty if (dir == QDir::root()) { MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), - QLatin1String("ForbiddenTargetDirectoryMessage"), tr("Error"), hash - .value(QLatin1String("ForbiddenTargetDirectoryMessage"), tr("As the install directory is " - "completely deleted, installing in %1 is forbidden.")).toString().arg(QDir::rootPath()), + QLatin1String("ForbiddenTargetDirectoryMessage"), tr("Error"), tr("As the install directory " + "is completely deleted on uninstall, installing in %1 is forbidden.").arg(QDir::rootPath()), QMessageBox::Ok); return false; } @@ -1441,11 +1391,10 @@ bool TargetDirectoryPage::validatePage() return true; return MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), - QLatin1String("OverwriteTargetDirectoryMessage"), tr("Warning"), hash - .value(QLatin1String("OverwriteTargetDirectoryMessage"), tr("You have selected an existing, " + QLatin1String("OverwriteTargetDirectoryMessage"), tr("Warning"), tr("You have selected an existing, " "non-empty folder for installation. Note that it will be completely wiped on uninstallation of " "this application. It is not advisable to install into this folder as installation might fail. " - "Do you want to continue?")).toString(), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes; + "Do you want to continue?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes; } return true; } @@ -1465,9 +1414,7 @@ void TargetDirectoryPage::targetDirSelected() void TargetDirectoryPage::dirRequested() { - const QVariantHash hash = elementsForPage(QLatin1String("TargetDirectoryPage")); - const QString newDirName = QFileDialog::getExistingDirectory(this, hash - .value(QLatin1String("SelectInstallationFolderCaption"), tr("Select Installation Folder")).toString(), + const QString newDirName = QFileDialog::getExistingDirectory(this, tr("Select Installation Folder"), targetDir()); if (newDirName.isEmpty() || newDirName == targetDir()) return; @@ -1483,9 +1430,9 @@ StartMenuDirectoryPage::StartMenuDirectoryPage(PackageManagerCore *core) setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("StartMenuDirectoryPage")); - setTitle(titleForPage(QLatin1String("StartMenuDirectoryPage"), tr("Start Menu shortcuts"))); - setSubTitle(subTitleForPage(QLatin1String("StartMenuDirectoryPage"), tr("Select the Start Menu in which " - "you would like to create the program's shortcuts. You can also enter a name to create a new folder."))); + setTitle(tr("Start Menu shortcuts")); + setSubTitle(tr("Select the Start Menu in which you would like to create the program's shortcuts. You can " + "also enter a name to create a new folder.")); m_lineEdit = new QLineEdit(this); m_lineEdit->setObjectName(QLatin1String("LineEdit")); @@ -1573,7 +1520,6 @@ ReadyForInstallationPage::ReadyForInstallationPage(PackageManagerCore *core) setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("ReadyForInstallationPage")); - setSubTitle(subTitleForPage(QLatin1String("ReadyForInstallationPage"))); QVBoxLayout *baseLayout = new QVBoxLayout(); baseLayout->setObjectName(QLatin1String("BaseLayout")); @@ -1621,7 +1567,7 @@ void ReadyForInstallationPage::entering() m_taskDetailsButton->setVisible(false); m_taskDetailsBrowser->setVisible(false); setButtonText(QWizard::CommitButton, tr("U&ninstall")); - setTitle(titleForPage(objectName(), tr("Ready to Uninstall"))); + setTitle(tr("Ready to Uninstall")); m_msgLabel->setText(tr("Setup is now ready to begin removing %1 from your computer.
" "The program directory %2 will be deleted completely, " "including all content in that directory!") @@ -1631,12 +1577,12 @@ void ReadyForInstallationPage::entering() return; } else if (packageManagerCore()->isPackageManager() || packageManagerCore()->isUpdater()) { setButtonText(QWizard::CommitButton, tr("U&pdate")); - setTitle(titleForPage(objectName(), tr("Ready to Update Packages"))); + setTitle(tr("Ready to Update Packages")); m_msgLabel->setText(tr("Setup is now ready to begin updating your installation.")); } else { Q_ASSERT(packageManagerCore()->isInstaller()); setButtonText(QWizard::CommitButton, tr("&Install")); - setTitle(titleForPage(objectName(), tr("Ready to Install"))); + setTitle(tr("Ready to Install")); m_msgLabel->setText(tr("Setup is now ready to begin installing %1 on your computer.") .arg(productName())); } @@ -1803,7 +1749,6 @@ PerformInstallationPage::PerformInstallationPage(PackageManagerCore *core) setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("PerformInstallationPage")); - setSubTitle(subTitleForPage(QLatin1String("PerformInstallationPage"))); m_performInstallationForm->setupUi(this); @@ -1845,17 +1790,17 @@ void PerformInstallationPage::entering() if (packageManagerCore()->isUninstaller()) { setButtonText(QWizard::CommitButton, tr("&Uninstall")); - setTitle(titleForPage(objectName(), tr("Uninstalling %1")).arg(productName())); + setTitle(tr("Uninstalling %1").arg(productName())); QTimer::singleShot(30, packageManagerCore(), SLOT(runUninstaller())); } else if (packageManagerCore()->isPackageManager() || packageManagerCore()->isUpdater()) { setButtonText(QWizard::CommitButton, tr("&Update")); - setTitle(titleForPage(objectName(), tr("Updating components of %1")).arg(productName())); + setTitle(tr("Updating components of %1").arg(productName())); QTimer::singleShot(30, packageManagerCore(), SLOT(runPackageUpdater())); } else { setButtonText(QWizard::CommitButton, tr("&Install")); - setTitle(titleForPage(objectName(), tr("Installing %1")).arg(productName())); + setTitle(tr("Installing %1").arg(productName())); QTimer::singleShot(30, packageManagerCore(), SLOT(runInstaller())); } @@ -1923,20 +1868,16 @@ FinishedPage::FinishedPage(PackageManagerCore *core) { setObjectName(QLatin1String("FinishedPage")); setPixmap(QWizard::WatermarkPixmap, watermarkPixmap()); - setSubTitle(subTitleForPage(QLatin1String("FinishedPage"))); - setTitle(titleForPage(QLatin1String("FinishedPage"), tr("Completing the %1 Wizard")).arg(productName())); + setTitle(tr("Completing the %1 Wizard").arg(productName())); m_msgLabel = new QLabel(this); m_msgLabel->setWordWrap(true); m_msgLabel->setObjectName(QLatin1String("MessageLabel")); - const QVariantHash hash = elementsForPage(QLatin1String("FinishedPage")); #ifdef Q_OS_MAC - m_msgLabel->setText(hash.value(QLatin1String("MessageLabel"), tr("Click Done to exit the %1 " - "Wizard.")).toString().arg(productName())); + m_msgLabel->setText(tr("Click Done to exit the %1 Wizard.").arg(productName())); #else - m_msgLabel->setText(hash.value(QLatin1String("MessageLabel"), tr("Click Finish to exit the " - "%1 Wizard.")).toString().arg(productName())); + m_msgLabel->setText(tr("Click Finish to exit the %1 Wizard.").arg(productName())); #endif m_runItCheckBox = new QCheckBox(this); @@ -2038,9 +1979,7 @@ RestartPage::RestartPage(PackageManagerCore *core) { setObjectName(QLatin1String("RestartPage")); setPixmap(QWizard::WatermarkPixmap, watermarkPixmap()); - setSubTitle(subTitleForPage(QLatin1String("RestartPage"))); - setTitle(titleForPage(QLatin1String("RestartPage"), tr("Completing the %1 Setup Wizard")) - .arg(productName())); + setTitle(tr("Completing the %1 Setup Wizard").arg(productName())); setFinalPage(false); setCommitPage(false); diff --git a/src/libs/installer/packagemanagergui.h b/src/libs/installer/packagemanagergui.h index 5b7bd0615..3cb1071bd 100644 --- a/src/libs/installer/packagemanagergui.h +++ b/src/libs/installer/packagemanagergui.h @@ -168,10 +168,6 @@ public: protected: PackageManagerCore *packageManagerCore() const; - QVariantHash elementsForPage(const QString &pageName) const; - - QString titleForPage(const QString &pageName, const QString &value = QString()) const; - QString subTitleForPage(const QString &pageName, const QString &value = QString()) const; // Inserts widget into the same layout like a sibling identified // by its name. Default position is just behind the sibling. @@ -186,9 +182,6 @@ protected: bool isConstructing() const { return m_fresh; } -private: - QString titleFromHash(const QVariantHash &hash, const QString &value = QString()) const; - private: bool m_fresh; bool m_complete; diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index f08989ff7..36a35fc87 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -54,7 +54,6 @@ static const QLatin1String scIcon("Icon"); static const QLatin1String scInstallerApplicationIcon("InstallerApplicationIcon"); static const QLatin1String scInstallerWindowIcon("InstallerWindowIcon"); static const QLatin1String scLogo("Logo"); -static const QLatin1String scPages("Pages"); static const QLatin1String scPrefix("Prefix"); static const QLatin1String scWatermark("Watermark"); static const QLatin1String scProductUrl("ProductUrl"); @@ -116,40 +115,6 @@ static QSet readRepositories(QXmlStreamReader &reader, bool isDefaul return set; } -static QVariantHash readTitles(QXmlStreamReader &reader) -{ - QVariantHash hash; - while (reader.readNextStartElement()) - hash.insert(reader.name().toString(), reader.readElementText(QXmlStreamReader::SkipChildElements)); - return hash; -} - -static QHash readPages(QXmlStreamReader &reader) -{ - QHash hash; - while (reader.readNextStartElement()) { - if (reader.name() == QLatin1String("Page")) { - QVariantHash pageElements; - const QString pageName = reader.attributes().value(QLatin1String("name")).toString(); - if (pageName.isEmpty()) - reader.raiseError(QLatin1String("Expected non-empty attribute 'name' for element 'Page'.")); - - while (reader.readNextStartElement()) { - const QString name = reader.name().toString(); - if (name == QLatin1String("Title") || name == QLatin1String("SubTitle")) { - pageElements.insert(name, readTitles(reader)); - } else { - pageElements.insert(name, reader.readElementText(QXmlStreamReader::SkipChildElements)); - } - } - hash.insert(pageName, pageElements); - } else { - reader.raiseError(QString::fromLatin1("Unexpected element '%1'.").arg(reader.name().toString())); - } - } - return hash; -} - // -- Settings::Private @@ -223,10 +188,10 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix) << scDependsOnLocalInstallerBinary << scAllowSpaceInPath << scAllowNonAsciiCharacters << scRepositorySettingsPageVisible << scTargetConfigurationFile - << scRemoteRepositories << scPages; + << scRemoteRepositories; QStringList blackList; - blackList << scRemoteRepositories << scPages; + blackList << scRemoteRepositories; Settings s; s.d->m_data.insert(scPrefix, prefix); @@ -245,14 +210,6 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix) if (blackList.contains(name)) { if (name == scRemoteRepositories) s.addDefaultRepositories(readRepositories(reader, true)); - - if (name == scPages) { - qWarning() << "Deprecated element 'Pages'."; - QHash pages = readPages(reader); - const QStringList &keys = pages.keys(); - foreach (const QString &key, keys) - s.d->m_data.insert(key, pages.value(key)); - } } else { if (s.d->m_data.contains(name)) reader.raiseError(QString::fromLatin1("Element '%1' has been defined before.").arg(name)); @@ -552,24 +509,6 @@ QVariantList Settings::values(const QString &key, const QVariantList &defaultVal return list.isEmpty() ? defaultValue : list; } -QVariantHash Settings::titlesForPage(const QString &pageName) const -{ - const QVariantHash hash = d->m_data.value(pageName).toHash(); - const QVariant variant = hash.value(QLatin1String("Title"), QVariant()); - if (!variant.canConvert()) - return QVariantHash(); - return variant.value(); -} - -QVariantHash Settings::subTitlesForPage(const QString &pageName) const -{ - const QVariantHash hash = d->m_data.value(pageName).toHash(); - const QVariant variant = hash.value(QLatin1String("SubTitle"), QVariant()); - if (!variant.canConvert()) - return QVariantHash(); - return variant.value(); -} - bool Settings::repositorySettingsPageVisible() const { return d->m_data.value(scRepositorySettingsPageVisible, true).toBool(); diff --git a/src/libs/installer/settings.h b/src/libs/installer/settings.h index a6893d973..272c4ac07 100644 --- a/src/libs/installer/settings.h +++ b/src/libs/installer/settings.h @@ -133,9 +133,6 @@ public: QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const; QVariantList values(const QString &key, const QVariantList &defaultValue = QVariantList()) const; - QVariantHash titlesForPage(const QString &pageName) const; - QVariantHash subTitlesForPage(const QString &pageName) const; - bool repositorySettingsPageVisible() const; Settings::ProxyType proxyType() const; diff --git a/tests/auto/installer/settings/data/full_config.xml b/tests/auto/installer/settings/data/full_config.xml index 899cb4b7c..36309f609 100644 --- a/tests/auto/installer/settings/data/full_config.xml +++ b/tests/auto/installer/settings/data/full_config.xml @@ -45,126 +45,4 @@ File should contain all elements we allow in a config.xml password - - - - - <Default>Introduction Page Title</Default> - - - Introduction Page Sub Title - - Introduction Page Message Label - - - - <Default>License Agreement Page Title</Default> - - - License Agreement Page Sub Title - - Accept License Radio Button - Reject License Radio Button - - - - <Default>Component Selection Page Title</Default> - <Updater>Component Selection Page Sub Title Updater</Updater> - <Installer>Component Selection Page Sub Title Installer</Installer> - <Uninstaller>Component Selection Page Sub Title Uninstaller</Uninstaller> - <PackageManager>Component Selection Page Sub Title Package Manager</PackageManager> - - - Component Selection Page Sub Title - Component Selection Page Sub Title Updater - Component Selection Page Sub Title Installer - Component Selection Page Sub Title Uninstaller - Component Selection Page Sub Title Package Manager - - Default Button - Select All Button - Deselect All Button - Component Size Label - - - - <Default>Target Directory Page Title</Default> - - - Target Directory Page Sub Title - - Target Directory Page Message Label - Browse Directory Button - Empty Target Directory Message - Forbidden Target Directory Message - Overwrite Target Directory Message - Select Installation Folder Caption - - - - <Default>Start Menu Directory Page Title</Default> - - - Start Menu Directory Page Sub Title - - - - - <Default>Ready for Installation Page Title</Default> - <Updater>Ready for Installation Page Title Updater</Updater> - <Installer>Ready for Installation Page Title Installer</Installer> - <Uninstaller>Ready for Installation Page Title Uninstaller</Uninstaller> - <PackageManager>Ready for Installation Page Title Package Manager</PackageManager> - - - Ready for Installation Page Sub Title - Ready for Installation Page Sub Title Updater - Ready for Installation Page Sub Title Installer - Ready for Installation Page Sub Title Uninstaller - Ready for Installation Page Sub Title Package Manager - - Ready for Installation Page Message Label - - - - <Default>Perform Installation Page Title</Default> - <Updater>Perform Installation Page Title Updater</Updater> - <Installer>Perform Installation Page Title Installer</Installer> - <Uninstaller>Perform Installation Page Title Uninstaller</Uninstaller> - <PackageManager>Perform Installation Page Title Package Manager</PackageManager> - - - Perform Installation Page Sub Title - Perform Installation Page Sub Title Updater - Perform Installation Page Sub Title Installer - Perform Installation Page Sub Title Uninstaller - Perform Installation Page Sub Title Package Manager - - - - - <Default>Finished Page Title</Default> - <Updater>Finished Page Title Updater</Updater> - <Installer>Finished Page Title Installer</Installer> - <Uninstaller>Finished Page Title Uninstaller</Uninstaller> - <PackageManager>Finished Page Title Package Manager</PackageManager> - - - Finished Page Sub Title - Finished Page Sub Title Updater - Finished Page Sub Title Installer - Finished Page Sub Title Uninstaller - Finished Page Sub Title Package Manager - - Finished Page Message Label - - - - <Default>Restart Page Title</Default> - - - Restart Page Sub Title - - - diff --git a/tests/auto/installer/settings/tst_settings.cpp b/tests/auto/installer/settings/tst_settings.cpp index 0accbc4e8..5d4cbd9b3 100644 --- a/tests/auto/installer/settings/tst_settings.cpp +++ b/tests/auto/installer/settings/tst_settings.cpp @@ -78,7 +78,6 @@ void tst_Settings::loadTutorialConfig() void tst_Settings::loadFullConfig() { - QTest::ignoreMessage(QtWarningMsg, "Deprecated element 'Pages'. "); QTest::ignoreMessage(QtWarningMsg, "Deprecated element 'Icon'. "); Settings settings = Settings::fromFileAndPrefix(":///data/full_config.xml", ":///data"); -- cgit v1.2.3