Don't try to load plugins if QT_NO_LIBRARY is set.

Any plugin loading is impossible then and the code won't even compile.

Change-Id: I81e49ff87ae1a609521d526f5098a0d44cc28f7c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
bb10
Ulf Hermann 2015-06-11 17:39:15 +02:00
parent 7f85fb4654
commit 2cbd318f1d
3 changed files with 10 additions and 0 deletions

View File

@ -55,6 +55,7 @@ QPlatformPrinterSupportPlugin::~QPlatformPrinterSupportPlugin()
static QPlatformPrinterSupport *printerSupport = 0;
#ifndef QT_NO_LIBRARY
static void cleanupPrinterSupport()
{
#ifndef QT_NO_PRINTER
@ -62,6 +63,7 @@ static void cleanupPrinterSupport()
#endif
printerSupport = 0;
}
#endif // !QT_NO_LIBRARY
/*!
\internal
@ -73,6 +75,7 @@ static void cleanupPrinterSupport()
*/
QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
{
#ifndef QT_NO_LIBRARY
if (!printerSupport) {
const QMultiMap<int, QString> keyMap = loader()->keyMap();
if (!keyMap.isEmpty())
@ -80,6 +83,7 @@ QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
if (printerSupport)
qAddPostRoutine(cleanupPrinterSupport);
}
#endif // !QT_NO_LIBRARY
return printerSupport;
}

View File

@ -93,6 +93,7 @@ namespace QGtk2PainterPrivate {
static void initGtk()
{
#ifndef QT_NO_LIBRARY
static bool initialized = false;
if (!initialized) {
// enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
@ -123,6 +124,7 @@ static void initGtk()
initialized = true;
}
#endif // !QT_NO_LIBRARY
}
// To recover alpha we apply the gtk painting function two times to

View File

@ -326,6 +326,7 @@ void QGtkStylePrivate::gtkWidgetSetFocus(GtkWidget *widget, bool focus)
*/
void QGtkStylePrivate::resolveGtk() const
{
#ifndef QT_NO_LIBRARY
// enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
@ -427,6 +428,7 @@ void QGtkStylePrivate::resolveGtk() const
gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("gnomeui-2"), 0, "gnome_icon_lookup_sync");
gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("gnomevfs-2"), 0, "gnome_vfs_init");
#endif // !QT_NO_LIBRARY
}
/* \internal
@ -593,11 +595,13 @@ void QGtkStylePrivate::cleanupGtkWidgets()
static bool resolveGConf()
{
#ifndef QT_NO_LIBRARY
if (!QGtkStylePrivate::gconf_client_get_default) {
QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_default");
QGtkStylePrivate::gconf_client_get_string = (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_string");
QGtkStylePrivate::gconf_client_get_bool = (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_bool");
}
#endif // !QT_NO_LIBRARY
return (QGtkStylePrivate::gconf_client_get_default !=0);
}