diff options
Diffstat (limited to 'src/libs/installer')
-rw-r--r-- | src/libs/installer/commandlineparser.cpp | 6 | ||||
-rw-r--r-- | src/libs/installer/constants.h | 6 | ||||
-rw-r--r-- | src/libs/installer/packagemanagercore.cpp | 16 | ||||
-rw-r--r-- | src/libs/installer/packagemanagercore.h | 1 |
4 files changed, 26 insertions, 3 deletions
diff --git a/src/libs/installer/commandlineparser.cpp b/src/libs/installer/commandlineparser.cpp index c82dde944..8c0fb1ee7 100644 --- a/src/libs/installer/commandlineparser.cpp +++ b/src/libs/installer/commandlineparser.cpp @@ -53,8 +53,10 @@ CommandLineParser::CommandLineParser() .arg(CommandLineOptions::scRemoveShort, CommandLineOptions::scRemoveLong) + QString::fromLatin1("\t%1, %2 - list currently installed packages\n") .arg(CommandLineOptions::scListShort, CommandLineOptions::scListLong) - + QString::fromLatin1("\t%1, %2 - search available packages - <regexp>") - .arg(CommandLineOptions::scSearchShort, CommandLineOptions::scSearchLong); + + QString::fromLatin1("\t%1, %2 - search available packages - <regexp>\n") + .arg(CommandLineOptions::scSearchShort, CommandLineOptions::scSearchLong) + + QString::fromLatin1("\t%1, %2 - uninstall all packages and remove entire program directory") + .arg(CommandLineOptions::scPurgeShort, CommandLineOptions::scPurgeLong); m_parser.setApplicationDescription(preformatted); diff --git a/src/libs/installer/constants.h b/src/libs/installer/constants.h index 37eb9600a..8f3291b04 100644 --- a/src/libs/installer/constants.h +++ b/src/libs/installer/constants.h @@ -124,6 +124,8 @@ static const QLatin1String scListShort("li"); static const QLatin1String scListLong("list"); static const QLatin1String scSearchShort("se"); static const QLatin1String scSearchLong("search"); +static const QLatin1String scPurgeShort("pr"); +static const QLatin1String scPurgeLong("purge"); // Repository management options static const QLatin1String scAddRepositoryShort("ar"); @@ -186,7 +188,9 @@ static const QStringList scCommandLineInterfaceOptions = { scListShort, scListLong, scSearchShort, - scSearchLong + scSearchLong, + scPurgeShort, + scPurgeLong }; } // namespace CommandLineOptions diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index 55a143ceb..0a5eec513 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -2219,6 +2219,22 @@ bool PackageManagerCore::uninstallComponentsSilently(const QStringList& componen } /*! + Uninstalls all installed components without GUI and removes + the program directory. Returns \c true if components are + uninstalled successfully, otherwise returns \c false. +*/ +bool PackageManagerCore::removeInstallationSilently() +{ + if (d->runningProcessesFound()) + throw Error(tr("Running processes found.")); + + autoRejectMessageBoxes(); + + setCompleteUninstallation(true); + return run(); +} + +/*! Installs the selected components \a components without displaying a user interface. Virtual components cannot be installed unless made visible with --show-virtual-components. AutoDependOn nor non-checkable components cannot diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h index 82ab779c3..979ff50e6 100644 --- a/src/libs/installer/packagemanagercore.h +++ b/src/libs/installer/packagemanagercore.h @@ -221,6 +221,7 @@ public: bool installSelectedComponentsSilently(const QStringList& components); bool installDefaultComponentsSilently(); bool uninstallComponentsSilently(const QStringList& components); + bool removeInstallationSilently(); // convenience Q_INVOKABLE void setInstaller(); |