diff options
author | kh1 <qt-info@nokia.com> | 2011-03-03 16:03:57 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-03-03 17:46:00 +0100 |
commit | 1bfafc0f2c8ed03b22a0a1b5441d7bd0baa3eb1a (patch) | |
tree | 2f0a3f7562176d671e2665e0367d4a07553f7b5b /installerbuilder/installerbase/installerbase.cpp | |
parent | e5a9ff82c3696122189bf4e1c53439090a06f9ea (diff) |
Some more work to have the a proper wizard updater intergration.
Introduce some magic marker to differentiate between update and
package management modus. The base installer now needs explicite
arguments passed to make the app an updater or package manager.
Adjustment some more classes to take the new markers into account.
Diffstat (limited to 'installerbuilder/installerbase/installerbase.cpp')
-rw-r--r-- | installerbuilder/installerbase/installerbase.cpp | 75 |
1 files changed, 19 insertions, 56 deletions
diff --git a/installerbuilder/installerbase/installerbase.cpp b/installerbuilder/installerbase/installerbase.cpp index f6f92f0cc..98657500c 100644 --- a/installerbuilder/installerbase/installerbase.cpp +++ b/installerbuilder/installerbase/installerbase.cpp @@ -30,73 +30,37 @@ ** (qt-info@nokia.com). ** **************************************************************************/ - -// This file contains the base part of the installer. -// It lists the files and features the installer should handle. - #include "qinstaller.h" -#include "qinstallercomponentmodel.h" -#include "qinstallercomponent.h" -#include "qinstallergui.h" -#include "qinstallerglobal.h" -#include "init.h" -#include "lib7z_facade.h" -#include "common/installersettings.h" + +#include "common/binaryformat.h" +#include "common/errors.h" #include "common/fileutils.h" +#include "common/installersettings.h" #include "common/utils.h" #include "fsengineserver.h" +#include "init.h" +#include "installerbasecommons.h" +#include "lib7z_facade.h" +#include "qinstallercomponentmodel.h" +#include "qinstallerglobal.h" +#include "qinstallergui.h" +#include "tabcontroller.h" #include "updater.h" -#include <QtCore/QBuffer> -#include <QtCore/QDir> -#include <QtCore/QDirIterator> -#include <QtCore/QFileInfo> -#include <QtCore/QResource> -#include <QtCore/QObject> -#include <QtCore/QSharedPointer> -#include <QtCore/QTimer> #include <QtCore/QTranslator> -#include <QtCore/QUrl> -#include <QtCore/QPointer> -#include <QtCore/QSettings> #include <QtCore/QThread> #include <QtGui/QApplication> -#include <QtGui/QTabWidget> -#include <QtGui/QLabel> -#include <QtGui/QMessageBox> -#include <QtGui/QVBoxLayout> #include <QtNetwork/QNetworkProxyFactory> -#include <KDToolsCore/KDSelfRestarter> -#include <KDToolsCore/KDRunOnceChecker> - #include <KDUpdater/Application> -#include <KDUpdater/UpdateSourcesInfo> #include <KDUpdater/PackagesInfo> -#include <KDUpdater/Update> -#include <KDUpdater/UpdateFinder> -#include <KDUpdater/UpdateOperationFactory> - -#include <KDUpdater/UpdateOperation> - -// QInstallerGui is base of the Gui part of an installer, i.e. -// the "main installer wizard". In the simplest case it's just -// a sequence of "standard" wizard pages. A few commonly used -// ones are provided already in qinstallergui.h. -#include "common/binaryformat.h" -#include "common/binaryformatenginehandler.h" -#include "common/errors.h" -#include "common/range.h" +#include <KDToolsCore/KDSelfRestarter> +#include <KDToolsCore/KDRunOnceChecker> #include <iostream> -#include <memory> - -#include "installerbasecommons.h" -#include "maintabwidget.h" -#include "tabcontroller.h" using namespace QInstaller; using namespace QInstallerCreator; @@ -249,7 +213,6 @@ int main(int argc, char *argv[]) const QString productName = installer.value(QLatin1String("ProductName")); QString controlScript; - bool isUpdater = false; QHash<QString, QString> params; for (int i = 1; i < args.size(); ++i) { const QString &argument = args.at(i); @@ -280,11 +243,12 @@ int main(int argc, char *argv[]) QFont f; f.setItalic(true); QInstaller::ComponentModel::setVirtualComponentsFont(f); - } else if (argument == QLatin1String("--manage-packages") - || argument == QLatin1String("ManagePackages")) { + } else if ((argument == QLatin1String("--updater") + || argument == QLatin1String("Updater")) && installer.isUninstaller()) { + installer.setUpdater(); + } else if ((argument == QLatin1String("--manage-packages") + || argument == QLatin1String("ManagePackages")) && installer.isUninstaller()) { installer.setPackageManager(); - } else if (argument == QLatin1String("--updater") || argument == QLatin1String("Updater")) { - isUpdater = true && !installer.isInstaller(); } else if (argument == QLatin1String("--help") || argument == QLatin1String("-h")) { return INST_SUCCESS; } else if (argument == QLatin1String("--addTempRepository") @@ -344,11 +308,10 @@ int main(int argc, char *argv[]) if (installer.isInstaller()) { controller.setInstallerGui(new QtInstallerGui(&installer)); } else { - controller.setTabWidget(new MainTabWidget()); controller.setInstallerGui(new QtUninstallerGui(&installer)); } - int val = isUpdater ? controller.initUpdater() : controller.initPackageManager(); + int val = controller.init(); if (val != TabController::SUCCESS) return val; |