summaryrefslogtreecommitdiffstats
path: root/installerbuilder
diff options
context:
space:
mode:
authorhjk <qthjk@ovi.com>2011-11-19 23:13:43 +0100
committerTim Jenssen <tim.jenssen@nokia.com>2011-11-21 13:15:46 +0100
commit81ad56fdd0afe3baf84ad1fb3fa2c64326b92796 (patch)
tree8784e75d27eb80308edde0555294267f47c6b131 /installerbuilder
parent77e3bf712c785b4d68695933ac929ec6a22555fc (diff)
Remove unused parts of KDGenericFactory.
Change-Id: I6419a6aaf6c511c05d576028005c9def4f1a3ca9 Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder')
-rw-r--r--installerbuilder/libinstaller/3rdparty/kdtools/kdgenericfactory.h29
-rw-r--r--installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.cpp17
-rw-r--r--installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.h3
-rw-r--r--installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.cpp33
-rw-r--r--installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.h6
5 files changed, 4 insertions, 84 deletions
diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdgenericfactory.h b/installerbuilder/libinstaller/3rdparty/kdtools/kdgenericfactory.h
index da4957016..f48b70923 100644
--- a/installerbuilder/libinstaller/3rdparty/kdtools/kdgenericfactory.h
+++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdgenericfactory.h
@@ -27,7 +27,7 @@
#include <QtCore/QHash>
-template <typename T_Product, typename T_Identifier = QString, template<typename U, typename V> class T_Map = QHash>
+template <typename T_Product, typename T_Identifier = QString>
class KDGenericFactory
{
public:
@@ -39,38 +39,17 @@ public:
void registerProduct(const T_Identifier &name)
{
FactoryFunction function = &KDGenericFactory::create<T>;
- registerProductionFunction(name, function);
- }
-
- void unregisterProduct(const T_Identifier &name)
- {
- map.remove(name);
- }
-
- unsigned int productCount() const
- {
- return map.size();
- }
-
- QList<T_Identifier> availableProducts() const
- {
- return map.keys();
+ map.insert(name, function);
}
T_Product *create(const T_Identifier &name) const
{
- const typename T_Map<T_Identifier, FactoryFunction>::const_iterator it = map.find(name);
+ const typename QHash<T_Identifier, FactoryFunction>::const_iterator it = map.find(name);
if (it == map.end())
return 0;
return (*it)();
}
-protected:
- void registerProductionFunction(const T_Identifier &name, FactoryFunction create)
- {
- map.insert(name, create);
- }
-
private:
template <typename T>
static T_Product *create()
@@ -78,7 +57,7 @@ private:
return new T;
}
- T_Map<T_Identifier, FactoryFunction> map;
+ QHash<T_Identifier, FactoryFunction> map;
};
#endif
diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.cpp b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.cpp
index ea6fe5650..7bad5c92f 100644
--- a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.cpp
+++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.cpp
@@ -112,20 +112,3 @@ FileDownloader *FileDownloaderFactory::create(const QString &scheme, const Signa
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 transfered to the factory.
*/
-
-/*!
- Returns the number of file downloaders in the factory.
-*/
-int FileDownloaderFactory::fileDownloaderCount() const
-{
- return productCount();
-}
-
-/*!
- Returns a list of schemes supported by this factory, i.e. for which a
- FileDownloader was registered.
-*/
-QStringList FileDownloaderFactory::supportedSchemes() const
-{
- return availableProducts();
-}
diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.h b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.h
index be87f8c08..3f40880d4 100644
--- a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.h
+++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloaderfactory.h
@@ -51,9 +51,6 @@ public:
{
registerProduct<T>(scheme);
}
- QStringList supportedSchemes() const;
-
- int fileDownloaderCount() const;
FileDownloader *create(const QString &scheme, QObject *parent) const;
FileDownloader *create(const QString &scheme, const SignatureVerifier *verifier = 0,
const QUrl &signatureUrl = QUrl(), QObject *parent = 0) const;
diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.cpp b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.cpp
index ffb06b3e1..aab8f6c2d 100644
--- a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.cpp
+++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.cpp
@@ -72,36 +72,3 @@ UpdateOperationFactory::UpdateOperationFactory()
registerUpdateOperation<UpdatePackageOperation>(QLatin1String("UpdatePackage"));
registerUpdateOperation<UpdateCompatOperation>(QLatin1String("UpdateCompat"));
}
-
-/*!
- Returns the number of update operations in the factory.
-*/
-int UpdateOperationFactory::updateOperationCount() const
-{
- return productCount();
-}
-
-/*!
- Returns a list containing the names of all available UpdateOperations.
-*/
-QStringList UpdateOperationFactory::availableUpdateOperations() const
-{
- return availableProducts();
-}
-
-/*
- Unregisters the update operation previously registered with \a name.
-*/
-void UpdateOperationFactory::unregisterUpdateOperation(const QString &name)
-{
- unregisterProduct(name);
-}
-
-/*!
- Registers \a create to be a factory function to create an UpdateOperation with \a name.
- \sa registerUpdateOperation
-*/
-void UpdateOperationFactory::registerUpdateOperationFactory(const QString &name, UpdateOperationFactoryFunction create)
-{
- registerProductionFunction(name, create);
-}
diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.h b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.h
index e7bd1a315..c21727f78 100644
--- a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.h
+++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdateoperationfactory.h
@@ -45,12 +45,6 @@ public:
{
registerProduct<T>(name);
}
- void registerUpdateOperationFactory(const QString &name, UpdateOperationFactoryFunction create);
-
- void unregisterUpdateOperation(const QString &name);
-
- int updateOperationCount() const;
- QStringList availableUpdateOperations() const;
protected:
UpdateOperationFactory();