[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bbluedevil=5D_src/actionplugins/sendfile/helper=3A_S?=
From: Alex Fiestas <afiestas () kde ! org>
Date: 2011-04-02 15:44:16
Message-ID: 20110402154416.9FBEBA60B4 () git ! kde ! org
[Download RAW message or body]
Git commit b7eaf1f223045dcda358ad78625e7b50eccad35f by Alex Fiestas.
Committed on 02/04/2011 at 17:13.
Pushed by afiestas into branch 'master'.
Small refactor to accept Device* and QVariantMap in deviceFound
Basically put all deviceFound logic into a separater method and
call it from deviceFound(Device*) and deviceFound(QVariantMap).
We don't need this in the pairing wizard because there we don't
show already configured devices.
M +12 -4 src/actionplugins/sendfile/helper/discoverwidget.cpp
M +4 -0 src/actionplugins/sendfile/helper/discoverwidget.h
http://commits.kde.org/bluedevil/b7eaf1f223045dcda358ad78625e7b50eccad35f
diff --git a/src/actionplugins/sendfile/helper/discoverwidget.cpp \
b/src/actionplugins/sendfile/helper/discoverwidget.cpp index 37f0128..a267c14 100644
--- a/src/actionplugins/sendfile/helper/discoverwidget.cpp
+++ b/src/actionplugins/sendfile/helper/discoverwidget.cpp
@@ -73,11 +73,19 @@ void DiscoverWidget::stopScan()
void DiscoverWidget::deviceFound(const QVariantMap& deviceInfo)
{
- QString address = deviceInfo["Address"].toString();
- QString name = deviceInfo["Name"].toString();
- QString icon = deviceInfo["Icon"].toString();
- QString alias = deviceInfo["Alias"].toString();
+ deviceFoundGeneric(deviceInfo["Address"].toString(),
+ deviceInfo["Name"].toString(),
+ deviceInfo["Icon"].toString(),
+ deviceInfo["Alias"].toString());
+}
+void DiscoverWidget::deviceFound(Device* device)
+{
+ deviceFoundGeneric(device->address(), device->name(), device->icon(), \
device->alias()); +}
+
+void DiscoverWidget::deviceFoundGeneric(QString address, QString name, QString icon, \
QString alias) +{
qDebug() << "========================";
qDebug() << "Address: " << address;
qDebug() << "Name: " << name;
diff --git a/src/actionplugins/sendfile/helper/discoverwidget.h \
b/src/actionplugins/sendfile/helper/discoverwidget.h index cd37fdb..d1cc03b 100644
--- a/src/actionplugins/sendfile/helper/discoverwidget.h
+++ b/src/actionplugins/sendfile/helper/discoverwidget.h
@@ -51,9 +51,13 @@ public Q_SLOTS:
private Q_SLOTS:
void deviceFound(const QVariantMap &deviceInfo);
+ void deviceFound(Device* device);
void itemSelected(QListWidgetItem* item);
private:
+ void deviceFoundGeneric(QString address, QString name, QString icon, QString \
alias); +
+private:
QMap<QString, QListWidgetItem*> m_itemRelation;
BlueWizard *m_wizard;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic