summaryrefslogtreecommitdiffstats
path: root/installerbuilder
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2011-03-21 13:28:55 +0100
committerkh1 <qt-info@nokia.com>2011-03-21 13:28:55 +0100
commitadcd83be6004c67e9d963114860851b38d309fcd (patch)
tree60cdade10399385a705cfaf24e81c6bd91a36c5e /installerbuilder
parentc562a326a175afbde3c148e8f8c15cd21978f83c (diff)
Use the already existing ctor to load data.
Diffstat (limited to 'installerbuilder')
-rw-r--r--installerbuilder/libinstaller/qinstaller.cpp30
-rw-r--r--installerbuilder/libinstaller/qinstallercomponent.cpp12
-rw-r--r--installerbuilder/libinstaller/qinstallercomponent.h5
3 files changed, 20 insertions, 27 deletions
diff --git a/installerbuilder/libinstaller/qinstaller.cpp b/installerbuilder/libinstaller/qinstaller.cpp
index c528eaa1a..72fc9e22b 100644
--- a/installerbuilder/libinstaller/qinstaller.cpp
+++ b/installerbuilder/libinstaller/qinstaller.cpp
@@ -790,13 +790,6 @@ bool Installer::fetchAllPackages()
}
QScopedPointer<QInstaller::Component> component(new QInstaller::Component(this));
- component->loadDataFromUpdate(package);
-
- const QString localPath = QInstaller::pathFromUrl(package->sourceInfo().url);
- static QString lastLocalPath;
- if (lastLocalPath != localPath)
- verbose() << "Url is : " << localPath << std::endl;
- lastLocalPath = localPath;
QString state = QLatin1String("Uninstalled");
if (installedPackages.contains(name)) {
@@ -806,6 +799,14 @@ bool Installer::fetchAllPackages()
}
component->setValue(QLatin1String("CurrentState"), state);
component->setValue(QLatin1String("PreviousState"), state);
+
+ const QString &localPath = component->localTempPath();
+ if (isVerbose()) {
+ static QString lastLocalPath;
+ if (lastLocalPath != localPath)
+ verbose() << "Url is : " << localPath << std::endl;
+ lastLocalPath = localPath;
+ }
component->setRepositoryUrl(metaInfoJob->repositoryForTemporaryDirectory(localPath).url());
components.insert(name, component.take());
@@ -911,17 +912,18 @@ bool Installer::fetchUpdaterPackages()
continue;
QScopedPointer<QInstaller::Component> component(new QInstaller::Component(update, this));
- component->loadDataFromUpdate(update);
-
- const QString localPath = QInstaller::pathFromUrl(update->sourceInfo().url);
- static QString lastLocalPath;
- if (lastLocalPath != localPath)
- verbose() << "Url is : " << localPath << std::endl;
- lastLocalPath = localPath;
component->setValue(QLatin1String("InstalledVersion"), info.version);
component->setValue(QLatin1String("CurrentState"), QLatin1String("Installed"));
component->setValue(QLatin1String("PreviousState"), QLatin1String("Installed"));
+
+ const QString &localPath = component->localTempPath();
+ if (isVerbose()) {
+ static QString lastLocalPath;
+ if (lastLocalPath != localPath)
+ verbose() << "Url is : " << localPath << std::endl;
+ lastLocalPath = localPath;
+ }
component->setRepositoryUrl(metaInfoJob->repositoryForTemporaryDirectory(localPath).url());
components.insert(name, component.take());
diff --git a/installerbuilder/libinstaller/qinstallercomponent.cpp b/installerbuilder/libinstaller/qinstallercomponent.cpp
index c90db8cd7..2e0c53834 100644
--- a/installerbuilder/libinstaller/qinstallercomponent.cpp
+++ b/installerbuilder/libinstaller/qinstallercomponent.cpp
@@ -235,17 +235,9 @@ Component::Component(KDUpdater::Update* update, Installer* installer)
: d(new Private(installer, this))
{
Q_ASSERT(update);
+
d->init();
- setValue(skName, update->data(skName).toString());
- setValue(skDisplayName, update->data(skDisplayName).toString());
- setValue(skDescription, update->data(skDescription).toString());
- setValue(skUncompressedSize, QString::number(update->uncompressedSize()));
- setValue(skVersion, update->data(skVersion).toString());
- setValue(skDependencies, update->data(skDependencies).toString());
- setValue(skVirtual, update->data(skVirtual).toString());
- setValue(skSortingPriority, update->data(skSortingPriority).toString());
- setValue(skInstallPriority, update->data(skInstallPriority).toString());
- setValue(skAutoSelectOn, update->data(skAutoSelectOn).toString());
+ loadDataFromUpdate(update);
}
/*!
diff --git a/installerbuilder/libinstaller/qinstallercomponent.h b/installerbuilder/libinstaller/qinstallercomponent.h
index 60315af46..78359f9f2 100644
--- a/installerbuilder/libinstaller/qinstallercomponent.h
+++ b/installerbuilder/libinstaller/qinstallercomponent.h
@@ -173,9 +173,11 @@ public:
bool removeBeforeUpdate() const;
void setRemoveBeforeUpdate(bool removeBeforeUpdate);
+ QString localTempPath() const;
Q_INVOKABLE bool isFromOnlineRepository() const;
QStringList dependencies() const;
+ QList<Component*> dependees() const;
bool autoCreateOperations() const;
bool isSelected(RunModes runMode = AllMode) const;
@@ -193,8 +195,6 @@ public:
void languageChanged();
- QList<Component*> dependees() const;
-
public Q_SLOTS:
void setAutoCreateOperations(bool autoCreateOperations);
void setSelected(bool selected, RunModes runMode = AllMode, SelectMode selectMode = NormalSelectMode);
@@ -209,7 +209,6 @@ protected:
const QScriptValueList &parameters = QScriptValueList());
private:
- QString localTempPath() const;
void setLocalTempPath(const QString &tempPath);
KDUpdater::UpdateOperation *createOperation(const QString &operation,