aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-09-10 12:38:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-10 13:29:38 +0200
commit539ad4ea0de61bb12d398032bdc59e3671694116 (patch)
tree445f60f22335add30329a3910c653ee1b739c378 /src
parent105d6758d96e2c723c885efa4dc82938f2cc2d1f (diff)
Tidy up the QML extension plugin
Remove redundant qwinextrasplugin.h, fix Q_PLUGIN_METADATA(), and rename qwinextrasplugin.cpp to plugin.cpp to follow the established convention in qtdeclarative/src/imports. Change-Id: I6f2f710283cfdd43fa15b01dcc63bcb65ab1eca7 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/imports/winextras/plugin.cpp (renamed from src/imports/winextras/qwinextrasplugin.cpp)35
-rw-r--r--src/imports/winextras/qwinextrasplugin.h64
-rw-r--r--src/imports/winextras/winextras.pro3
3 files changed, 20 insertions, 82 deletions
diff --git a/src/imports/winextras/qwinextrasplugin.cpp b/src/imports/winextras/plugin.cpp
index 390e024..f165770 100644
--- a/src/imports/winextras/qwinextrasplugin.cpp
+++ b/src/imports/winextras/plugin.cpp
@@ -39,7 +39,6 @@
**
****************************************************************************/
-#include "qwinextrasplugin.h"
#include "qquickwindwmfeatures.h"
#include "qquickwintaskbarbutton.h"
#include "qquickjumplist.h"
@@ -50,22 +49,26 @@
QT_BEGIN_NAMESPACE
-QWinExtrasQmlPlugin::QWinExtrasQmlPlugin(QObject *parent) :
- QQmlExtensionPlugin(parent)
+class QWinExtrasQmlPlugin : public QQmlExtensionPlugin
{
-}
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0")
-void QWinExtrasQmlPlugin::registerTypes(const char *uri)
-{
- Q_ASSERT(uri == QLatin1String("QtWinExtras"));
- qmlRegisterType<QQuickWinDwmFeatures>(uri, 1, 0, "DwmFeatures");
- qmlRegisterType<QQuickWinTaskbarButton>(uri, 1, 0, "TaskbarButton");
- qmlRegisterUncreatableType<QWinTaskbarProgress>(uri, 1, 0, "TaskbarProgress", "Cannot create TaskbarProgress - use TaskbarButton.progress instead.");
- qmlRegisterType<QQuickJumpList>(uri, 1, 0, "JumpList");
- qmlRegisterType<QQuickJumpListItem>(uri, 1, 0, "JumpListItem");
- qmlRegisterType<QQuickJumpListCategory>(uri, 1, 0, "JumpListCategory");
- qmlRegisterType<QQuickWinThumbnailToolBar>(uri, 1, 0, "ThumbnailToolBar");
- qmlRegisterType<QQuickWinThumbnailToolButton>(uri, 1, 0, "ThumbnailToolButton");
-}
+public:
+ void registerTypes(const char *uri) Q_DECL_OVERRIDE
+ {
+ Q_ASSERT(uri == QLatin1String("QtWinExtras"));
+ qmlRegisterType<QQuickWinDwmFeatures>(uri, 1, 0, "DwmFeatures");
+ qmlRegisterType<QQuickWinTaskbarButton>(uri, 1, 0, "TaskbarButton");
+ qmlRegisterUncreatableType<QWinTaskbarProgress>(uri, 1, 0, "TaskbarProgress", "Cannot create TaskbarProgress - use TaskbarButton.progress instead.");
+ qmlRegisterType<QQuickJumpList>(uri, 1, 0, "JumpList");
+ qmlRegisterType<QQuickJumpListItem>(uri, 1, 0, "JumpListItem");
+ qmlRegisterType<QQuickJumpListCategory>(uri, 1, 0, "JumpListCategory");
+ qmlRegisterType<QQuickWinThumbnailToolBar>(uri, 1, 0, "ThumbnailToolBar");
+ qmlRegisterType<QQuickWinThumbnailToolButton>(uri, 1, 0, "ThumbnailToolButton");
+ }
+};
QT_END_NAMESPACE
+
+#include "plugin.moc"
diff --git a/src/imports/winextras/qwinextrasplugin.h b/src/imports/winextras/qwinextrasplugin.h
deleted file mode 100644
index f1e3d2a..0000000
--- a/src/imports/winextras/qwinextrasplugin.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
- **
- ** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com>
- ** Contact: http://www.qt-project.org/legal
- **
- ** This file is part of the QtWinExtras module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:LGPL$
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and Digia. For licensing terms and
- ** conditions see http://qt.digia.com/licensing. For further information
- ** use the contact form at http://qt.digia.com/contact-us.
- **
- ** GNU Lesser General Public License Usage
- ** Alternatively, 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, Digia gives you certain additional
- ** rights. These rights are described in the Digia 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.
- **
- **
- ** $QT_END_LICENSE$
- **
- ****************************************************************************/
-
-#ifndef QWINEXTRASPLUGIN_H
-#define QWINEXTRASPLUGIN_H
-
-#include <QQmlExtensionPlugin>
-
-QT_BEGIN_NAMESPACE
-
-class QJSEngine;
-class QQuickWinExtras;
-
-class QWinExtrasQmlPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QWinExtrasQmlPlugin")
-
-public:
- explicit QWinExtrasQmlPlugin(QObject *parent = 0);
- void registerTypes(const char *uri) Q_DECL_OVERRIDE;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWINEXTRASPLUGIN_H
diff --git a/src/imports/winextras/winextras.pro b/src/imports/winextras/winextras.pro
index dadc5cf..4281e07 100644
--- a/src/imports/winextras/winextras.pro
+++ b/src/imports/winextras/winextras.pro
@@ -11,7 +11,6 @@ QML_FILES += \
JumpListSeparator.qml
HEADERS += \
- qwinextrasplugin.h \
qquickwindwmfeatures.h \
qquickwindwmfeatures_p.h \
qquickwintaskbarbutton.h \
@@ -21,7 +20,7 @@ HEADERS += \
qwiniconloader.h
SOURCES += \
- qwinextrasplugin.cpp \
+ plugin.cpp \
qquickwindwmfeatures.cpp \
qquickwintaskbarbutton.cpp \
qquickjumplist.cpp \