From a25620f52693e086b54c09518d4b7a0cab412da1 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 25 Sep 2013 11:56:39 +0200 Subject: move creating the temp remoterepo dir - in case we are getting a new repository it gets a reset which starts from the beginning. So it is better to create that at the end. Change-Id: I6613ce899fd695e6df8825290a7d945a67d61168 Reviewed-by: Karsten Heimrich --- src/libs/installer/getrepositorymetainfojob.cpp | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/libs/installer/getrepositorymetainfojob.cpp b/src/libs/installer/getrepositorymetainfojob.cpp index c0fca0b13..2fd167a4a 100644 --- a/src/libs/installer/getrepositorymetainfojob.cpp +++ b/src/libs/installer/getrepositorymetainfojob.cpp @@ -244,20 +244,7 @@ void GetRepositoryMetaInfoJob::updatesXmlDownloadFinished() Q_ASSERT(!fn.isEmpty()); Q_ASSERT(QFile::exists(fn)); - try { - m_temporaryDirectory = createTemporaryDirectory(QLatin1String("remoterepo-")); - m_tempDirDeleter.add(m_temporaryDirectory); - } catch (const QInstaller::Error& e) { - finished(QInstaller::ExtractionError, e.message()); - return; - } - QFile updatesFile(fn); - if (!updatesFile.rename(m_temporaryDirectory + QLatin1String("/Updates.xml"))) { - finished(QInstaller::DownloadError, tr("Could not move Updates.xml to target location. Error: %1") - .arg(updatesFile.errorString())); - return; - } if (!updatesFile.open(QIODevice::ReadOnly)) { finished(QInstaller::DownloadError, tr("Could not open Updates.xml for reading. Error: %1") @@ -358,6 +345,19 @@ void GetRepositoryMetaInfoJob::updatesXmlDownloadFinished() } } + try { + m_temporaryDirectory = createTemporaryDirectory(QLatin1String("remoterepo-")); + m_tempDirDeleter.add(m_temporaryDirectory); + } catch (const QInstaller::Error& e) { + finished(QInstaller::ExtractionError, e.message()); + return; + } + if (!updatesFile.rename(m_temporaryDirectory + QLatin1String("/Updates.xml"))) { + finished(QInstaller::DownloadError, tr("Could not move Updates.xml to target location. Error: %1") + .arg(updatesFile.errorString())); + return; + } + setTotalAmount(m_packageNames.count() + 1); setProcessedAmount(1); emit infoMessage(this, tr("Finished updating component meta information.")); -- cgit v1.2.3