summaryrefslogtreecommitdiffstats
path: root/installerbuilder/installerbase/installerbase.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2011-11-15 12:37:01 +0100
committerKarsten Heimrich <karsten.heimrich@nokia.com>2011-11-15 14:54:00 +0100
commitd48cb97ba1b1179ce314d6ab190a7379f802465a (patch)
tree21ed68e872ef7f1eef8fad1d276786af8ac50348 /installerbuilder/installerbase/installerbase.cpp
parent2023eb987e50bdf751c444c3a86e36aad72efc5d (diff)
Use QSet throughout the whole code, saves us QList conversions.
Remove default parameter from Repo ctor, lead already to confusion. Also add some more specific {get/set} repo functions, to be able to distinguish between the different kind of repositories (needed for setting dialog). Change-Id: I2c1e4d5377799f54e408a89785bdc5f01619f846 Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com> Reviewed-by: Alexander Lenhardt <alexander.lenhardt@nokia.com>
Diffstat (limited to 'installerbuilder/installerbase/installerbase.cpp')
-rw-r--r--installerbuilder/installerbase/installerbase.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/installerbuilder/installerbase/installerbase.cpp b/installerbuilder/installerbase/installerbase.cpp
index f8473021f..ffe739ffe 100644
--- a/installerbuilder/installerbase/installerbase.cpp
+++ b/installerbuilder/installerbase/installerbase.cpp
@@ -65,20 +65,19 @@
using namespace QInstaller;
using namespace QInstallerCreator;
-static QList<Repository> repositories(const QStringList &arguments, const int index)
+static QSet<Repository> repositories(const QStringList &arguments, const int index)
{
- QList<Repository> repoList;
+ QSet<Repository> set;
if (index < arguments.size()) {
QStringList items = arguments.at(index).split(QLatin1Char(','));
foreach (const QString &item, items) {
+ set.insert(Repository(item, false));
verbose() << "Adding custom repository:" << item << std::endl;
- Repository rep(item);
- repoList.append(rep);
}
} else {
std::cerr << "No repository specified" << std::endl;
}
- return repoList;
+ return set;
}
int main(int argc, char *argv[])
@@ -255,7 +254,7 @@ int main(int argc, char *argv[])
} else if (argument == QLatin1String("--addTempRepository")
|| argument == QLatin1String("--setTempRepository")) {
++i;
- QList<Repository> repoList = repositories(args, i);
+ QSet<Repository> repoList = repositories(args, i);
if (repoList.isEmpty())
return PackageManagerCore::Failure;
@@ -265,10 +264,10 @@ int main(int argc, char *argv[])
core.setTemporaryRepositories(repoList, replace);
} else if (argument == QLatin1String("--addRepository")) {
++i;
- QList<Repository> repoList = repositories(args, i);
+ QSet<Repository> repoList = repositories(args, i);
if (repoList.isEmpty())
return PackageManagerCore::Failure;
- core.addRepositories(repoList);
+ core.addUserRepositories(repoList);
} else if (argument == QLatin1String("--no-force-installations")) {
PackageManagerCore::setNoForceInstallation(true);
} else {