summaryrefslogtreecommitdiffstats
path: root/src/libs/kdtools
diff options
context:
space:
mode:
authorkh <karsten.heimrich@theqtcompany.com>2014-11-25 16:00:24 +0100
committerNiels Weber <niels.weber@theqtcompany.com>2014-12-01 15:51:39 +0100
commita439e6fab484461744a657f5173a738622064edf (patch)
treefb91ee0093cf27e7b049a75938ffbf52d498b191 /src/libs/kdtools
parent579d562e25bacbf169cab30976f0e8b0e42b849f (diff)
Documentation updates and fixes.
Change-Id: Ie9fc9e1c2a0b84082cb48732e270913bc90d9a79 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'src/libs/kdtools')
-rw-r--r--src/libs/kdtools/kdgenericfactory.cpp169
-rw-r--r--src/libs/kdtools/kdjob.cpp11
-rw-r--r--src/libs/kdtools/kdupdaterapplication.cpp99
-rw-r--r--src/libs/kdtools/kdupdaterfiledownloader.cpp29
-rw-r--r--src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp29
-rw-r--r--src/libs/kdtools/kdupdaterpackagesinfo.cpp167
-rw-r--r--src/libs/kdtools/kdupdatertask.cpp82
-rw-r--r--src/libs/kdtools/kdupdaterupdate.cpp2
-rw-r--r--src/libs/kdtools/kdupdaterupdatefinder.cpp76
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperation.cpp130
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperationfactory.cpp35
-rw-r--r--src/libs/kdtools/kdupdaterupdateoperationfactory.h2
-rw-r--r--src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp63
13 files changed, 445 insertions, 449 deletions
diff --git a/src/libs/kdtools/kdgenericfactory.cpp b/src/libs/kdtools/kdgenericfactory.cpp
index e7e5108e9..683b18876 100644
--- a/src/libs/kdtools/kdgenericfactory.cpp
+++ b/src/libs/kdtools/kdgenericfactory.cpp
@@ -35,83 +35,99 @@
#include "kdgenericfactory.h"
/*!
+ \inmodule kdupdater
\class KDGenericFactory
- \ingroup core
- \brief Template based generic factory implementation
- \since_c 2.1
-
- (The exception safety of this class has not been evaluated yet.)
-
- KDGenericFactory is an implemention of of the factory pattern. It can be used to
- "produce" instances of different classes having a common superclass
- T_Product. The user of the
- factory registers those producable classes in the factory by using an identifier
- (T_Identifier, defaulting to QString). That identifer can then be used to
- produce as many instances of the registered product as he wants.
-
- The advanced user can even choose the type of the map the factory is using to store its
- FactoryFunctions by passing a T_Map template parameter. It defaults to QHash. KDGenericFactory
- expects it to be a template class accepting T_Identifier and FactoryFunction as parameters.
- Additionally it needs to provide:
-
- \li\link QHash::const_iterator a nested %const_iterator \endlink typedef for an iterator type that when dereferenced has type ((const) reference to) FactoryFunction (Qt convention),
- \li\link QHash::insert %insert( T_Identifier, FactoryFunction ) \endlink, which must overwrite any existing entries with the same identifier.
- \li\link QHash::find %find( T_Identifier ) \endlink,
- \li\link QHash::end %end() \endlink,
- \li\link QHash::size %size() \endlink,
- \li\link QHash::remove %remove( T_Identifier ) \endlink, and
- \li\link QHash::keys %keys ) \endlink, returning a QList<T_Identifier>.
-
- The only two class templates that currently match this concept are
- QHash and QMap. QMultiHash and QMulitMap do not work, since they
- violate the requirement on insert() above, and std::map and
- std::unordered_map do not match because they don't have keys() and
- because a dereferenced iterator has type
- std::pair<const T_Identifier,FactoryFunction>
- instead of just FactoryFunction.
-
- \section general-use General Use
+ \brief The KDGenericFactory class implements a template-based generic factory.
+
+ KDGenericFactory is an implementation of the factory pattern. It can be used to produce
+ instances of different classes having a common superclass \c T_Product. The user of the
+ factory registers those producible classes in the factory by using an identifier
+ \c T_Identifier. That identifier can then be used to produce as many instances of the
+ registered product as the user wants.
+
+ The advanced user can even choose the type of the class the factory is using to store its
+ FactoryFunctions by passing a \c T_Map template parameter. It defaults to QHash.
+
+ KDGenericFactory expects the storage container to be a template class accepting \c T_Identifier
+ and \c FactoryFunction as parameters. Additionally it needs to provide:
+
+ \table
+ \header
+ \li Method
+ \li Description
+ \row
+ \li \c {const_iterator}
+ \li A type that provides a random-access iterator that can read a const element and
+ when dereferenced has type \c {const &FactoryFunction}.
+ \row
+ \li \c {insert(T_Identifier, FactoryFunction)}
+ \li A function that inserts a new item with \c T_Identifier as key and \c FactoryFunction
+ as value. If there is already an item with \c T_Identifier as key, that item's value
+ must be replaced with \c FactoryFunction.
+ \row
+ \li \c {find(T_Identifier)}
+ \li A function returning an iterator pointing to the item with the key \c T_Identifier.
+
+ \row
+ \li \c {end()}
+ \li A function returning an iterator pointing to the imaginary item after the last item.
+
+ \row
+ \li \c {size()}
+ \li A function returning the number of items.
+ \row
+ \li \c {remove(T_Identifier)}
+ \li A function removing all items that have the key \c T_Identifier.
+ \row
+ \li \c {keys()}
+ \li A function returning a list of all the keys \c T_Identifier in an arbitrary order.
+ \endtable
+
+ The only two class templates that currently match this concept are QHash and QMap. QMultiHash
+ and QMultiMap do not work, because they violate the requirement on insert() above and std::map
+ and std::unordered_map do not match, because they do not have keys() and, because a dereferenced
+ iterator has type \c {std::pair<const T_Identifier, FactoryFunction>} instead of just
+ \c FactoryFunction.
The following example shows how the general use case of KDGenericFactory looks like:
- \code
+ \code
- class Fruit
- {
- };
+ class Fruit
+ {
+ };
- class Apple : public Fruit
- {
- };
+ class Apple : public Fruit
+ {
+ };
- class Pear : public Fruit
- {
- };
+ class Pear : public Fruit
+ {
+ };
- int main()
- {
- // creates a common fruit "factory"
- KDGenericFactory< Fruit > fruitPlantation;
- // registers the product "Apple"
- fruitPlantation.registerProduct< Apple >( "Apple" );
- // registers the product "Pear"
- fruitPlantation.registerProduct< Pear >( "Pear" );
+ int main()
+ {
+ // creates a common fruit "factory"
+ KDGenericFactory< Fruit > fruitPlantation;
+ // registers the product "Apple"
+ fruitPlantation.registerProduct< Apple >( "Apple" );
+ // registers the product "Pear"
+ fruitPlantation.registerProduct< Pear >( "Pear" );
- // lets create some stuff - here comes our tasty apple:
- Fruit* myApple = fruitPlantation.create( "Apple" );
+ // lets create some stuff - here comes our tasty apple:
+ Fruit* myApple = fruitPlantation.create( "Apple" );
- // and a pear, please:
- Fruit* myPear = fruitPlantation.create( "Pear" );
+ // and a pear, please:
+ Fruit* myPear = fruitPlantation.create( "Pear" );
- // ohh - that doesn't work, returns a null pointer:
- Fruit* myCherry = fruitPlantation.create( "Cherry" );
- }
-
- \endcode
+ // ohh - that doesn't work, returns a null pointer:
+ Fruit* myCherry = fruitPlantation.create( "Cherry" );
+ }
+ \endcode
*/
/*!
- \fn KDGenericFactory::~KDGenericFactory
+ \fn KDGenericFactory::~KDGenericFactory()
Destructor.
*/
@@ -133,35 +149,8 @@
*/
/*!
- \fn KDGenericFactory::unregisterProduct( const T_Identifier& name )
-
- Unregisters the previously registered product identified by \a name from the factory.
- If no such product is known, nothing is done.
-*/
-
-/*!
- \fn KDGenericFactory::productCount() const
-
- Returns the number of different products known to the factory.
-*/
-
-/*!
- \fn KDGenericFactory::availableProducts() const
-
- Returns the list of products known to the factory.
-*/
-
-/*!
\fn KDGenericFactory::create( const T_Identifier& name ) const
Creates and returns a product of the type identified by \a name.
Ownership of the product is transferred to the caller.
*/
-
-/*!
- \fn KDGenericFactory::registerProductionFunction( const T_Identifier& name, FactoryFunction create )
-
- Subclasses can use this method to register their own FactoryFunction \a create to create products of
- type T, identified by \a name. When a product is registered via this method, it will be created
- by calling create().
-*/
diff --git a/src/libs/kdtools/kdjob.cpp b/src/libs/kdtools/kdjob.cpp
index cb9f2ebef..0a0636fa8 100644
--- a/src/libs/kdtools/kdjob.cpp
+++ b/src/libs/kdtools/kdjob.cpp
@@ -212,8 +212,8 @@ void KDJob::setTotalAmount(quint64 amount)
}
/*!
- Returns the timeout in milliseconds before the jobs cancel slot gets triggered. A return value of -1
- means there is currently no timeout used for the job.
+ Returns the timeout in milliseconds before the job's cancel slot gets triggered. A return value
+ of -1 means there is currently no timeout used for the job.
*/
int KDJob::timeout() const
{
@@ -221,10 +221,9 @@ int KDJob::timeout() const
}
/*!
- Sets the timeout in \a milliseconds before the jobs cancel slot gets triggered. \note Only jobs that
- have the \c KDJob::Cancelable capability can be canceled by a timeout. A
- value of -1 will stop the
- timeout mechanism.
+ Sets the timeout in \a milliseconds before the job's cancel slot gets triggered. \note Only jobs
+ that have the \c KDJob::Cancelable capability can be canceled by a timeout. A value of -1 will
+ stop the timeout mechanism.
*/
void KDJob::setTimeout(int milliseconds)
{
diff --git a/src/libs/kdtools/kdupdaterapplication.cpp b/src/libs/kdtools/kdupdaterapplication.cpp
index 483f5bfc8..bd766b436 100644
--- a/src/libs/kdtools/kdupdaterapplication.cpp
+++ b/src/libs/kdtools/kdupdaterapplication.cpp
@@ -43,44 +43,30 @@
using namespace KDUpdater;
/*!
- \defgroup kdupdater KD Updater
- \since_l 2.1
-
- "KD Updater" is a library from KDAB that helps in enabling automatic updates for your applications.
- All classes belonging to the "KD Updater" library are defined in the \ref KDUpdater namespace.
-
- TODO: this comes from the former mainpage:
-KD Updater is a tool to automatically detect, retrieve, install and activate updates to software
-applications and libraries. It is intended to be used with Qt based applications, and developed
-against the Qt 4 series. It is a library that users link to their application. It uses only accepted
-standard protocols, and does not require any other 3rd party libraries that are not shipped with
-Qt.
-
-KD Updater is generic in that it is not developed for one specific application. The first version is
-experimental. If it proves successful and useful, it will be integrated into KDAB's KD Tools
-package. It is part of KDAB's strategy to provide functionality missing in Qt that is required for
-medium-to-large scale software systems.
-*/
-
-
-/*!
+ \inmodule kdupdater
\namespace KDUpdater
+ \brief The KDUpdater classes where initially developed by KDAB to help provide automatic
+ updates for your applications. Now they are solely part of the Qt Installer Framework.
*/
/*!
- \class KDUpdater::Application kdupdaterapplication.h KDUpdaterApplication
- \inmodule kdupdater
- \brief This class represents an application that can be updated.
-
- A KDUpdater application is an application that needs to interact with one or more update servers and
- downloads/installs updates This class helps in describing an application in terms of:
- \li application Directory
- \li packages XML file name and its corresponding KDUpdater::PackagesInfo object
- \li update Sources XML file name and its corresponding KDUpdater::UpdateSourcesInfo object
-
- User can also retrieve some information from this class:
- \li application name
- \li application version
+ \class KDUpdater::Application
+ \inmodule kdupdater
+ \brief The \c Application class represents an application that can be updated.
+
+ A KDUpdater application is an application that interacts with one or more update servers and
+ downloads or installs updates. This class helps in describing an application in terms of:
+ \list
+ \li Application Directory
+ \li Packages XML file name and its corresponding KDUpdater::PackagesInfo object
+ \li Update sources XML file name and its corresponding KDUpdater::UpdateSourcesInfo object
+ \endlist
+
+ User can also retrieve some information from this class:
+ \list
+ \li Application name
+ \li Application version
+ \endlist
*/
struct Application::ApplicationData
@@ -120,9 +106,8 @@ struct Application::ApplicationData
Application *Application::ApplicationData::instance = 0;
/*!
- Constructor of the Application class. The class will be constructed and configured to
- assume the application directory to be the directory in which the application exists. The
- application name is assumed to be QCoreApplication::applicationName()
+ Constructs the \c Application class and configures it to assume the application directory to be
+ the directory in which the application exists.
*/
Application::Application(ConfigurationInterface* config, QObject* p) : QObject(p)
{
@@ -136,7 +121,7 @@ Application::Application(ConfigurationInterface* config, QObject* p) : QObject(p
}
/*!
- Destructor
+ Destructor
*/
Application::~Application()
{
@@ -146,16 +131,16 @@ Application::~Application()
}
/*!
- Returns a previously created Application instance.
- */
+ Returns a previously created \c Application instance.
+*/
Application *Application::instance()
{
return ApplicationData::instance;
}
/*!
- Changes the applicationDirPath directory to \c dir. Packages.xml and UpdateSources.xml found in the new
- application directory will be used.
+ Sets the application directory path directory to \a dir. The package XML and update sources
+ XML files found in the new application directory will be used.
*/
void Application::setApplicationDirectory(const QString &dir)
{
@@ -171,7 +156,7 @@ void Application::setApplicationDirectory(const QString &dir)
}
/*!
- Returns path to the application directory.
+ Returns the path to the application directory.
*/
QString Application::applicationDirectory() const
{
@@ -179,7 +164,7 @@ QString Application::applicationDirectory() const
}
/*!
- Returns the application name.
+ Returns the application name. By default, QCoreApplication::applicationName() is returned.
*/
QString Application::applicationName() const
{
@@ -190,7 +175,7 @@ QString Application::applicationName() const
}
/*!
- Returns the application version.
+ Returns the application version.
*/
QString Application::applicationVersion() const
{
@@ -200,8 +185,14 @@ QString Application::applicationVersion() const
return QString();
}
+/*!
+ Adds update source info to this class.
+
+ \sa KDUpdater::UpdateSourceInfo
+ \sa KDUpdater::UpdateSourcesInfo
+*/
void Application::addUpdateSource(const QString &name, const QString &title,
- const QString &description, const QUrl &url, int priority)
+ const QString &description, const QUrl &url, int priority)
{
UpdateSourceInfo info;
info.name = name;
@@ -214,8 +205,8 @@ void Application::addUpdateSource(const QString &name, const QString &title,
/*!
- Sets the file name of the Package XML file for this application. By default this is assumed to be
- Packages.xml in the application directory.
+ Sets the file name of the package XML file for this application to \a fileName. By default,
+ this is assumed to be Packages.xml in the application directory.
\sa KDUpdater::PackagesInfo::setFileName()
*/
@@ -225,7 +216,7 @@ void Application::setPackagesXMLFileName(const QString &fileName)
}
/*!
- Returns the Package XML file name.
+ Returns the package XML file name.
*/
QString Application::packagesXMLFileName() const
{
@@ -233,7 +224,7 @@ QString Application::packagesXMLFileName() const
}
/*!
- Returns the \ref PackagesInfo object associated with this application.
+ Returns the KDUpdater::PackagesInfo object associated with this application.
*/
PackagesInfo* Application::packagesInfo() const
{
@@ -241,8 +232,8 @@ PackagesInfo* Application::packagesInfo() const
}
/*!
- Sets the file name of the Package XML file for this application. By default this is assumed to be
- Packages.xml in the application directory.
+ Sets the file name of the update sources XML file for this application. By default, this is
+ assumed to be UpdateSources.xml in the application directory.
\sa KDUpdater::UpdateSourcesInfo::setFileName()
*/
@@ -252,7 +243,7 @@ void Application::setUpdateSourcesXMLFileName(const QString &fileName)
}
/*!
- Returns the Update Sources XML file name.
+ Returns the update sources XML file name.
*/
QString Application::updateSourcesXMLFileName() const
{
@@ -260,7 +251,7 @@ QString Application::updateSourcesXMLFileName() const
}
/*!
- Returns the \ref UpdateSourcesInfo object associated with this application.
+ Returns the KDUpdater::UpdateSourcesInfo object associated with this application.
*/
UpdateSourcesInfo* Application::updateSourcesInfo() const
{
diff --git a/src/libs/kdtools/kdupdaterfiledownloader.cpp b/src/libs/kdtools/kdupdaterfiledownloader.cpp
index a063debb7..9f656cb77 100644
--- a/src/libs/kdtools/kdupdaterfiledownloader.cpp
+++ b/src/libs/kdtools/kdupdaterfiledownloader.cpp
@@ -65,31 +65,20 @@ static double calcProgress(qint64 done, qint64 total)
/*!
\inmodule kdupdater
- \class KDUpdater::FileDownloader kdupdaterfiledownloader.h
+ \class KDUpdater::FileDownloader
\brief The FileDownloader class is the base class for file downloaders used in KDUpdater.
- File downloaders are used by
- the KDUpdater::Update class to download update files. Each subclass of FileDownloader
- can download file from a specific category of sources (e.g. local, ftp, http etc).
+ File downloaders are used by the KDUpdater::Update class to download update files. Each
+ subclass of FileDownloader can download files from a specific category of sources (such as
+ local, ftp, http).
This is an internal class, not a part of the public API. Currently we have three
subclasses of FileDownloader
- \li LocalFileDownloader - downloads from the local file system
- \li FtpDownloader - downloads from a FTP site
- \li HttpDownloader - downloads from a HTTP site
-
- Usage
-
- \code
- KDUpdater::FileDownloader* downloader = new KDUpdater::(some subclass name)
-
- downloader->setUrl(url);
- downloader->download();
-
- // wait for downloadCompleted() signal
-
- QString downloadedFile = downloader->downloadedFileName();
- \endcode
+ \list
+ \li Use the FtpDownloader to download files from an FTP site.
+ \li Use the HttpDownloader to download files from an HTTP site.
+ \li Use the LocalFileDownloader to download files from the local file system.
+ \endlist
*/
struct KDUpdater::FileDownloader::Private
diff --git a/src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp b/src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp
index be1f1298d..39e6ba952 100644
--- a/src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp
+++ b/src/libs/kdtools/kdupdaterfiledownloaderfactory.cpp
@@ -41,14 +41,12 @@ using namespace KDUpdater;
/*!
\inmodule kdupdater
- \class KDUpdater::FileDownloaderFactory kdupdaterfiledownloaderfactory.h
- \brief Factory for \ref KDUpdater::FileDownloader
+ \class KDUpdater::FileDownloaderFactory
+ \brief The FileDownloaderFactory class acts as a factory for KDUpdater::FileDownloader.
- This class acts as a factory for \ref KDUpdater::FileDownloader. You can register
- one or more file downloaders with this factory and query them based on their scheme.
-
- This class follows the singleton design pattern. Only one instance of this class can
- be created and its reference can be fetched from the \ref instance() method.
+ You can register one or more file downloaders with this factory and query them based on their
+ scheme. The class follows the singleton design pattern. Only one instance of this class can
+ be created and its reference can be fetched from the instance() method.
*/
@@ -59,7 +57,7 @@ FileDownloaderFactory& FileDownloaderFactory::instance()
}
/*!
- Constructor
+ Constructor
*/
FileDownloaderFactory::FileDownloaderFactory()
: d (new FileDownloaderFactoryData)
@@ -123,9 +121,10 @@ bool FileDownloaderFactory::isSupportedScheme(const QString &scheme)
}
/*!
- Returns a new instance to the \ref KDUpdater::FileDownloader based whose scheme is equal to the string
- passed as parameter to this function.
- \note Ownership of this object remains to the programmer.
+ Returns a new instance of a KDUpdater::FileDownloader subclass. The subclass is instantiated
+ based on the communication protocol string stored in \a scheme.
+
+ \note Ownership of the created object remains with the programmer.
*/
FileDownloader *FileDownloaderFactory::create(const QString &scheme, QObject *parent) const
{
@@ -142,7 +141,9 @@ FileDownloader *FileDownloaderFactory::create(const QString &scheme, QObject *pa
}
/*!
- KDUpdater::FileDownloaderFactory::registerFileDownlooader
- Registers a new file downloader with the factory. If there is already a downloader with the same scheme,
- the downloader is replaced. The ownership of the downloader is transferred to the factory.
+ \fn void KDUpdater::FileDownloaderFactory::registerFileDownloader(const QString &scheme)
+
+ Registers a new file downloader with the factory based on \a scheme. If there is already
+ a downloader with the same scheme, the downloader is replaced. When create() is called
+ with that \a scheme, the file downloader is constructed using its default constructor.
*/
diff --git a/src/libs/kdtools/kdupdaterpackagesinfo.cpp b/src/libs/kdtools/kdupdaterpackagesinfo.cpp
index ed32968f2..bae243bc5 100644
--- a/src/libs/kdtools/kdupdaterpackagesinfo.cpp
+++ b/src/libs/kdtools/kdupdaterpackagesinfo.cpp
@@ -43,47 +43,40 @@
using namespace KDUpdater;
/*!
- \inmodule kdupdater
- \class KDUpdater::PackagesInfo kdupdaterpackagesinfo.h KDUpdaterPackagesInfo
- \brief Provides access to information about packages installed on the application side.
-
- This class parses the XML package file specified via the setFileName() method and
- provides access to the information defined within the package file through an
- easy to use API. You can:
- \li get application name via the \ref applicationName() method
- \li get application version via the \ref applicationVersion() method
- \li get information about the number of packages installed and their meta-data via the
- \ref packageInfoCount() and \ref packageInfo() methods.
-
- Instances of this class cannot be created. Each instance of \ref KDUpdater::Application
- has one instance of this class associated with it. You can fetch a pointer to an instance
- of this class for an application via the \ref KDUpdater::Application::packagesInfo()
- method.
+ \inmodule kdupdater
+ \class KDUpdater::PackagesInfo
+ \brief The PackagesInfo class provides access to information about packages installed on the
+ application side.
+
+ This class parses the package information XML file specified via the setFileName() method and
+ provides access to the information defined within the package information file through an easy
+ to use API. You can:
+ \list
+ \li Get the application name via the applicationName() method.
+ \li Get the application version via the applicationVersion() method.
+ \li Get information about the number of packages installed and their meta-data via the
+ packageInfoCount() and packageInfo() methods.
+ \endlist
+
+ Instances of this class cannot be created. Each instance of KDUpdater::Application has one
+ instance of this class associated with it. You can fetch a pointer to an instance of this class
+ for an application via the KDUpdater::Application::packagesInfo() method.
*/
-/*! \enum UpdatePackagesInfo::Error
- * Error codes related to retrieving update sources
- */
-
-/*! \var UpdatePackagesInfo::Error UpdatePackagesInfo::NoError
- * No error occurred
- */
-
-/*! \var UpdatePackagesInfo::Error UpdatePackagesInfo::NotYetReadError
- * The package information was not parsed yet from the XML file
- */
-
-/*! \var UpdatePackagesInfo::Error UpdatePackagesInfo::CouldNotReadPackageFileError
- * the specified update source file could not be read (does not exist or not readable)
- */
-
-/*! \var UpdatePackagesInfo::Error UpdatePackagesInfo::InvalidXmlError
- * The source file contains invalid XML.
- */
-
-/*! \var UpdatePackagesInfo::Error UpdatePackagesInfo::InvalidContentError
- * The source file contains valid XML, but does not match the expected format for package descriptions
- */
+/*!
+ \enum PackagesInfo::Error
+ Error codes related to retrieving package information.
+
+ \value NoError No error occurred.
+ \value NotYetReadError The package information was not parsed yet from the XML
+ file.
+ \value CouldNotReadPackageFileError The specified package information file could not be
+ read (does not exist or is not readable).
+ \value InvalidXmlError The package information file contains invalid XML.
+ \value InvalidContentError The package information file contains valid XML, but
+ does not match the expected format for package
+ descriptions.
+*/
struct PackagesInfo::PackagesInfoData
{
@@ -129,8 +122,8 @@ PackagesInfo::~PackagesInfo()
}
/*!
- Returns true if the PackagesInfo are valid else false is returned in which case
- the \a errorString() method can be used to receive a describing error message.
+ Returns \c true if PackagesInfo is valid; otherwise returns \c false. You
+ can use the errorString() method to receive a descriptive error message.
*/
bool PackagesInfo::isValid() const
{
@@ -140,23 +133,27 @@ bool PackagesInfo::isValid() const
}
/*!
- Returns a human-readable error message.
+ Returns a human-readable description of the last error that occurred.
*/
QString PackagesInfo::errorString() const
{
return d->errorMessage;
}
+/*!
+ Returns the error that was found during the processing of the package information XML file. If
+ no error was found, returns NoError.
+*/
PackagesInfo::Error PackagesInfo::error() const
{
return d->error;
}
/*!
- Sets the complete file name of the Packages.xml file. The function also issues a call to
- \ref refresh() to reload package information from the XML file.
+ Sets the complete file name of the package information XML file to \a fileName. The function
+ also issues a call to refresh() to reload package information from the XML file.
- \sa KDUpdater::Application::setPackagesXMLFileName()
+ \sa KDUpdater::Application::setPackagesXMLFileName()
*/
void PackagesInfo::setFileName(const QString &fileName)
{
@@ -168,7 +165,7 @@ void PackagesInfo::setFileName(const QString &fileName)
}
/*!
- Returns the name of the Packages.xml file that this class referred to.
+ Returns the name of the package information XML file that this class refers to.
*/
QString PackagesInfo::fileName() const
{
@@ -176,8 +173,8 @@ QString PackagesInfo::fileName() const
}
/*!
- Sets the application name. By default this is the name specified in
- the ApplicationName XML element of the Packages.xml file.
+ Sets the application name to \a name. By default, this is the name specified in the
+ ApplicationName XML element of the package information XML file.
*/
void PackagesInfo::setApplicationName(const QString &name)
{
@@ -186,7 +183,7 @@ void PackagesInfo::setApplicationName(const QString &name)
}
/*!
- Returns the application name.
+ Returns the application name.
*/
QString PackagesInfo::applicationName() const
{
@@ -194,8 +191,8 @@ QString PackagesInfo::applicationName() const
}
/*!
- Sets the application version. By default this is the version specified
- in the ApplicationVersion XML element of Packages.xml.
+ Sets the application version to \a version. By default, this is the version specified in the
+ ApplicationVersion XML element of package information XML file.
*/
void PackagesInfo::setApplicationVersion(const QString &version)
{
@@ -204,7 +201,7 @@ void PackagesInfo::setApplicationVersion(const QString &version)
}
/*!
- Returns the application version.
+ Returns the application version.
*/
QString PackagesInfo::applicationVersion() const
{
@@ -212,7 +209,7 @@ QString PackagesInfo::applicationVersion() const
}
/*!
- Returns the number of \ref KDUpdater::PackageInfo objects contained in this class.
+ Returns the number of KDUpdater::PackageInfo objects contained in this class.
*/
int PackagesInfo::packageInfoCount() const
{
@@ -220,8 +217,8 @@ int PackagesInfo::packageInfoCount() const
}
/*!
- Returns the package info structure (\ref KDUpdater::PackageInfo) at index. If index is
- out of range then an empty package info structure is returned.
+ Returns the package info structure at \a index. If an invalid index is passed, the
+ function returns a \l{default-constructed value}.
*/
PackageInfo PackagesInfo::packageInfo(int index) const
{
@@ -232,8 +229,8 @@ PackageInfo PackagesInfo::packageInfo(int index) const
}
/*!
- This function returns the index of the package whose name is \c pkgName. If no such
- package was found, this function returns -1.
+ Returns the index of the package whose name is \a pkgName. If no such package was found, this
+ function returns -1.
*/
int PackagesInfo::findPackageInfo(const QString &pkgName) const
{
@@ -246,7 +243,7 @@ int PackagesInfo::findPackageInfo(const QString &pkgName) const
}
/*!
- Returns all package info structures.
+ Returns all package info structures.
*/
QVector<PackageInfo> PackagesInfo::packageInfos() const
{
@@ -254,9 +251,9 @@ QVector<PackageInfo> PackagesInfo::packageInfos() const
}
/*!
- This function re-reads the Packages.xml file and updates itself. Changes to \ref applicationName()
- and \ref applicationVersion() are lost after this function returns. The function emits a reset()
- signal after completion.
+ Re-reads the package information XML file and updates itself. Changes to applicationName()
+ and applicationVersion() are lost after this function returns. The function emits a reset()
+ signal after completion.
*/
void PackagesInfo::refresh()
{
@@ -330,8 +327,8 @@ void PackagesInfo::refresh()
}
/*!
- Marks the package with \a name as installed in \a version.
- */
+ Marks the package with \a name and \a version as installed.
+*/
bool PackagesInfo::installPackage(const QString &name, const QString &version,
const QString &title, const QString &description,
const QStringList &dependencies, bool forcedInstallation,
@@ -358,11 +355,10 @@ bool PackagesInfo::installPackage(const QString &name, const QString &version,
}
/*!
- Update the package.
+ Updates the package and sets the package name to \a name, the version to \a version and the
+ last update date to \a date.
*/
-bool PackagesInfo::updatePackage(const QString &name,
- const QString &version,
- const QDate &date)
+bool PackagesInfo::updatePackage(const QString &name, const QString &version, const QDate &date)
{
int index = findPackageInfo(name);
@@ -376,8 +372,8 @@ bool PackagesInfo::updatePackage(const QString &name,
}
/*!
- Remove the package with \a name.
- */
+ Remove the package with \a name.
+*/
bool PackagesInfo::removePackage(const QString &name)
{
const int index = findPackageInfo(name);
@@ -514,46 +510,47 @@ void PackagesInfo::clearPackageInfoList()
}
/*!
- \fn void KDUpdater::PackagesInfo::reset()
+ \fn void KDUpdater::PackagesInfo::reset()
- This signal is emitted whenever the contents of this class is refreshed, usually from within
- the \ref refresh() slot.
+ This signal is emitted whenever the contents of this class are refreshed, usually from within
+ the refresh() slot.
*/
/*!
- \inmodule kdupdater
- \struct KDUpdater::PackageInfo kdupdaterpackagesinfo.h KDUpdaterPackageInfo
- \brief Describes a single installed package in the application.
+ \inmodule kdupdater
+ \class KDUpdater::PackageInfo
+ \brief The PackageInfo class describes a single installed package in the application.
- This structure contains information about a single installed package in the application.
- The information contained in this structure corresponds to the information described
- by the Package XML element in Packages.xml
+ This class contains information about a single installed package in the application. The
+ information contained in this class corresponds to the information described by the Package
+ XML element in the package information XML file.
*/
/*!
- \var QString KDUpdater::PackageInfo::name
+ \variable PackageInfo::name
+ \brief The name of the package.
*/
/*!
- \var QString KDUpdater::PackageInfo::pixmap
+ \variable PackageInfo::pixmap
*/
/*!
- \var QString KDUpdater::PackageInfo::title
+ \variable PackageInfo::title
*/
/*!
- \var QString KDUpdater::PackageInfo::description
+ \variable PackageInfo::description
*/
/*!
- \var QString KDUpdater::PackageInfo::version
+ \variable PackageInfo::version
*/
/*!
- \var QDate KDUpdater::PackageInfo::lastUpdateDate
+ \variable PackageInfo::lastUpdateDate
*/
/*!
- \var QDate KDUpdater::PackageInfo::installDate
+ \variable PackageInfo::installDate
*/
diff --git a/src/libs/kdtools/kdupdatertask.cpp b/src/libs/kdtools/kdupdatertask.cpp
index 78ac92a17..922fc4c28 100644
--- a/src/libs/kdtools/kdupdatertask.cpp
+++ b/src/libs/kdtools/kdupdatertask.cpp
@@ -38,19 +38,29 @@ using namespace KDUpdater;
/*!
\inmodule kdupdater
- \class KDUpdater::Task kdupdatertask.h KDUpdaterTask
- \brief Base class for all task classes in KDUpdater
+ \class KDUpdater::Task
+ \brief The Task class is the base class for all tasks in KDUpdater.
This class is the base class for all task classes in KDUpdater. Task is an activity that
occupies certain amount of execution time. It can be started, stopped (or canceled), paused and
resumed. Tasks can report progress and error messages which an application can show in any
sort of UI. The KDUpdater::Task class provides a common interface for dealing with all kinds of
- tasks in KDUpdater. The class diagram show in this class documentation will help in pointing out
- the task classes in KDUpdater.
+ tasks in KDUpdater.
- User should be carefull of these points:
- \li Instances of this class cannot be created. Only instance of the subclasses can be created
- \li Task classes can be started only once.
+ User should be careful of these points:
+ \list
+ \li Task classes can be started only once.
+ \li Instances of this class cannot be created. Only instance of the subclasses can.
+ \endlist
+*/
+
+/*!
+ \enum Task::Capability
+ Sets the capabilities of the task.
+
+ \value NoCapability
+ \value Pausable
+ \value Stoppable
*/
/*!
@@ -85,16 +95,7 @@ QString Task::name() const
}
/*!
- Returns the capabilities of the task. It is a combination of one or more
- Capability flags. Defined as follows
- \code
- enum Task::Capability
- {
- NoCapability = 0,
- Pausable = 1,
- Stoppable = 2
- };
- \endcode
+ Returns the capabilities of the task. It is a combination of one or more Capability flags.
*/
int Task::capabilities() const
{
@@ -194,7 +195,7 @@ void Task::run()
}
/*!
- Stops the task, provided the task has \ref Stoppable capability.
+ Stops the task, provided the task has Stoppable capability.
\note Once the task is stopped, it cannot be restarted.
*/
@@ -233,7 +234,7 @@ void Task::stop()
}
/*!
- Paused the task, provided the task has \ref Pausable capability.
+ Pauses the task, provided the task has KDUpdater::Task::Pausable capability.
*/
void Task::pause()
{
@@ -367,7 +368,7 @@ void Task::setAutoDelete(bool autoDelete)
}
/*!
- \fn virtual bool KDUpdater::Task::doStart() = 0;
+ \fn virtual bool KDUpdater::Task::doRun() = 0;
*/
/*!
@@ -383,61 +384,54 @@ void Task::setAutoDelete(bool autoDelete)
*/
/*!
- \signal void KDUpdater::Task::error(int code, const QString& errorText)
+ \fn void Task::error(int code, const QString &errorText)
This signal is emitted to notify an error during the execution of this task.
- \param code Error code
- \param errorText A string describing the error.
- Error codes are just integers, there are however built in errors represented
- by the KDUpdater::Error enumeration
- \code
- enum Error
- {
- ECannotStartTask,
- ECannotPauseTask,
- ECannotResumeTask,
- ECannotStopTask,
- EUnknown
- };
- \endcode
+ The \a code parameter indicates the error that was found during the execution of the
+ task, while the \a errorText is the human-readable description of the last error that occurred.
*/
/*!
- \signal void KDUpdater::Task::progress(int percent, const QString& progressText)
+ \fn void Task::progressValue(int percent)
- This signal is emitted to nofity progress made by the task.
+ This signal is emitted to report progress made by the task. The \a percent parameter gives
+ the progress made as a percentage.
+*/
+
+/*!
+ \fn void Task::progressText(const QString &progressText)
- \param percent Percentage of progress made
- \param progressText A string describing the progress made
+ This signal is emitted to report the progress made by the task. The \a progressText parameter
+ represents the progress made in a human-readable form.
*/
/*!
- \signal void KDUpdater::Task::started()
+ \fn void Task::started()
This signal is emitted when the task has started.
*/
/*!
- \signal void KDUpdater::Task::paused()
+ \fn void Task::paused()
This signal is emitted when the task has paused.
*/
/*!
- \signal void KDUpdater::Task::resumed()
+ \fn void Task::resumed()
This signal is emitted when the task has resumed.
*/
/*!
- \signal void KDUpdater::Task::stopped()
+ \fn void Task::stopped()
This signal is emitted when the task has stopped (or canceled).
*/
/*!
- \signal void KDUpdater::Task::finished()
+ \fn void Task::finished()
This signal is emitted when the task has finished.
*/
diff --git a/src/libs/kdtools/kdupdaterupdate.cpp b/src/libs/kdtools/kdupdaterupdate.cpp
index 43c308cb5..e1f5b50db 100644
--- a/src/libs/kdtools/kdupdaterupdate.cpp
+++ b/src/libs/kdtools/kdupdaterupdate.cpp
@@ -38,7 +38,7 @@ using namespace KDUpdater;
/*!
\inmodule kdupdater
- \class KDUpdater::Update kdupdaterupdate.h KDUpdaterUpdate
+ \class KDUpdater::Update
\brief Represents a single update
The KDUpdater::Update class contains information about an update. It is created by KDUpdater::UpdateFinder
diff --git a/src/libs/kdtools/kdupdaterupdatefinder.cpp b/src/libs/kdtools/kdupdaterupdatefinder.cpp
index dff1addb9..e6c9044b8 100644
--- a/src/libs/kdtools/kdupdaterupdatefinder.cpp
+++ b/src/libs/kdtools/kdupdaterupdatefinder.cpp
@@ -50,42 +50,14 @@
using namespace KDUpdater;
/*!
- \inmodule kdupdater
- \class KDUpdater::UpdateFinder kdupdaterupdatefinder KDUpdaterUpdateFinder
- \brief Finds updates applicable for a \ref KDUpdater::Application
-
- The KDUpdater::UpdateFinder class helps in searching for updates and installing them on the application. The
- class basically processes the application's \ref KDUpdater::PackagesInfo and the UpdateXMLs it aggregates
- from all the update sources described in KDUpdater::UpdateSourcesInfo and populates a list of
- \ref KDUpdater::Update objects. This list can then be passed to \ref KDUpdater::UpdateInstaller for
- actually downloading and installing the updates.
-
-
- Usage:
- \code
- KDUpdater::UpdateFinder updateFinder( application );
- QProgressDialog finderProgressDlg;
-
- QObject::connect( &updateFinder, SIGNAL(progressValue(int)),
- &finderProgressDlg, SLOT(setValue(int)));
- QObject::connect( &updateFinder, SIGNAL(computeUpdatesCompleted()),
- &finderProgressDlg, SLOT(accept()));
- QObject::connect( &updateFinder, SIGNAL(computeUpdatesCanceled()),
- &finderProgressDlg, SLOT(reject()));
-
- QObject::connect( &finderProgressDlg, SIGNAL(canceled()),
- &updateFinder, SLOT(cancelComputeUpdates()));
-
- updateFinder.run();
- finderProgressDlg.exec();
-
- // Control comes here after update finding is done or canceled.
-
- QList<KDUpdater::Update*> updates = updateFinder.updates();
- KDUpdater::UpdateInstaller updateInstaller;
- updateInstaller.installUpdates( updates );
-
-\endcode
+ \inmodule kdupdater
+ \class KDUpdater::UpdateFinder
+ \brief The UpdaterFinder class finds updates applicable for a KDUpdater::Application.
+
+ The KDUpdater::UpdateFinder class helps in searching for updates and installing them on the
+ application. The class basically processes the application's KDUpdater::PackagesInfo and the
+ UpdateXMLs it aggregates from all the update sources described in KDUpdater::UpdateSourcesInfo
+ and populates a list of KDUpdater::Update objects.
*/
//
@@ -179,17 +151,17 @@ void UpdateFinder::Private::clear()
\internal
This method computes the updates that can be applied on the application by
- studying the application's \ref KDUpdater::PackagesInfo object and the UpdateXML files
- from each of the update sources described in \ref KDUpdater::UpdateSourcesInfo.
+ studying the application's KDUpdater::PackagesInfo object and the UpdateXML files
+ from each of the update sources described in KDUpdater::UpdateSourcesInfo.
This function can take a long time to complete. The following signals are emitted
during the execution of this function
- The function creates \ref KDUpdater::Update objects on the stack. All KDUpdater::Update objects
+ The function creates KDUpdater::Update objects on the stack. All KDUpdater::Update objects
are made children of the application associated with this finder.
- The update sources are fetched from the \ref KDUpdater::UpdateSourcesInfo object associated with
- the application. Package information is extracted from the \ref KDUpdater::PackagesInfo object
+ The update sources are fetched from the KDUpdater::UpdateSourcesInfo object associated with
+ the application. Package information is extracted from the KDUpdater::PackagesInfo object
associated with the application.
\note Each time this function is called, all the previously computed updates are discarded
@@ -250,7 +222,7 @@ void UpdateFinder::Private::computeUpdates()
Cancels the computation of updates.
- \sa \ref computeUpdates()
+ \sa computeUpdates()
*/
void UpdateFinder::Private::cancelComputeUpdates()
{
@@ -488,7 +460,7 @@ UpdateFinder::Private::Resolution UpdateFinder::Private::checkPriorityAndVersion
//
/*!
- Constructs a update finder for a given \ref KDUpdater::Application.
+ Constructs an update finder for a given KDUpdater::Application.
*/
UpdateFinder::UpdateFinder(Application *application)
: Task(QLatin1String("UpdateFinder"), Stoppable, application),
@@ -507,7 +479,7 @@ UpdateFinder::~UpdateFinder()
/*!
Returns a list of KDUpdater::Update objects. The update objects returned in this list
- are made children of the \ref KDUpdater::Application object associated with this class.
+ are made children of the KDUpdater::Application object associated with this class.
*/
QList<Update *> UpdateFinder::updates() const
{
@@ -517,7 +489,7 @@ QList<Update *> UpdateFinder::updates() const
/*!
\internal
- Implemented from \ref KDUpdater::Task::doStart().
+ Implemented from KDUpdater::Task::doRun().
*/
void UpdateFinder::doRun()
{
@@ -527,7 +499,7 @@ void UpdateFinder::doRun()
/*!
\internal
- Implemented form \ref KDUpdater::Task::doStop()
+ Implemented from KDUpdater::Task::doStop().
*/
bool UpdateFinder::doStop()
{
@@ -542,7 +514,7 @@ bool UpdateFinder::doStop()
/*!
\internal
- Implemented form \ref KDUpdater::Task::doStop()
+ Implemented from KDUpdater::Task::doStop().
*/
bool UpdateFinder::doPause()
{
@@ -553,7 +525,7 @@ bool UpdateFinder::doPause()
/*!
\internal
- Implemented form \ref KDUpdater::Task::doStop()
+ Implemented from KDUpdater::Task::doStop().
*/
bool UpdateFinder::doResume()
{
@@ -580,9 +552,11 @@ void UpdateFinder::Private::slotDownloadDone()
This function compares two version strings \c v1 and \c v2 and returns
-1, 0 or +1 based on the following rule
- \li Returns 0 if v1 == v2
- \li Returns -1 if v1 < v2
- \li Returns +1 if v1 > v2
+ \list
+ \li Returns 0 if v1 == v2
+ \li Returns -1 if v1 < v2
+ \li Returns +1 if v1 > v2
+ \endlist
The function is very similar to \c strcmp(), except that it works on version strings.
diff --git a/src/libs/kdtools/kdupdaterupdateoperation.cpp b/src/libs/kdtools/kdupdaterupdateoperation.cpp
index 78f865300..50d396671 100644
--- a/src/libs/kdtools/kdupdaterupdateoperation.cpp
+++ b/src/libs/kdtools/kdupdaterupdateoperation.cpp
@@ -45,21 +45,31 @@ using namespace KDUpdater;
/*!
\inmodule kdupdater
- \class KDUpdater::UpdateOperation kdupdaterupdateoperation.h KDUpdaterUpdateOperation
- \brief Abstract base class for update operations.
+ \class KDUpdater::UpdateOperation
+ \brief The UpdateOperation class is an abstract base class for update operations.
- The \ref KDUpdater::UpdateOperation is an abstract class that specifies an interface for
+ The KDUpdater::UpdateOperation is an abstract class that specifies an interface for
update operations. Concrete implementations of this class must perform a single update
- operation like copy, move, delete etc.
+ operation like copy, move, delete.
\note Two separate threads cannot be using a single instance of KDUpdater::UpdateOperation
at the same time.
*/
+/*!
+ \enum UpdateOperation::Error
+ Error codes related to operation arguments and operation runtime failures.
+
+ NoError No error occurred.
+ InvalidArguments Number of arguments does not match or an invalid argument was set.
+ UserDefinedError An error occurred during operation run. Use UpdateOperation::errorString()
+ to get the human-readable description of the error that occurred.
+*/
+
/*
- * \internal
- * Returns a filename for a temporary file based on \a templateName
- */
+ \internal
+ Returns a filename for a temporary file based on \a templateName.
+*/
static QString backupFileName(const QString &templateName)
{
const QFileInfo templ(templateName);
@@ -72,14 +82,14 @@ static QString backupFileName(const QString &templateName)
}
/*!
- Constructor
+ \internal
*/
UpdateOperation::UpdateOperation()
: m_error(0)
{}
/*!
- Destructor
+ \internal
*/
UpdateOperation::~UpdateOperation()
{
@@ -88,9 +98,9 @@ UpdateOperation::~UpdateOperation()
}
/*!
- Returns the update operation name.
+ Returns the update operation name.
- \sa setName()
+ \sa setName()
*/
QString UpdateOperation::name() const
{
@@ -98,10 +108,10 @@ QString UpdateOperation::name() const
}
/*!
- Returns a command line string that describes the update operation. The returned
- string would be of the form
+ Returns a command line string that describes the update operation. The returned string will be
+ of the form:
- <name> <arg1> <arg2> <arg3> ....
+ \c{<name> <arg1> <arg2> <arg3> ....}
*/
QString UpdateOperation::operationCommand() const
{
@@ -110,7 +120,7 @@ QString UpdateOperation::operationCommand() const
}
/*!
- Returns true if there exists a setting called \a name. Otherwise returns false.
+ Returns \c true if there exists a value called \a name, otherwise returns \c false.
*/
bool UpdateOperation::hasValue(const QString &name) const
{
@@ -118,8 +128,7 @@ bool UpdateOperation::hasValue(const QString &name) const
}
/*!
- Clears the value of setting \a name and removes it.
- \post hasValue( \a name ) returns false.
+ Clears the value of \a name and removes it.
*/
void UpdateOperation::clearValue(const QString &name)
{
@@ -127,16 +136,15 @@ void UpdateOperation::clearValue(const QString &name)
}
/*!
- Returns the value of setting \a name. If the setting does not exists,
- this returns an empty QVariant.
+ Returns the value of \a name. If the value does not exists, this returns an empty QVariant.
*/
QVariant UpdateOperation::value(const QString &name) const
{
- return hasValue(name) ? m_values[name] : QVariant();
+ return m_values.value(name);
}
/*!
- Sets the value of setting \a name to \a value.
+ Sets the value of \a name to \a value.
*/
void UpdateOperation::setValue(const QString &name, const QVariant &value)
{
@@ -144,8 +152,8 @@ void UpdateOperation::setValue(const QString &name, const QVariant &value)
}
/*!
- Sets a update operation name. Subclasses will have to provide a unique
- name to describe this operation.
+ Sets the name of the operation to \a name. Subclasses will have to provide a unique name to
+ describe the operation.
*/
void UpdateOperation::setName(const QString &name)
{
@@ -153,8 +161,7 @@ void UpdateOperation::setName(const QString &name)
}
/*!
- Through this function, arguments to the update operation can be specified
- to the update operation.
+ Sets the arguments for the update operation to \a args.
*/
void UpdateOperation::setArguments(const QStringList &args)
{
@@ -162,7 +169,7 @@ void UpdateOperation::setArguments(const QStringList &args)
}
/*!
- Returns the last set function arguments.
+ Returns the arguments of the update operation.
*/
QStringList UpdateOperation::arguments() const
{
@@ -204,7 +211,7 @@ QString UpdateOperation::argumentKeyValue(const QString &key, const QString &def
}
/*!
- Returns error details in case performOperation() failed.
+ Returns a human-readable description of the last error that occurred.
*/
QString UpdateOperation::errorString() const
{
@@ -212,25 +219,31 @@ QString UpdateOperation::errorString() const
}
/*!
- * Can be used by subclasses to report more detailed error codes (optional).
- * To check if an operation was successful, use the return value of performOperation().
- */
+ Returns the error that was found during the processing of the operation. If no
+ error was found, returns NoError. Subclasses can set more detailed error codes (optional).
+
+ \note To check if an operation was successful, use the return value of performOperation(),
+ undoOperation(), or testOperation().
+*/
int UpdateOperation::error() const
{
return m_error;
}
/*!
- * Used by subclasses to set the error string.
- */
+ Sets the human-readable description of the last error that occurred to \a str.
+*/
void UpdateOperation::setErrorString(const QString &str)
{
m_errorString = str;
}
/*!
- * Used by subclasses to set the error code.
- */
+ Sets the error condition to be \a error. The human-readable message is set to \a errorString.
+
+ \sa UpdateOperation::error()
+ \sa UpdateOperation::errorString()
+*/
void UpdateOperation::setError(int error, const QString &errorString)
{
m_error = error;
@@ -239,22 +252,24 @@ void UpdateOperation::setError(int error, const QString &errorString)
}
/*!
- Clears the previously set argument list and application
+ Clears the previously set arguments.
*/
void UpdateOperation::clear()
{
m_arguments.clear();
}
+/*!
+ Returns the list of files that are scheduled for later deletion.
+*/
QStringList UpdateOperation::filesForDelayedDeletion() const
{
return m_delayedDeletionFiles;
}
/*!
- Registers a file to be deleted later, once the application was restarted
- (and the file isn't used anymore for sure).
- @param files the files to be registered
+ Registers a list of \a files to be deleted later once the application was restarted and the
+ file or files are not used anymore.
*/
void UpdateOperation::registerForDelayedDeletion(const QStringList &files)
{
@@ -262,7 +277,7 @@ void UpdateOperation::registerForDelayedDeletion(const QStringList &files)
}
/*!
- Tries to delete \a file. If \a file can't be deleted, it gets registered for delayed deletion.
+ Tries to delete \a file. If \a file cannot be deleted, it is registered for delayed deletion.
*/
bool UpdateOperation::deleteFileNowOrLater(const QString &file, QString *errorString)
{
@@ -284,38 +299,40 @@ bool UpdateOperation::deleteFileNowOrLater(const QString &file, QString *errorSt
}
/*!
- \fn virtual void KDUpdater::UpdateOperation::backup() = 0;
+ \fn virtual void KDUpdater::UpdateOperation::backup() = 0;
- Subclasses must implement this function to backup any data before performing the action.
+ Subclasses must implement this function to back up any data before performing the action.
*/
/*!
- \fn virtual bool KDUpdater::UpdateOperation::performOperation() = 0;
+ \fn virtual bool KDUpdater::UpdateOperation::performOperation() = 0;
- Subclasses must implement this function to perform the update operation
+ Subclasses must implement this function to perform the update operation.
*/
/*!
- \fn virtual bool KDUpdater::UpdateOperation::undoOperation() = 0;
+ \fn virtual bool KDUpdater::UpdateOperation::undoOperation() = 0;
- Subclasses must implement this function to perform the reverse of the operation.
+ Subclasses must implement this function to perform the undo of the update operation.
*/
/*!
- \fn virtual bool KDUpdater::UpdateOperation::testOperation() = 0;
+ \fn virtual bool KDUpdater::UpdateOperation::testOperation() = 0;
- Subclasses must implement this function to perform the test operation.
+ Subclasses must implement this function to perform the test operation.
*/
/*!
- \fn virtual bool KDUpdater::UpdateOperation::clone() = 0;
+ \fn virtual bool KDUpdater::UpdateOperation::clone() const = 0;
- Subclasses must implement this function to clone the current operation.
+ Subclasses must implement this function to clone the current operation.
*/
/*!
- Saves this UpdateOperation in XML. You can override this method to store your own extra-data.
- The default implementation is taking care of arguments and values set via setValue.
+ Saves operation arguments and values as XML. You can override this method to store your
+ own extra-data. Extra-data can be any data that you need to store to perform or undo the
+ operation. The default implementation is taking care of arguments and values set via
+ UpdateOperation::setValue().
*/
QDomDocument UpdateOperation::toXml() const
{
@@ -358,8 +375,8 @@ QDomDocument UpdateOperation::toXml() const
}
/*!
- Restores UpdateOperation's arguments and values from the XML document \a doc.
- Returns true on success, otherwise false.
+ Restores operation arguments and values from the XML document \a doc. Returns \c true on
+ success, otherwise \c false.
*/
bool UpdateOperation::fromXml(const QDomDocument &doc)
{
@@ -399,9 +416,10 @@ bool UpdateOperation::fromXml(const QDomDocument &doc)
}
/*!
- Restores UpdateOperation's arguments and values from the XML document at path \a xml.
- Returns true on success, otherwise false.
- \overload
+ \overload
+
+ Restores operation arguments and values from the XML file at path \a xml. Returns \c true on
+ success, otherwise \c false.
*/
bool UpdateOperation::fromXml(const QString &xml)
{
diff --git a/src/libs/kdtools/kdupdaterupdateoperationfactory.cpp b/src/libs/kdtools/kdupdaterupdateoperationfactory.cpp
index 8a2f5aa21..9296bc955 100644
--- a/src/libs/kdtools/kdupdaterupdateoperationfactory.cpp
+++ b/src/libs/kdtools/kdupdaterupdateoperationfactory.cpp
@@ -40,26 +40,37 @@
using namespace KDUpdater;
/*!
- \inmodule kdupdater
- \class KDUpdater::UpdateOperationFactory kdupdaterupdateoperationfactory.h KDUpdaterUpdateOperationFactory
- \brief Factory for \ref KDUpdater::UpdateOperation
+ \inmodule kdupdater
+ \class KDUpdater::UpdateOperationFactory
+ \brief The UpdateOperationFactory class is used to create update operations based on their name.
- This class acts as a factory for \ref KDUpdater::UpdateOperation. You can register
- one or more update operations with this factory and query operations based on their name.
+ This class acts as a factory for \c KDUpdater::UpdateOperation. You can register one or more
+ update operations with this factory and query operations based on their name.
- This class follows the singleton design pattern. Only one instance of this class can
- be created and its reference can be fetched from the \ref instance() method.
+ This class follows the singleton design pattern. Only one instance of this class can be created
+ and its reference can be fetched from the instance() method.
+
+ The following operations are registered by default:
+ \list
+ \li Copy operation
+ \li Move operation
+ \li Delete operation
+ \li Mkdir operation
+ \li Rmdir operation
+ \li AppendFile operation
+ \li PrependFile operation
+ \endlist
*/
/*!
- \fn KDUpdater::UpdateOperationFactory::registerUpdateOperation( const QString& name )
+ \fn void KDUpdater::UpdateOperationFactory::registerUpdateOperation(const QString &name)
- Registers T as new UpdateOperation with \a name. When create() is called with that \a name,
- T is constructed using its default constructor.
+ Registers a new update operation with the factory based on \a name. When create() is called
+ with that \a name, the update operation is constructed using its default constructor.
*/
/*!
- Returns the UpdateOperationFactory instance. The instance is created if needed.
+ Returns the UpdateOperationFactory instance. The instance is created if needed.
*/
UpdateOperationFactory &UpdateOperationFactory::instance()
{
@@ -68,7 +79,7 @@ UpdateOperationFactory &UpdateOperationFactory::instance()
}
/*!
- Constructor
+ Constructor
*/
UpdateOperationFactory::UpdateOperationFactory()
{
diff --git a/src/libs/kdtools/kdupdaterupdateoperationfactory.h b/src/libs/kdtools/kdupdaterupdateoperationfactory.h
index b4c51157b..a4ea6a075 100644
--- a/src/libs/kdtools/kdupdaterupdateoperationfactory.h
+++ b/src/libs/kdtools/kdupdaterupdateoperationfactory.h
@@ -43,8 +43,6 @@ namespace KDUpdater {
class UpdateOperation;
-typedef KDGenericFactory<UpdateOperation>::FactoryFunction UpdateOperationFactoryFunction;
-
class KDTOOLS_EXPORT UpdateOperationFactory : public KDGenericFactory<UpdateOperation>
{
Q_DISABLE_COPY(UpdateOperationFactory)
diff --git a/src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp b/src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp
index 6def0c1fd..96358214e 100644
--- a/src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp
+++ b/src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp
@@ -76,16 +76,35 @@ using namespace KDUpdater;
Error codes related to retrieving update sources.
\value NoError No error occurred.
- \value NotYetReadError The package information was not parsed yet from the XML file.
+ \value NotYetReadError The update source information was not parsed yet from the
+ XML file.
\value CouldNotReadSourceFileError The specified update source file could not be read
- (does not exist or is not readable).
+ (does not exist or is not readable).
\value InvalidXmlError The source file contains invalid XML.
\value InvalidContentError The source file contains valid XML, but does not match the
- expected format for source descriptions.
+ expected format for source descriptions.
\value CouldNotSaveChangesError Changes made to the object could not be saved back to the
- source file.
+ source file.
*/
+/*!
+ \fn void UpdateSourcesInfo::reset()
+
+ This signal is emitted whenever the contents of this UpdateSourcesInfo are refreshed, usually
+ from within the refresh() slot.
+*/
+
+/*!
+ \fn void UpdateSourcesInfo::updateSourceInfoAdded(const UpdateSourceInfo &info)
+
+ This signal is emitted when \c UpdateSourceInfo \a info is added.
+*/
+
+/*!
+ \fn void UpdateSourcesInfo::updateSourceInfoRemoved(const UpdateSourceInfo &info)
+
+ This signal is emitted when \c UpdateSourceInfo \a info is removed.
+*/
struct UpdateSourceInfoPriorityHigherThan
{
@@ -148,7 +167,8 @@ UpdateSourcesInfo::~UpdateSourcesInfo()
}
/*!
- \internal
+ Returns \c true if UpdateSourcesInfo is valid; otherwise returns \c false.
+ You can use the errorString() method to receive a descriptive error message.
*/
bool UpdateSourcesInfo::isValid() const
{
@@ -157,7 +177,7 @@ bool UpdateSourcesInfo::isValid() const
/*!
Returns a human-readable description of the last error that occurred.
- */
+*/
QString UpdateSourcesInfo::errorString() const
{
return d->errorMessage;
@@ -166,25 +186,33 @@ QString UpdateSourcesInfo::errorString() const
/*!
Returns the error that was found during the processing of the update sources XML file. If no
error was found, returns NoError.
- */
+*/
UpdateSourcesInfo::Error UpdateSourcesInfo::error() const
{
return d->error;
}
+/*!
+ Returns the modified state of this object. The modified state defines if there where
+ modifications done to the update-sources that need to be written to the updates XML file
+ that will restore the update-sources on the next run.
+*/
bool UpdateSourcesInfo::isModified() const
{
return d->modified;
}
+/*!
+ Sets the modified state of the object to \a modified.
+*/
void UpdateSourcesInfo::setModified(bool modified)
{
d->modified = modified;
}
/*!
- Sets the complete file name of the update sources XML file. The function also issues a call
- to refresh() to reload package information from the XML file.
+ Sets the complete file name of the update sources XML file to \a fileName. The function also
+ issues a call to refresh() to reload update sources from the XML file.
\sa KDUpdater::Application::setUpdateSourcesXMLFileName()
*/
@@ -198,7 +226,7 @@ void UpdateSourcesInfo::setFileName(const QString &fileName)
}
/*!
- Returns the name of the update sources XML file that this class referred to.
+ Returns the name of the update sources XML file that this class refers to.
*/
QString UpdateSourcesInfo::fileName() const
{
@@ -226,8 +254,8 @@ UpdateSourceInfo UpdateSourcesInfo::updateSourceInfo(int index) const
}
/*!
- Adds an update source info to this class. Upon successful addition, the class emits a
- updateSourceInfoAdded() signal.
+ Adds the given update source info \a info to this class. Upon successful addition, the class
+ emits an updateSourceInfoAdded() signal.
*/
void UpdateSourcesInfo::addUpdateSourceInfo(const UpdateSourceInfo &info)
{
@@ -240,8 +268,8 @@ void UpdateSourcesInfo::addUpdateSourceInfo(const UpdateSourceInfo &info)
}
/*!
- Removes an update source info from this class. Upon successful removal, the class emits a
- updateSourceInfoRemoved() signal.
+ Removes the given update source info \a info from this class. Upon successful removal, the class
+ emits an updateSourceInfoRemoved() signal.
*/
void UpdateSourcesInfo::removeUpdateSourceInfo(const UpdateSourceInfo &info)
{
@@ -399,6 +427,13 @@ void UpdateSourcesInfo::UpdateSourcesInfoData::addChildElement(QDomDocument &doc
*/
/*!
+ \fn UpdateSourceInfo::UpdateSourceInfo()
+
+ Constructs an empty update source info object. The object's priority is set to -1. All other
+ class members are initialized using a \l{default-constructed value}.
+*/
+
+/*!
\variable UpdateSourceInfo::name
\brief The name of the update source.
*/