mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
remove now redundant factory interface classes
the most efficient way to parse plugins metadata (such as keys) is to not do it and (ab)use the plugin base name as the plugin key Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
87ec0537e8
commit
6ccc7ba7fc
19 changed files with 16 additions and 113 deletions
|
@ -623,11 +623,8 @@ katie_generate_obsolete(QHBoxLayout QtGui qboxlayout.h)
|
|||
katie_generate_obsolete(QHelpEvent QtGui qevent.h)
|
||||
katie_generate_obsolete(QHideEvent QtGui qevent.h)
|
||||
katie_generate_obsolete(QHoverEvent QtGui qevent.h)
|
||||
katie_generate_obsolete(QIconEngineFactoryInterface QtGui qiconengineplugin.h)
|
||||
katie_generate_obsolete(QIconEngineFactoryInterfaceV2 QtGui qiconengineplugin.h)
|
||||
katie_generate_obsolete(QIconEnginePluginV2 QtGui qiconengineplugin.h)
|
||||
katie_generate_obsolete(QIconEngineV2 QtGui qiconengine.h)
|
||||
katie_generate_obsolete(QImageIOHandlerFactoryInterface QtGui qimageiohandler.h)
|
||||
katie_generate_obsolete(QImageIOPlugin QtGui qimageiohandler.h)
|
||||
katie_generate_obsolete(QIncompatibleFlag QtCore qglobal.h)
|
||||
katie_generate_obsolete(QInputEvent QtGui qevent.h)
|
||||
|
@ -712,7 +709,6 @@ katie_generate_obsolete(QStandardItem QtGui qstandarditemmodel.h)
|
|||
katie_generate_obsolete(QStatusTipEvent QtGui qevent.h)
|
||||
katie_generate_obsolete(QStringListIterator QtCore qstringlist.h)
|
||||
katie_generate_obsolete(QStringRef QtCore qstring.h)
|
||||
katie_generate_obsolete(QStyleFactoryInterface QtGui qstyleplugin.h)
|
||||
katie_generate_obsolete(QStyleHintReturnMask QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleHintReturn QtGui qstyleoption.h)
|
||||
katie_generate_obsolete(QStyleHintReturnVariant QtGui qstyleoption.h)
|
||||
|
|
|
@ -634,15 +634,12 @@ include/katie/QtGui/QHideEvent
|
|||
include/katie/QtGui/QHoverEvent
|
||||
include/katie/QtGui/QIcon
|
||||
include/katie/QtGui/QIconEngine
|
||||
include/katie/QtGui/QIconEngineFactoryInterface
|
||||
include/katie/QtGui/QIconEngineFactoryInterfaceV2
|
||||
include/katie/QtGui/QIconEnginePlugin
|
||||
include/katie/QtGui/QIconEnginePluginV2
|
||||
include/katie/QtGui/QIconEngineV2
|
||||
include/katie/QtGui/QIdentityProxyModel
|
||||
include/katie/QtGui/QImage
|
||||
include/katie/QtGui/QImageIOHandler
|
||||
include/katie/QtGui/QImageIOHandlerFactoryInterface
|
||||
include/katie/QtGui/QImageIOPlugin
|
||||
include/katie/QtGui/QImageReader
|
||||
include/katie/QtGui/QImageWriter
|
||||
|
@ -750,7 +747,6 @@ include/katie/QtGui/QStatusTipEvent
|
|||
include/katie/QtGui/QStringListModel
|
||||
include/katie/QtGui/QStyle
|
||||
include/katie/QtGui/QStyleFactory
|
||||
include/katie/QtGui/QStyleFactoryInterface
|
||||
include/katie/QtGui/QStyleHintReturn
|
||||
include/katie/QtGui/QStyleHintReturnMask
|
||||
include/katie/QtGui/QStyleHintReturnVariant
|
||||
|
|
|
@ -637,15 +637,12 @@ include/katie/QtGui/QHideEvent
|
|||
include/katie/QtGui/QHoverEvent
|
||||
include/katie/QtGui/QIcon
|
||||
include/katie/QtGui/QIconEngine
|
||||
include/katie/QtGui/QIconEngineFactoryInterface
|
||||
include/katie/QtGui/QIconEngineFactoryInterfaceV2
|
||||
include/katie/QtGui/QIconEnginePlugin
|
||||
include/katie/QtGui/QIconEnginePluginV2
|
||||
include/katie/QtGui/QIconEngineV2
|
||||
include/katie/QtGui/QIdentityProxyModel
|
||||
include/katie/QtGui/QImage
|
||||
include/katie/QtGui/QImageIOHandler
|
||||
include/katie/QtGui/QImageIOHandlerFactoryInterface
|
||||
include/katie/QtGui/QImageIOPlugin
|
||||
include/katie/QtGui/QImageReader
|
||||
include/katie/QtGui/QImageWriter
|
||||
|
@ -753,7 +750,6 @@ include/katie/QtGui/QStatusTipEvent
|
|||
include/katie/QtGui/QStringListModel
|
||||
include/katie/QtGui/QStyle
|
||||
include/katie/QtGui/QStyleFactory
|
||||
include/katie/QtGui/QStyleFactoryInterface
|
||||
include/katie/QtGui/QStyleHintReturn
|
||||
include/katie/QtGui/QStyleHintReturnMask
|
||||
include/katie/QtGui/QStyleHintReturnVariant
|
||||
|
|
|
@ -642,15 +642,12 @@ include/katie/QtGui/QHideEvent
|
|||
include/katie/QtGui/QHoverEvent
|
||||
include/katie/QtGui/QIcon
|
||||
include/katie/QtGui/QIconEngine
|
||||
include/katie/QtGui/QIconEngineFactoryInterface
|
||||
include/katie/QtGui/QIconEngineFactoryInterfaceV2
|
||||
include/katie/QtGui/QIconEnginePlugin
|
||||
include/katie/QtGui/QIconEnginePluginV2
|
||||
include/katie/QtGui/QIconEngineV2
|
||||
include/katie/QtGui/QIdentityProxyModel
|
||||
include/katie/QtGui/QImage
|
||||
include/katie/QtGui/QImageIOHandler
|
||||
include/katie/QtGui/QImageIOHandlerFactoryInterface
|
||||
include/katie/QtGui/QImageIOPlugin
|
||||
include/katie/QtGui/QImageReader
|
||||
include/katie/QtGui/QImageWriter
|
||||
|
@ -758,7 +755,6 @@ include/katie/QtGui/QStatusTipEvent
|
|||
include/katie/QtGui/QStringListModel
|
||||
include/katie/QtGui/QStyle
|
||||
include/katie/QtGui/QStyleFactory
|
||||
include/katie/QtGui/QStyleFactoryInterface
|
||||
include/katie/QtGui/QStyleHintReturn
|
||||
include/katie/QtGui/QStyleHintReturnMask
|
||||
include/katie/QtGui/QStyleHintReturnVariant
|
||||
|
|
|
@ -202,11 +202,8 @@ incmap = {
|
|||
'QHelpEvent': 'qevent.h',
|
||||
'QHideEvent': 'qevent.h',
|
||||
'QHoverEvent': 'qevent.h',
|
||||
'QIconEngineFactoryInterface': 'qiconengineplugin.h',
|
||||
'QIconEngineFactoryInterfaceV2': 'qiconengineplugin.h',
|
||||
'QIconEnginePluginV2': 'qiconengineplugin.h',
|
||||
'QIconEngineV2': 'qiconengine.h',
|
||||
'QImageIOHandlerFactoryInterface': 'qimageiohandler.h',
|
||||
'QImageIOPlugin': 'qimageiohandler.h',
|
||||
'QInputEvent': 'qevent.h',
|
||||
'QIntValidator': 'qvalidator.h',
|
||||
|
@ -243,7 +240,6 @@ incmap = {
|
|||
'QStandardItem': 'qstandarditemmodel.h',
|
||||
'QStandardItemEditorCreator': 'qitemeditorfactory.h',
|
||||
'QStatusTipEvent': 'qevent.h',
|
||||
'QStyleFactoryInterface': 'qstyleplugin.h',
|
||||
'QStyleHintReturn': 'qstyleoption.h',
|
||||
'QStyleHintReturnMask': 'qstyleoption.h',
|
||||
'QStyleHintReturnVariant': 'qstyleoption.h',
|
||||
|
|
|
@ -282,15 +282,12 @@ classlist = [
|
|||
"QHoverEvent",
|
||||
"QIcon",
|
||||
"QIconEngine",
|
||||
"QIconEngineFactoryInterface",
|
||||
"QIconEngineFactoryInterfaceV2",
|
||||
"QIconEnginePlugin",
|
||||
"QIconEnginePluginV2",
|
||||
"QIconEngineV2",
|
||||
"QIdentityProxyModel",
|
||||
"QImage",
|
||||
"QImageIOHandler",
|
||||
"QImageIOHandlerFactoryInterface",
|
||||
"QImageIOPlugin",
|
||||
"QImageReader",
|
||||
"QImageWriter",
|
||||
|
@ -510,7 +507,6 @@ classlist = [
|
|||
"QStyle",
|
||||
"QStyledItemDelegate",
|
||||
"QStyleFactory",
|
||||
"QStyleFactoryInterface",
|
||||
"QStyleHintReturn",
|
||||
"QStyleHintReturnMask",
|
||||
"QStyleHintReturnVariant",
|
||||
|
|
|
@ -1632,10 +1632,10 @@ QStringList QCoreApplication::libraryPaths()
|
|||
QMutexLocker locker(qGlobalAppPathsMutex());
|
||||
|
||||
if (coreappdata()->app_librarypaths.isEmpty()) {
|
||||
const QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::LibrariesPath);
|
||||
if (QDir(installPathPlugins).exists()
|
||||
&& !coreappdata()->app_librarypaths.contains(installPathPlugins)) {
|
||||
coreappdata()->app_librarypaths.append(installPathPlugins);
|
||||
const QString installPathLibraries = QLibraryInfo::location(QLibraryInfo::LibrariesPath);
|
||||
if (QDir(installPathLibraries).exists()
|
||||
&& !coreappdata()->app_librarypaths.contains(installPathLibraries)) {
|
||||
coreappdata()->app_librarypaths.append(installPathLibraries);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ public:
|
|||
~QFactoryLoaderPrivate();
|
||||
|
||||
QMutex mutex;
|
||||
QByteArray iid;
|
||||
QMap<QString,QPluginLoader*> pluginMap;
|
||||
QMap<QString,QString> keyMap;
|
||||
QString suffix;
|
||||
|
@ -56,7 +55,7 @@ QFactoryLoaderPrivate::QFactoryLoaderPrivate()
|
|||
QFactoryLoaderPrivate::~QFactoryLoaderPrivate()
|
||||
{
|
||||
if (qt_debug_component()) {
|
||||
qDebug() << "QFactoryLoader: unloading" << iid << pluginMap.keys();
|
||||
qDebug() << "QFactoryLoader: unloading" << pluginMap.keys();
|
||||
}
|
||||
foreach (QPluginLoader *loader, pluginMap.values()) {
|
||||
loader->unload();
|
||||
|
@ -64,11 +63,10 @@ QFactoryLoaderPrivate::~QFactoryLoaderPrivate()
|
|||
}
|
||||
}
|
||||
|
||||
QFactoryLoader::QFactoryLoader(const char *iid, const QString &suffix)
|
||||
QFactoryLoader::QFactoryLoader(const QString &suffix)
|
||||
: d_ptr(new QFactoryLoaderPrivate())
|
||||
{
|
||||
Q_D(QFactoryLoader);
|
||||
d->iid = iid;
|
||||
d->suffix = suffix;
|
||||
|
||||
QMutexLocker locker(qGlobalFactoryLoaderMutex());
|
||||
|
|
|
@ -45,7 +45,7 @@ class QFactoryLoaderPrivate;
|
|||
class Q_CORE_EXPORT QFactoryLoader
|
||||
{
|
||||
public:
|
||||
QFactoryLoader(const char *iid, const QString &suffix);
|
||||
QFactoryLoader(const QString &suffix);
|
||||
~QFactoryLoader();
|
||||
|
||||
QStringList keys() const;
|
||||
|
|
|
@ -371,8 +371,6 @@ bool QLibraryPrivate::isPlugin()
|
|||
return pluginState == IsAPlugin;
|
||||
|
||||
#ifndef QT_NO_PLUGIN_CHECK
|
||||
bool success = false;
|
||||
|
||||
if (Q_UNLIKELY(fileName.endsWith(QLatin1String(".debug")))) {
|
||||
// refuse to load a file that ends in .debug
|
||||
// these are the debug symbols from the libraries
|
||||
|
@ -386,7 +384,7 @@ bool QLibraryPrivate::isPlugin()
|
|||
}
|
||||
|
||||
// use unix shortcut to avoid loading the library
|
||||
success = qt_unix_query(fileName, &qt_version, this);
|
||||
bool success = qt_unix_query(fileName, &qt_version, this);
|
||||
|
||||
if (!success) {
|
||||
if (errorString.isEmpty()){
|
||||
|
|
|
@ -28,21 +28,7 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
class QIconEngine;
|
||||
|
||||
struct Q_GUI_EXPORT QIconEngineFactoryInterface
|
||||
{
|
||||
virtual QIconEngine *create(const QString &filename= QString()) = 0;
|
||||
};
|
||||
typedef QIconEngineFactoryInterface QIconEngineFactoryInterfaceV2;
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#define QIconEngineFactoryInterface_iid \
|
||||
"Katie.QIconEngineFactoryInterface"
|
||||
Q_DECLARE_INTERFACE(QIconEngineFactoryInterface, QIconEngineFactoryInterface_iid)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Q_GUI_EXPORT QIconEnginePlugin : public QObject, public QIconEngineFactoryInterface
|
||||
class Q_GUI_EXPORT QIconEnginePlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -136,19 +136,7 @@
|
|||
\value CanWrite The plugin can write images.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class QImageIOHandlerFactoryInterface
|
||||
\brief The QImageIOHandlerFactoryInterface class provides the factory
|
||||
interface for QImageIOPlugin.
|
||||
\reentrant
|
||||
|
||||
\internal
|
||||
|
||||
\sa QImageIOPlugin
|
||||
*/
|
||||
|
||||
#include "qimageiohandler.h"
|
||||
|
||||
#include "qbytearray.h"
|
||||
#include "qimage.h"
|
||||
#include "qvariant.h"
|
||||
|
|
|
@ -81,19 +81,7 @@ private:
|
|||
QImageIOHandlerPrivate *d_ptr;
|
||||
};
|
||||
|
||||
struct Q_GUI_EXPORT QImageIOHandlerFactoryInterface
|
||||
{
|
||||
virtual QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const = 0;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#define QImageIOHandlerFactoryInterface_iid "Katie.QImageIOHandlerFactoryInterface"
|
||||
Q_DECLARE_INTERFACE(QImageIOHandlerFactoryInterface, QImageIOHandlerFactoryInterface_iid)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Q_GUI_EXPORT QImageIOPlugin : public QObject, public QImageIOHandlerFactoryInterface
|
||||
class Q_GUI_EXPORT QImageIOPlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_LIBRARY
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, platformLoader,
|
||||
(QGuiPlatformPluginInterface_iid, QString::fromLatin1("/gui_platform")))
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, platformLoader, (QString::fromLatin1("/gui_platform")))
|
||||
#endif
|
||||
|
||||
/*! \internal
|
||||
|
|
|
@ -33,18 +33,7 @@ class QFileDialog;
|
|||
class QColorDialog;
|
||||
class QFileInfo;
|
||||
|
||||
struct Q_GUI_EXPORT QGuiPlatformPluginInterface
|
||||
{
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#define QGuiPlatformPluginInterface_iid "Katie.QGuiPlatformPluginInterface"
|
||||
Q_DECLARE_INTERFACE(QGuiPlatformPluginInterface, QGuiPlatformPluginInterface_iid)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Q_GUI_EXPORT QGuiPlatformPlugin : public QObject, public QGuiPlatformPluginInterface
|
||||
class Q_GUI_EXPORT QGuiPlatformPlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -83,11 +83,8 @@ inline static QImage replaceColors(const QImage &source, const QMap<QRgb, QRgb>
|
|||
Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget)
|
||||
|
||||
#if !defined(QT_NO_LIBRARY)
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, iconloader,
|
||||
(QIconEngineFactoryInterface_iid, QString::fromLatin1("/iconengines")))
|
||||
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, imageloader,
|
||||
(QImageIOHandlerFactoryInterface_iid, QString::fromLatin1("/imageformats")))
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, iconloader, (QString::fromLatin1("/iconengines")))
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, imageloader, (QString::fromLatin1("/imageformats")))
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_TABBAR
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_LIBRARY
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, stylesloader,
|
||||
(QStyleFactoryInterface_iid, QString::fromLatin1("/styles")))
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, stylesloader, (QString::fromLatin1("/styles")))
|
||||
#endif
|
||||
|
||||
/*!
|
||||
|
|
|
@ -29,19 +29,7 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
class QStyle;
|
||||
|
||||
struct Q_GUI_EXPORT QStyleFactoryInterface
|
||||
{
|
||||
virtual QStyle *create(const QString &key) = 0;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#define QStyleFactoryInterface_iid "Katie.QStyleFactoryInterface"
|
||||
Q_DECLARE_INTERFACE(QStyleFactoryInterface, QStyleFactoryInterface_iid)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Q_GUI_EXPORT QStylePlugin : public QObject, public QStyleFactoryInterface
|
||||
class Q_GUI_EXPORT QStylePlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -307,12 +307,10 @@ static const struct ClassTblData {
|
|||
{ QLatin1String("QIPv6Address"), QLatin1String("QtNetwork/qhostaddress.h") },
|
||||
{ QLatin1String("QIcon"), QLatin1String("QtGui/qicon.h") },
|
||||
{ QLatin1String("QIconEngine"), QLatin1String("QtGui/qiconengine.h") },
|
||||
{ QLatin1String("QIconEngineFactoryInterface"), QLatin1String("QtGui/qiconengineplugin.h") },
|
||||
{ QLatin1String("QIconEnginePlugin"), QLatin1String("QtGui/qiconengineplugin.h") },
|
||||
{ QLatin1String("QIdentityProxyModel"), QLatin1String("QtGui/qidentityproxymodel.h") },
|
||||
{ QLatin1String("QImage"), QLatin1String("QtGui/qimage.h") },
|
||||
{ QLatin1String("QImageIOHandler"), QLatin1String("QtGui/qimageiohandler.h") },
|
||||
{ QLatin1String("QImageIOHandlerFactoryInterface"), QLatin1String("QtGui/qimageiohandler.h") },
|
||||
{ QLatin1String("QImageIOPlugin"), QLatin1String("QtGui/qimageiohandler.h") },
|
||||
{ QLatin1String("QImageReader"), QLatin1String("QtGui/qimagereader.h") },
|
||||
{ QLatin1String("QImageWriter"), QLatin1String("QtGui/qimagewriter.h") },
|
||||
|
@ -483,7 +481,6 @@ static const struct ClassTblData {
|
|||
{ QLatin1String("QStringRef"), QLatin1String("QtCore/qstring.h") },
|
||||
{ QLatin1String("QStyle"), QLatin1String("QtGui/qstyle.h") },
|
||||
{ QLatin1String("QStyleFactory"), QLatin1String("QtGui/qstylefactory.h") },
|
||||
{ QLatin1String("QStyleFactoryInterface"), QLatin1String("QtGui/qstyleplugin.h") },
|
||||
{ QLatin1String("QStyleHintReturn"), QLatin1String("QtGui/qstyleoption.h") },
|
||||
{ QLatin1String("QStyleHintReturnMask"), QLatin1String("QtGui/qstyleoption.h") },
|
||||
{ QLatin1String("QStyleHintReturnVariant"), QLatin1String("QtGui/qstyleoption.h") },
|
||||
|
|
Loading…
Add table
Reference in a new issue