mirror of
https://github.com/QuasarApp/installer-framework.git
synced 2025-04-28 22:44:32 +00:00
Add property to disable default repository saving
By default, all default repositories defined in <RemoteRepositories> are saved to maintenancetool.ini -file. When you start maintenancetool, the repositories are read from maintenancetool.ini and those are used. There are cases when we don't want to use the default repositories when running maintenancetol. Change-Id: I4507e16636f2d709aa099eaa865264800591ce0d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
This commit is contained in:
parent
98e180cda5
commit
6c38a975ee
@ -324,6 +324,11 @@
|
||||
\row
|
||||
\li SupportsModify
|
||||
\li Set to \c false if the product does not support modifying an existing installation.
|
||||
\row
|
||||
\li SaveDefaultRepositories
|
||||
\li Set to \c false if default repositories \c <RemoteRepositories> should not be saved to \e {MaintenanceToolName}.ini.
|
||||
By default default repositories are saved. Not saving the repositories means than when you run \e maintenancetool
|
||||
there are no default repositories in use.
|
||||
|
||||
\endtable
|
||||
|
||||
|
@ -90,6 +90,7 @@ static const QLatin1String scProductUUID("ProductUUID");
|
||||
static const QLatin1String scAllUsers("AllUsers");
|
||||
static const QLatin1String scSupportsModify("SupportsModify");
|
||||
static const QLatin1String scAllowUnstableComponents("AllowUnstableComponents");
|
||||
static const QLatin1String scSaveDefaultRepositories("SaveDefaultRepositories");
|
||||
|
||||
const char scRelocatable[] = "@RELOCATABLE_PATH@";
|
||||
|
||||
|
@ -761,8 +761,10 @@ void PackageManagerCorePrivate::writeMaintenanceConfigFiles()
|
||||
cfg.setValue(QLatin1String("Variables"), variables);
|
||||
|
||||
QVariantList repos; // Do not change either!
|
||||
foreach (const Repository &repo, m_data.settings().defaultRepositories())
|
||||
repos.append(QVariant().fromValue(repo));
|
||||
if (m_data.settings().saveDefaultRepositories()) {
|
||||
foreach (const Repository &repo, m_data.settings().defaultRepositories())
|
||||
repos.append(QVariant().fromValue(repo));
|
||||
}
|
||||
cfg.setValue(QLatin1String("DefaultRepositories"), repos);
|
||||
cfg.setValue(QLatin1String("FilesForDelayedDeletion"), m_filesForDelayedDeletion);
|
||||
|
||||
|
@ -256,7 +256,8 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix,
|
||||
<< scWizardDefaultWidth << scWizardDefaultHeight
|
||||
<< scRepositorySettingsPageVisible << scTargetConfigurationFile
|
||||
<< scRemoteRepositories << scTranslations << scUrlQueryString << QLatin1String(scControlScript)
|
||||
<< scCreateLocalRepository << scInstallActionColumnVisible << scSupportsModify << scAllowUnstableComponents;
|
||||
<< scCreateLocalRepository << scInstallActionColumnVisible << scSupportsModify << scAllowUnstableComponents
|
||||
<< scSaveDefaultRepositories;
|
||||
|
||||
Settings s;
|
||||
s.d->m_data.insert(scPrefix, prefix);
|
||||
@ -327,6 +328,8 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix,
|
||||
s.d->m_data.insert(scInstallActionColumnVisible, false);
|
||||
if (!s.d->m_data.contains(scAllowUnstableComponents))
|
||||
s.d->m_data.insert(scAllowUnstableComponents, false);
|
||||
if (!s.d->m_data.contains(scSaveDefaultRepositories))
|
||||
s.d->m_data.insert(scSaveDefaultRepositories, true);
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -754,3 +757,13 @@ void Settings::setAllowUnstableComponents(bool allow)
|
||||
{
|
||||
d->m_data.insert(scAllowUnstableComponents, allow);
|
||||
}
|
||||
|
||||
bool Settings::saveDefaultRepositories() const
|
||||
{
|
||||
return d->m_data.value(scSaveDefaultRepositories, true).toBool();
|
||||
}
|
||||
|
||||
void Settings::setSaveDefaultRepositories(bool save)
|
||||
{
|
||||
d->m_data.insert(scSaveDefaultRepositories, save);
|
||||
}
|
||||
|
@ -157,6 +157,9 @@ public:
|
||||
bool allowUnstableComponents() const;
|
||||
void setAllowUnstableComponents(bool allow);
|
||||
|
||||
bool saveDefaultRepositories() const;
|
||||
void setSaveDefaultRepositories(bool save);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
QSharedDataPointer<Private> d;
|
||||
|
Loading…
x
Reference in New Issue
Block a user