diff options
author | kh1 <qt-info@nokia.com> | 2011-05-09 14:07:01 +0200 |
---|---|---|
committer | kh1 <qt-info@nokia.com> | 2011-05-09 14:07:01 +0200 |
commit | 9cdc4b7db42bb097e486d1e57d969b80bc866b71 (patch) | |
tree | bb5fb89846bcaf010ff0f595e6785ac396a45b69 | |
parent | 8fdcd81bc1bb987f0d3065e2e38883709ace2a80 (diff) |
Repositories are always "required" now.
-rw-r--r-- | installerbuilder/common/installersettings.cpp | 2 | ||||
-rw-r--r-- | installerbuilder/common/repository.cpp | 20 | ||||
-rw-r--r-- | installerbuilder/common/repository.h | 4 | ||||
-rw-r--r-- | installerbuilder/installerbase/installerbase.cpp | 4 | ||||
-rw-r--r-- | installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp | 8 | ||||
-rw-r--r-- | installerbuilder/libinstaller/getrepositorymetainfojob.cpp | 15 | ||||
-rw-r--r-- | installerbuilder/libinstaller/updatesettings.cpp | 2 |
7 files changed, 2 insertions, 53 deletions
diff --git a/installerbuilder/common/installersettings.cpp b/installerbuilder/common/installersettings.cpp index fe6d43b46..8a052f918 100644 --- a/installerbuilder/common/installersettings.cpp +++ b/installerbuilder/common/installersettings.cpp @@ -206,8 +206,6 @@ InstallerSettings InstallerSettings::fromFileAndPrefix(const QString &path, cons for (int j = 0; j < children.size(); ++j) { if (children.at(j).toElement().tagName() == QLatin1String("Url")) r.setUrl(children.at(j).toElement().text()); - if (children.at(j).toElement().tagName() == QLatin1String("Required")) - r.setRequired(children.at(j).toElement().text() == QLatin1String("true")); } s.d->repositories.append(r); } diff --git a/installerbuilder/common/repository.cpp b/installerbuilder/common/repository.cpp index 38c4ed646..d74763f80 100644 --- a/installerbuilder/common/repository.cpp +++ b/installerbuilder/common/repository.cpp @@ -38,7 +38,6 @@ namespace QInstaller { Constructs an invalid Repository object. */ Repository::Repository() - : m_required(false) { } @@ -47,7 +46,6 @@ Repository::Repository() */ Repository::Repository(const QUrl &url) : m_url(url) - , m_required(false) { } @@ -78,22 +76,4 @@ void Repository::setUrl(const QUrl& url) m_url = url; } -/*! - Returns whether the repository is required for installation. If a required repository cannot be - reached or an error occurrs accessing it, the installer will fail. -*/ -bool Repository::required() const -{ - return m_required; -} - -/*! - Sets whether the repository is required for installation. If a required repository cannot be - reached or an error occurrs accessing it, the installer will fail. -*/ -void Repository::setRequired(bool required) -{ - m_required = required; -} - } diff --git a/installerbuilder/common/repository.h b/installerbuilder/common/repository.h index badaed5c9..674abbed2 100644 --- a/installerbuilder/common/repository.h +++ b/installerbuilder/common/repository.h @@ -43,12 +43,8 @@ public: QUrl url() const; void setUrl(const QUrl& url); - bool required() const; - void setRequired(bool required); - private: QUrl m_url; - bool m_required; }; } // namespace QInstaller diff --git a/installerbuilder/installerbase/installerbase.cpp b/installerbuilder/installerbase/installerbase.cpp index d8231e9b0..2eb673616 100644 --- a/installerbuilder/installerbase/installerbase.cpp +++ b/installerbuilder/installerbase/installerbase.cpp @@ -258,9 +258,7 @@ int main(int argc, char *argv[]) QStringList items = args.at(i).split(QLatin1Char(',')); foreach(const QString &item, items) { verbose() << "Adding custom repository:" << item << std::endl; - Repository rep; - rep.setUrl(item); - rep.setRequired(true); + Repository rep(item); repoList.append(rep); } diff --git a/installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp b/installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp index 52d4055f0..383c2af44 100644 --- a/installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp +++ b/installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp @@ -168,13 +168,7 @@ void GetRepositoriesMetaInfoJob::jobFinished(KDJob* j) return; } - if (job->error() != KDJob::NoError && job->repository().required()) { - emitFinishedWithError(KDJob::UserDefinedError, tr("Error while accessing online " - "repository: %1").arg(job->errorString())); - return; - } - - const QString tmpdir = job->releaseTemporaryDirectory(); + const QString &tmpdir = job->releaseTemporaryDirectory(); job->m_tempDirDeleter.passAndRelease(m_tempDirDeleter, tmpdir); m_repositoryByTemporaryDirectory.insert(tmpdir, job->repository()); diff --git a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp index 56bce2f8e..a1cee0221 100644 --- a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp +++ b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp @@ -197,11 +197,6 @@ void GetRepositoryMetaInfoJob::updatesXmlDownloadFinished() .arg(m_repository.url().toString(), err); verbose() << msg << std::endl; - if (!m_repository.required()) { - emitFinishedWithError(QInstaller::UserIgnoreError, msg); - return; - } - const QMessageBox::StandardButton b = MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), QLatin1String("updatesXmlDownloadError"), tr("Download Error"), msg, QMessageBox::Cancel); @@ -251,11 +246,6 @@ void GetRepositoryMetaInfoJob::updatesXmlDownloadError(const QString &err) .arg(m_repository.url().toString(), err); verbose() << msg << std::endl; - if (!m_repository.required()) { - emitFinishedWithError(QInstaller::UserIgnoreError, msg); - return; - } - QMessageBox::StandardButtons buttons = QMessageBox::Retry | QMessageBox::Cancel; const QMessageBox::StandardButton b = MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), @@ -395,11 +385,6 @@ void GetRepositoryMetaInfoJob::metaDownloadError(const QString &err) .arg(m_currentPackageName, err); verbose() << msg << std::endl; - if (!m_repository.required()) { - emitFinishedWithError(QInstaller::UserIgnoreError, msg); - return; - } - QMessageBox::StandardButtons buttons = QMessageBox::Retry | QMessageBox::Cancel; const QMessageBox::StandardButton b = MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), diff --git a/installerbuilder/libinstaller/updatesettings.cpp b/installerbuilder/libinstaller/updatesettings.cpp index a8045a471..ac690f8f1 100644 --- a/installerbuilder/libinstaller/updatesettings.cpp +++ b/installerbuilder/libinstaller/updatesettings.cpp @@ -137,7 +137,6 @@ QList< Repository > UpdateSettings::repositories() const Repository rep; settings.setArrayIndex( i ); rep.setUrl( d->settings().value( QLatin1String( "url" ) ).toUrl() ); - rep.setRequired( d->settings().value( QLatin1String( "required" ) ).toBool() ); result.push_back( rep ); } settings.endArray(); @@ -164,7 +163,6 @@ void UpdateSettings::setRepositories( const QList< Repository >& repositories ) const Repository& rep = repositories[ i ]; d->settings().setArrayIndex( i ); d->settings().setValue( QLatin1String( "url" ), rep.url() ); - d->settings().setValue( QLatin1String( "required" ), rep.required() ); } d->settings().endArray(); } |