diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-05-17 23:46:09 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-05-17 23:46:09 (GMT) |
commit | e971948611b4790f0b3a05a29d8e7ab2e72e95f4 (patch) | |
tree | e4be0b95a36d9db686601d89d00ac0f3634a237e | |
parent | 0bdfdd4d2c5cc0298faa974b83dcd623da989452 (diff) | |
download | Qt-e971948611b4790f0b3a05a29d8e7ab2e72e95f4.zip Qt-e971948611b4790f0b3a05a29d8e7ab2e72e95f4.tar.gz Qt-e971948611b4790f0b3a05a29d8e7ab2e72e95f4.tar.bz2 |
Move stuff from QML viewer to plugins.
-rw-r--r-- | src/imports/dirmodel/dirmodel.pro | 26 | ||||
-rw-r--r-- | src/imports/dirmodel/plugin.cpp | 65 | ||||
-rw-r--r-- | src/imports/dirmodel/qdeclarativefolderlistmodel.cpp (renamed from tools/qml/qdeclarativefolderlistmodel.cpp) | 10 | ||||
-rw-r--r-- | src/imports/dirmodel/qdeclarativefolderlistmodel.h (renamed from tools/qml/qdeclarativefolderlistmodel.h) | 8 | ||||
-rw-r--r-- | src/imports/dirmodel/qmldir | 1 | ||||
-rw-r--r-- | src/imports/imports.pro | 2 | ||||
-rw-r--r-- | tools/qml/content/Browser.qml | 1 | ||||
-rw-r--r-- | tools/qml/main.cpp | 2 | ||||
-rw-r--r-- | tools/qml/qml.pri | 2 |
9 files changed, 95 insertions, 22 deletions
diff --git a/src/imports/dirmodel/dirmodel.pro b/src/imports/dirmodel/dirmodel.pro new file mode 100644 index 0000000..03f3a1a --- /dev/null +++ b/src/imports/dirmodel/dirmodel.pro @@ -0,0 +1,26 @@ +TARGET = qmlviewerplugin +TARGETPATH = Qt/labs/folderlistmodel +include(../qimportbase.pri) + +QT += declarative script + +SOURCES += qdeclarativefolderlistmodel.cpp plugin.cpp +HEADERS += qdeclarativefolderlistmodel.h + +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH +target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH + +qmldir.files += $$PWD/qmldir +qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH + +symbian:{ + load(data_caging_paths) + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + + importFiles.sources = qmlviewerplugin.dll qmldir + importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH + + DEPLOYMENT = importFiles +} + +INSTALLS += target qmldir diff --git a/src/imports/dirmodel/plugin.cpp b/src/imports/dirmodel/plugin.cpp new file mode 100644 index 0000000..61bf354 --- /dev/null +++ b/src/imports/dirmodel/plugin.cpp @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtDeclarative/qdeclarativeextensionplugin.h> +#include <QtDeclarative/qdeclarative.h> + +#include "qdeclarativefolderlistmodel.h" + +QT_BEGIN_NAMESPACE + +class QmlViewerPlugin : public QDeclarativeExtensionPlugin +{ + Q_OBJECT +public: + virtual void registerTypes(const char *uri) + { + Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel")); + qmlRegisterType<QDeclarativeFolderListModel>(uri,1,0,"FolderListModel"); + } +}; + +QT_END_NAMESPACE + +#include "plugin.moc" + +Q_EXPORT_PLUGIN2(qmlviewerplugin, QT_PREPEND_NAMESPACE(QmlViewerPlugin)); + diff --git a/tools/qml/qdeclarativefolderlistmodel.cpp b/src/imports/dirmodel/qdeclarativefolderlistmodel.cpp index 7ac25d6..11f9733 100644 --- a/tools/qml/qdeclarativefolderlistmodel.cpp +++ b/src/imports/dirmodel/qdeclarativefolderlistmodel.cpp @@ -44,8 +44,6 @@ #include <QDebug> #include <qdeclarativecontext.h> -QT_BEGIN_NAMESPACE - class QDeclarativeFolderListModelPrivate { public: @@ -413,11 +411,3 @@ void QDeclarativeFolderListModel::setShowOnlyReadable(bool on) else d->model.setFilter(d->model.filter() & ~QDir::Readable); } - -void QDeclarativeFolderListModel::registerTypes() -{ - qmlRegisterType<QDeclarativeFolderListModel>("Qt",4,7,"FolderListModel"); -} - -QT_END_NAMESPACE - diff --git a/tools/qml/qdeclarativefolderlistmodel.h b/src/imports/dirmodel/qdeclarativefolderlistmodel.h index 1ecc784..0ca935c 100644 --- a/tools/qml/qdeclarativefolderlistmodel.h +++ b/src/imports/dirmodel/qdeclarativefolderlistmodel.h @@ -45,9 +45,7 @@ #include <qdeclarative.h> #include <QStringList> #include <QUrl> -#include "../../src/declarative/3rdparty/qlistmodelinterface_p.h" - -QT_BEGIN_NAMESPACE +#include <private/qlistmodelinterface_p.h> class QDeclarativeContext; class QModelIndex; @@ -71,8 +69,6 @@ public: QDeclarativeFolderListModel(QObject *parent = 0); ~QDeclarativeFolderListModel(); - static void registerTypes(); - virtual QHash<int,QVariant> data(int index, const QList<int> &roles = (QList<int>())) const; virtual QVariant data(int index, int role) const; virtual int count() const; @@ -121,8 +117,6 @@ private: QDeclarativeFolderListModelPrivate *d; }; -QT_END_NAMESPACE - QML_DECLARE_TYPE(QDeclarativeFolderListModel) #endif // QDECLARATIVEFOLDERLISTMODEL_H diff --git a/src/imports/dirmodel/qmldir b/src/imports/dirmodel/qmldir new file mode 100644 index 0000000..0be644f --- /dev/null +++ b/src/imports/dirmodel/qmldir @@ -0,0 +1 @@ +plugin qmlviewerplugin diff --git a/src/imports/imports.pro b/src/imports/imports.pro index a9d600e..df43b76 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -SUBDIRS += particles gestures +SUBDIRS += dirmodel particles gestures contains(QT_CONFIG, webkit): SUBDIRS += webkit contains(QT_CONFIG, mediaservices): SUBDIRS += multimedia diff --git a/tools/qml/content/Browser.qml b/tools/qml/content/Browser.qml index c3a2cc0..fe7ad9c 100644 --- a/tools/qml/content/Browser.qml +++ b/tools/qml/content/Browser.qml @@ -1,4 +1,5 @@ import Qt 4.7 +import Qt.labs.folderlistmodel 1.0 Rectangle { id: root diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 380f5cc..0b3f2f0 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -50,7 +50,6 @@ #include <QDebug> #include <QMessageBox> #include "qdeclarativetester.h" -#include "qdeclarativefolderlistmodel.h" QT_USE_NAMESPACE @@ -203,7 +202,6 @@ int main(int argc, char ** argv) QDeclarativeViewer::registerTypes(); QDeclarativeTester::registerTypes(); - QDeclarativeFolderListModel::registerTypes(); bool frameless = false; QString fileName; diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri index a2058c7..5e3e74b 100644 --- a/tools/qml/qml.pri +++ b/tools/qml/qml.pri @@ -10,12 +10,10 @@ HEADERS += $$PWD/qmlruntime.h \ $$PWD/proxysettings.h \ $$PWD/qdeclarativetester.h \ $$PWD/deviceorientation.h \ - $$PWD/qdeclarativefolderlistmodel.h \ $$PWD/loggerwidget.h SOURCES += $$PWD/qmlruntime.cpp \ $$PWD/proxysettings.cpp \ $$PWD/qdeclarativetester.cpp \ - $$PWD/qdeclarativefolderlistmodel.cpp \ $$PWD/loggerwidget.cpp RESOURCES = $$PWD/qmlruntime.qrc |