Widgets: Remove obsolete QGuiPlatformPlugin.
It has been superseeded by QPlatformTheme. Task-number: QTBUG-24204 Change-Id: I8c4131c7bfd8201e747984d772ed8042610192b8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
This commit is contained in:
parent
3efb0d50e5
commit
93af98f72a
@ -47,7 +47,6 @@
|
||||
#include <qdir.h>
|
||||
#include <qpixmapcache.h>
|
||||
#include <private/qfunctions_p.h>
|
||||
#include <private/qguiplatformplugin_p.h>
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
# define _WIN32_IE 0x0500
|
||||
@ -399,10 +398,6 @@ QIcon QFileIconProvider::icon(const QFileInfo &info) const
|
||||
{
|
||||
Q_D(const QFileIconProvider);
|
||||
|
||||
QIcon platformIcon = qt_guiPlatformPlugin()->fileSystemIcon(info);
|
||||
if (!platformIcon.isNull())
|
||||
return platformIcon;
|
||||
|
||||
#if defined(Q_WS_X11) && !defined(QT_NO_STYLE_GTK)
|
||||
if (X11->desktopEnvironment == DE_GNOME) {
|
||||
QIcon gtkIcon = QGtkStylePrivate::getFilesystemIcon(info);
|
||||
|
@ -40,7 +40,6 @@ HEADERS += \
|
||||
kernel/qgesturemanager_p.h \
|
||||
kernel/qsoftkeymanager_p.h \
|
||||
kernel/qsoftkeymanager_common_p.h \
|
||||
kernel/qguiplatformplugin_p.h \
|
||||
kernel/qdesktopwidget_qpa_p.h \
|
||||
kernel/qwidgetwindow_qpa_p.h \
|
||||
kernel/qplatformmenu_qpa.h
|
||||
@ -72,7 +71,6 @@ SOURCES += \
|
||||
kernel/qgesturemanager.cpp \
|
||||
kernel/qsoftkeymanager.cpp \
|
||||
kernel/qdesktopwidget.cpp \
|
||||
kernel/qguiplatformplugin.cpp \
|
||||
kernel/qwidgetsvariant.cpp \
|
||||
kernel/qapplication_qpa.cpp \
|
||||
kernel/qdesktopwidget_qpa.cpp \
|
||||
|
@ -80,8 +80,6 @@
|
||||
#include <private/qt_x11_p.h>
|
||||
#endif
|
||||
|
||||
#include "qguiplatformplugin_p.h"
|
||||
|
||||
#include <qthread.h>
|
||||
#include <private/qthread_p.h>
|
||||
|
||||
@ -758,10 +756,6 @@ void QApplicationPrivate::construct(
|
||||
qCritical("Library qttestability load failed!");
|
||||
}
|
||||
}
|
||||
|
||||
//make sure the plugin is loaded
|
||||
if (qt_is_gui_used)
|
||||
qt_guiPlatformPlugin();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1,134 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qguiplatformplugin_p.h"
|
||||
#include <qdebug.h>
|
||||
#include <qfile.h>
|
||||
#include <qdir.h>
|
||||
#include <qsettings.h>
|
||||
#include "private/qfactoryloader_p.h"
|
||||
#include "qstylefactory.h"
|
||||
#include "qapplication.h"
|
||||
#include "qplatformdefs.h"
|
||||
#include "qicon.h"
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
extern bool qt_wince_is_smartphone(); //qguifunctions_wince.cpp
|
||||
extern bool qt_wince_is_mobile(); //qguifunctions_wince.cpp
|
||||
extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(Q_WS_X11)
|
||||
#include <private/qkde_p.h>
|
||||
#include <private/qgtkstyle_p.h>
|
||||
#include <private/qt_x11_p.h>
|
||||
#endif
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
/*! \internal
|
||||
Return (an construct if necesseray) the Gui Platform plugin.
|
||||
|
||||
The plugin key to be loaded is inside the QT_PLATFORM_PLUGIN environment variable.
|
||||
If it is not set, it will be the DESKTOP_SESSION on X11.
|
||||
|
||||
If no plugin can be loaded, the default one is returned.
|
||||
*/
|
||||
QGuiPlatformPlugin *qt_guiPlatformPlugin()
|
||||
{
|
||||
static QGuiPlatformPlugin *plugin;
|
||||
if (!plugin)
|
||||
{
|
||||
#ifndef QT_NO_LIBRARY
|
||||
|
||||
QString key = QString::fromLocal8Bit(qgetenv("QT_PLATFORM_PLUGIN"));
|
||||
#ifdef Q_WS_X11
|
||||
if (key.isEmpty()) {
|
||||
switch(X11->desktopEnvironment) {
|
||||
case DE_KDE:
|
||||
key = QString::fromLatin1("kde");
|
||||
break;
|
||||
default:
|
||||
key = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!key.isEmpty() && QApplication::desktopSettingsAware()) {
|
||||
QFactoryLoader loader(QGuiPlatformPluginInterface_iid, QLatin1String("/gui_platform"));
|
||||
plugin = qobject_cast<QGuiPlatformPlugin *>(loader.instance(key));
|
||||
}
|
||||
#endif // QT_NO_LIBRARY
|
||||
|
||||
if(!plugin) {
|
||||
static QGuiPlatformPlugin def;
|
||||
plugin = &def;
|
||||
}
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
|
||||
/* \class QPlatformPlugin
|
||||
QGuiPlatformPlugin can be used to integrate Qt applications in a platform built on top of Qt.
|
||||
The application developer should not know or use the plugin, it is only used by Qt internaly.
|
||||
|
||||
But full platforms that are built on top of Qt may provide a plugin so 3rd party Qt applications
|
||||
running on the platform are integrated.
|
||||
*/
|
||||
|
||||
/*
|
||||
The constructor can be used to install hooks in Qt
|
||||
*/
|
||||
QGuiPlatformPlugin::QGuiPlatformPlugin(QObject *parent) : QObject(parent) {}
|
||||
QGuiPlatformPlugin::~QGuiPlatformPlugin() {}
|
||||
|
||||
/* backend for QFileIconProvider, null icon means default */
|
||||
QIcon QGuiPlatformPlugin::fileSystemIcon(const QFileInfo &)
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
@ -1,101 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QGUIPLATFORM_P_H
|
||||
#define QGUIPLATFORM_P_H
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/qfactoryinterface.h>
|
||||
#include <QtWidgets/qdialog.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
class QStyle;
|
||||
class QPalette;
|
||||
class QIcon;
|
||||
class QFileDialog;
|
||||
class QColorDialog;
|
||||
class QFileInfo;
|
||||
|
||||
struct Q_WIDGETS_EXPORT QGuiPlatformPluginInterface : public QFactoryInterface
|
||||
{
|
||||
};
|
||||
|
||||
#define QGuiPlatformPluginInterface_iid "com.nokia.qt.QGuiPlatformPluginInterface"
|
||||
|
||||
Q_DECLARE_INTERFACE(QGuiPlatformPluginInterface, QGuiPlatformPluginInterface_iid)
|
||||
|
||||
class Q_WIDGETS_EXPORT QGuiPlatformPlugin : public QObject, public QGuiPlatformPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGuiPlatformPluginInterface:QFactoryInterface)
|
||||
public:
|
||||
explicit QGuiPlatformPlugin(QObject *parent = 0);
|
||||
~QGuiPlatformPlugin();
|
||||
|
||||
virtual QStringList keys() const { return QStringList(QStringLiteral("default")); }
|
||||
|
||||
virtual QIcon fileSystemIcon(const QFileInfo &);
|
||||
};
|
||||
|
||||
//internal
|
||||
QGuiPlatformPlugin *qt_guiPlatformPlugin();
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
|
||||
#endif // QGUIPLATFORMPLUGIN_H
|
Loading…
Reference in New Issue
Block a user