summaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2013-09-13 16:12:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-16 11:48:33 +0200
commitb358f7d991e58f32cf0ebae7f7d3151bbb3bea63 (patch)
treeadf1ecfeef3ffe05826a096bee2f3811bbe07631 /src/imports
parent2c5400e0080e7574d048c10e12b308bb1fbade56 (diff)
Remove qdeclarativebluetoothimageprovider
This class in unfinished and does not work properly plus it introduces a dependency to the svg module. I also refactored the example where the icon was used. Change-Id: If3bd5e2eb6b05e090255f1bae0015d69c2a83065 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/bluetooth/bluetooth.pro5
-rw-r--r--src/imports/bluetooth/bluetooth.qrc5
-rw-r--r--src/imports/bluetooth/default.svg24
-rw-r--r--src/imports/bluetooth/plugin.cpp6
-rw-r--r--src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp2
-rw-r--r--src/imports/bluetooth/qdeclarativebluetoothimageprovider.cpp97
-rw-r--r--src/imports/bluetooth/qdeclarativebluetoothimageprovider_p.h61
7 files changed, 1 insertions, 199 deletions
diff --git a/src/imports/bluetooth/bluetooth.pro b/src/imports/bluetooth/bluetooth.pro
index 8d0d3308..5a554262 100644
--- a/src/imports/bluetooth/bluetooth.pro
+++ b/src/imports/bluetooth/bluetooth.pro
@@ -3,16 +3,13 @@ QT += quick bluetooth network
HEADERS += \
qdeclarativebluetoothservice_p.h \
qdeclarativebluetoothsocket_p.h \
- qdeclarativebluetoothimageprovider_p.h \
qdeclarativebluetoothdiscoverymodel_p.h
SOURCES += plugin.cpp \
qdeclarativebluetoothservice.cpp \
qdeclarativebluetoothsocket.cpp \
- qdeclarativebluetoothdiscoverymodel.cpp \
- qdeclarativebluetoothimageprovider.cpp
+ qdeclarativebluetoothdiscoverymodel.cpp
-RESOURCES += bluetooth.qrc
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
load(qml_plugin)
diff --git a/src/imports/bluetooth/bluetooth.qrc b/src/imports/bluetooth/bluetooth.qrc
deleted file mode 100644
index 1677bebb..00000000
--- a/src/imports/bluetooth/bluetooth.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>default.svg</file>
- </qresource>
-</RCC>
diff --git a/src/imports/bluetooth/default.svg b/src/imports/bluetooth/default.svg
deleted file mode 100644
index 0453ae53..00000000
--- a/src/imports/bluetooth/default.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY ns_svg "http://www.w3.org/2000/svg">
- <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
-]>
-<svg version="1.1" id="&#x56FE;&#x5C42;_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="21.792" height="21.819"
- viewBox="0 0 21.792 21.819" overflow="visible" enable-background="new 0 0 21.792 21.819" xml:space="preserve">
-<linearGradient id="XMLID_2_" gradientUnits="userSpaceOnUse" x1="11.0322" y1="2.8701" x2="11.0322" y2="21.2133">
- <stop offset="0" style="stop-color:#95D1DB"/>
- <stop offset="0.0684" style="stop-color:#7FBAE0"/>
- <stop offset="0.2073" style="stop-color:#5892EA"/>
- <stop offset="0.3506" style="stop-color:#3871F1"/>
- <stop offset="0.4971" style="stop-color:#2058F7"/>
- <stop offset="0.648" style="stop-color:#0E45FC"/>
- <stop offset="0.8061" style="stop-color:#033BFE"/>
- <stop offset="0.9831" style="stop-color:#0037FF"/>
-</linearGradient>
-<path fill="url(#XMLID_2_)" stroke="#4D4D4D" stroke-width="0.5" stroke-linejoin="round" d="M10.496,10.931l5.303-4.672
- L9.172,0.292l-0.05,9.427L9.109,9.708v0.029L7.304,8.168L6.266,9.364l1.802,1.567l-1.802,1.567l1.038,1.195l1.806-1.569v0.029
- l0.013-0.012l0.05,9.428l6.627-5.966L10.496,10.931z M10.672,3.993l2.502,2.252l-2.525,2.225L10.672,3.993z M13.174,15.617
- l-2.502,2.252l-0.023-4.477L13.174,15.617z"/>
-<rect opacity="0" fill="#FFFFFF" width="21.792" height="21.792"/>
-</svg>
diff --git a/src/imports/bluetooth/plugin.cpp b/src/imports/bluetooth/plugin.cpp
index de2e74f1..9d3b816f 100644
--- a/src/imports/bluetooth/plugin.cpp
+++ b/src/imports/bluetooth/plugin.cpp
@@ -44,7 +44,6 @@
#include <QtQml/QQmlExtensionPlugin>
#include "qdeclarativebluetoothdiscoverymodel_p.h"
-#include "qdeclarativebluetoothimageprovider_p.h"
#include "qdeclarativebluetoothservice_p.h"
#include "qdeclarativebluetoothsocket_p.h"
@@ -65,11 +64,6 @@ public:
qmlRegisterType<QDeclarativeBluetoothService>(uri, major, minor, "BluetoothService");
qmlRegisterType<QDeclarativeBluetoothSocket>(uri, major, minor, "BluetoothSocket");
}
-
- void initializeEngine(QQmlEngine *engine, const char *uri) {
- Q_UNUSED(uri);
- engine->addImageProvider("bluetoothicons", new BluetoothThumbnailImageProvider);
- }
};
#include "plugin.moc"
diff --git a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp
index feaa5adc..0bcdd46c 100644
--- a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp
+++ b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp
@@ -224,8 +224,6 @@ QVariant QDeclarativeBluetoothDiscoveryModel::data(const QModelIndex &index, int
label += QStringLiteral(" ") + service->serviceName();
return label;
}
- case Qt::DecorationRole:
- return QLatin1String("image://bluetoothicons/default");
case ServiceRole:
return QVariant::fromValue(service);
}
diff --git a/src/imports/bluetooth/qdeclarativebluetoothimageprovider.cpp b/src/imports/bluetooth/qdeclarativebluetoothimageprovider.cpp
deleted file mode 100644
index 97f5f477..00000000
--- a/src/imports/bluetooth/qdeclarativebluetoothimageprovider.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth 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$
-**
-****************************************************************************/
-
-#include <QDebug>
-#include <QQmlExtensionPlugin>
-
-#include <QQmlEngine>
-#include <qqml.h>
-#include "qdeclarativebluetoothimageprovider_p.h"
-
-
-QT_USE_NAMESPACE
-
-// This is run in a low priority thread.
-QImage BluetoothThumbnailImageProvider::requestImage(const QString &id, QSize *size, const QSize &req_size)
-{
- if (m_thumbnails.contains(id)) {
- if (size)
- *size = req_size;
- return m_thumbnails.value(id).scaled(req_size);
- }
-
- /* url format:
- image://bluetoothicons/{hosttype}
- */
-
-
- QImage image(
- req_size.width() > 0 ? req_size.width() : 100,
- req_size.height() > 0 ? req_size.height() : 50,
- QImage::Format_RGB32);
-
- QString imageUrl;
-
- if (id == "default")
- imageUrl = QLatin1String(":/default.svg");
-
- imageUrl = imageUrl.isEmpty() ? QLatin1String(":/default.svg") : imageUrl;
- image.load(imageUrl);
-
- if (size)
- *size = image.size();
-
- m_thumbnails.insert(id, image);
-
- return image;
-}
-
-BluetoothThumbnailImageProvider::BluetoothThumbnailImageProvider()
- :QQuickImageProvider(QQuickImageProvider::Image)
-{
-
-}
-
-BluetoothThumbnailImageProvider::~BluetoothThumbnailImageProvider()
-{
-}
-
-
diff --git a/src/imports/bluetooth/qdeclarativebluetoothimageprovider_p.h b/src/imports/bluetooth/qdeclarativebluetoothimageprovider_p.h
deleted file mode 100644
index 1d4a8cda..00000000
--- a/src/imports/bluetooth/qdeclarativebluetoothimageprovider_p.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtBluetooth 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$
-**
-****************************************************************************/
-
-#include <QtQuick/QQuickImageProvider>
-#include <QMap>
-
-#include <qbluetoothserviceinfo.h>
-
-QT_USE_NAMESPACE
-
-
-class BluetoothThumbnailImageProvider : public QQuickImageProvider
-{
-public:
- // This is run in a low priority thread.
- QImage requestImage(const QString &id, QSize *size, const QSize &req_size);
- BluetoothThumbnailImageProvider();
- ~BluetoothThumbnailImageProvider();
-
-private:
- QMap<QString, QImage> m_thumbnails;
-};
-