From 7f75020e00a2e3189020e9efd2e1279263792107 Mon Sep 17 00:00:00 2001 From: kh1 Date: Fri, 1 Jul 2011 12:09:32 +0200 Subject: Keep the updater application as class member. I can't see any reason to be able to set it from the outside, thus it makes no sense to have that functionality at all. To be able to work properly the app had to be set, but could be easily forgotten, leading to a crash later on. Re-parsing should be removed as well, will do it next. --- examples/testapp/mainwindow.cpp | 8 ++------ examples/testapp/mainwindow.h | 3 --- examples/testapp/updateagent.cpp | 4 ---- 3 files changed, 2 insertions(+), 13 deletions(-) (limited to 'examples/testapp') diff --git a/examples/testapp/mainwindow.cpp b/examples/testapp/mainwindow.cpp index 0bb387edb..579d7dec5 100644 --- a/examples/testapp/mainwindow.cpp +++ b/examples/testapp/mainwindow.cpp @@ -56,7 +56,6 @@ MainWindow::MainWindow(const QStringList &args, QWidget *parent) , m_dialog(new UpdateSettingsDialog(this)) { m_core.setUpdater(); - m_core.setUpdaterApplication(&updaterapp); QMenu *fm = menuBar()->addMenu(QObject::tr("File")); fm->addAction(QObject::tr("Check for Updates"), this, SLOT(checkForUpdates()), @@ -72,9 +71,6 @@ MainWindow::MainWindow(const QStringList &args, QWidget *parent) label->setText(QString::fromLatin1("Version: %1\n").arg(m_core.settings().applicationVersion()) + args.join(QLatin1String(" "))); - updaterapp.packagesInfo()->setApplicationName(m_settings.applicationName()); - updaterapp.packagesInfo()->setApplicationVersion(m_settings.applicationVersion()); - UpdateAgent *const agent = new UpdateAgent(this); connect(agent, SIGNAL(updatesAvailable()), this, SLOT(updatesAvailable())); } @@ -108,8 +104,8 @@ void MainWindow::checkForUpdates() return; } - // set the target directory to the actual one - m_core.setValue(scTargetDir, QFileInfo(updaterapp.packagesInfo()->fileName()).absolutePath()); + // TODO: fix this, set the target directory to the actual one + // m_core.setValue(scTargetDir, QFileInfo(updaterapp.packagesInfo()->fileName()).absolutePath()); // this will automatically mark components as to get installed ComponentSelectionDialog componentSelection(&m_core, this); diff --git a/examples/testapp/mainwindow.h b/examples/testapp/mainwindow.h index 862b5bf0d..301954d5a 100644 --- a/examples/testapp/mainwindow.h +++ b/examples/testapp/mainwindow.h @@ -27,8 +27,6 @@ #include #include -#include - #include class UpdateSettingsDialog; @@ -50,6 +48,5 @@ private: UpdateSettingsDialog *m_dialog; QInstaller::Settings m_settings; - KDUpdater::Application updaterapp; QInstaller::PackageManagerCore m_core; }; diff --git a/examples/testapp/updateagent.cpp b/examples/testapp/updateagent.cpp index 8b35aa1af..73db16e98 100644 --- a/examples/testapp/updateagent.cpp +++ b/examples/testapp/updateagent.cpp @@ -42,8 +42,6 @@ #include #include -#include - using namespace QInstaller; using QInstallerCreator::ComponentIndex; using QInstallerCreator::BinaryFormatEngineHandler; @@ -78,9 +76,7 @@ public: handler.reset(new BinaryFormatEngineHandler(ComponentIndex())); handler->setComponentIndex(QInstallerCreator::ComponentIndex()); - KDUpdater::Application app; PackageManagerCore core(QInstaller::MagicUpdaterMarker); - core.setUpdaterApplication(&app); core.setTemporaryRepositories(settings.repositories()); if (!core.fetchUpdaterPackages()) throw Error(tr("Software Update failed.")); -- cgit v1.2.3