From 46a79a66c127e4e9a8565b744d43e49d13735f71243baa9ba0d13b3414cb8f8a Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Tue, 10 Mar 2015 20:49:13 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/bluedevil5?expand=0&rev=15 --- bluedevil5.changes | 10 +- bluedevil5.spec | 15 +- sync-with-master.patch | 4277 +++++++++++++++++++++++++++++++++++----- 3 files changed, 3848 insertions(+), 454 deletions(-) diff --git a/bluedevil5.changes b/bluedevil5.changes index 7bd905b..e5dd360 100644 --- a/bluedevil5.changes +++ b/bluedevil5.changes @@ -1,9 +1,13 @@ ------------------------------------------------------------------- Tue Mar 10 19:05:57 UTC 2015 - hrvoje.senjan@gmail.com -- Added sync-with-master.patch, contains fixes for kde#343682, - kde#342581, kde#342259, kde#321560, kde#341768, kde#337193, - kde#314356, kde#332014 and many other improvements +- Added sync-with-master.patch + * Contains fixes for kde#343682, kde#342581, kde#342259, + kde#321560, kde#341768, kde#337193, kde#314356, kde#332014 and + many other improvements + * Desktop files renamed for reverse DNS logic +- Added bluez requires and pulseaudio-module-bluetooth recommends +- Fix bashisms in post/postun scripts ------------------------------------------------------------------- Fri Feb 20 02:43:48 UTC 2015 - hrvoje.senjan@gmail.com diff --git a/bluedevil5.spec b/bluedevil5.spec index 086419f..ad2c0d1 100644 --- a/bluedevil5.spec +++ b/bluedevil5.spec @@ -43,7 +43,10 @@ BuildRequires: update-desktop-files BuildRequires: pkgconfig(Qt5Core) >= 5.2.0 BuildRequires: pkgconfig(Qt5DBus) >= 5.2.0 BuildRequires: pkgconfig(Qt5Widgets) >= 5.2.0 -Requires: obexd-client +# atop of the bluez itself, we also need bluez-obexd for kio_obexftp and both send/receive +Requires: bluez +# for connecting A2DP profile +Recommends: pulseaudio-module-bluetooth Recommends: %{name}-lang Supplements: packageand(bluez:plasma5-workspace) Conflicts: bluedevil @@ -65,20 +68,20 @@ Bluetooth daemon for KDE, handling connections. %install %kf5_makeinstall -C build -%suse_update_desktop_file -r bluedevil-monolithic Qt KDE Utility DesktopUtility -sed -i '/^Icon=/d' %{buildroot}%{_kf5_applicationsdir}/bluedevil-monolithic.desktop +%suse_update_desktop_file -r org.kde.bluedevilmonolithic Qt KDE Utility DesktopUtility +sed -i '/^Icon=/d' %{buildroot}%{_kf5_applicationsdir}/org.kde.bluedevilmonolithic.desktop %post -/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : +/usr/bin/update-mime-database %{_datadir}/mime > /dev/null 2>&1 || : %postun -/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : +/usr/bin/update-mime-database %{_datadir}/mime > /dev/null 2>&1 || : %files %defattr(-,root,root,-) %doc README %{_kf5_sharedir}/mime/packages/bluedevil-mime.xml -%{_kf5_applicationsdir}/bluedevil-*.desktop +%{_kf5_applicationsdir}/org.kde.bluedevil*.desktop %{_kf5_sharedir}/bluedevilwizard/ %{_kf5_bindir}/bluedevil-* %{_kf5_libdir}/libexec/ diff --git a/sync-with-master.patch b/sync-with-master.patch index 27a1450..327029f 100644 --- a/sync-with-master.patch +++ b/sync-with-master.patch @@ -606,8 +606,483 @@ index bda24b0..81433dd 100644 Comment[zh_CN]=收到文件传输 +Comment[zh_TW]=進來的檔案傳輸 Action=Popup +diff --git a/src/daemon/helpers/authorize/authorize.cpp b/src/daemon/helpers/authorize/authorize.cpp +index c6f44da..6847ba9 100644 +--- a/src/daemon/helpers/authorize/authorize.cpp ++++ b/src/daemon/helpers/authorize/authorize.cpp +@@ -39,33 +39,33 @@ Authorize::Authorize() + + notification->setText(i18nc( + "Show a notification asking to authorize or deny access to this computer from Bluetooth. The %1 is the name of the bluetooth device", +- "%1 is requesting access to this computer", qApp->arguments()[1]) ++ "%1 is requesting access to this computer", qApp->arguments().at(1)) + ); + + QStringList actions; + actions.append(i18nc("Button to trust a bluetooth remote device and authorize it to connect", "Trust and Authorize")); +- actions.append(i18nc("Button to authorize a bluetooth remote device to connect ", "Authorize Only")); ++ actions.append(i18nc("Button to authorize a bluetooth remote device to connect", "Authorize Only")); + actions.append(i18nc("Deny access to a remote bluetooth device", "Deny")); + + notification->setActions(actions); + +- connect(notification, SIGNAL(action1Activated()),this, SLOT(trust())); +- connect(notification, SIGNAL(action2Activated()),this, SLOT(authorize())); +- connect(notification, SIGNAL(action3Activated()),this, SLOT(deny())); +- connect(notification, SIGNAL(closed()), this, SLOT(deny())); +- connect(notification, SIGNAL(ignored()), this, SLOT(deny())); ++ connect(notification, &KNotification::action1Activated, this, &Authorize::trust); ++ connect(notification, &KNotification::action2Activated, this, &Authorize::authorize); ++ connect(notification, &KNotification::action3Activated, this, &Authorize::deny); ++ connect(notification, &KNotification::closed, this, &Authorize::deny); ++ connect(notification, &KNotification::ignored, this, &Authorize::deny); + +- notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(42, 42)); ++ notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(42)); + + // We're using persistent notifications so we have to use our own timeout (10s) +- QTimer::singleShot(10000, notification, SLOT(close())); ++ QTimer::singleShot(10000, notification, &KNotification::close); + notification->sendEvent(); + } + + void Authorize::trust() + { + qDebug() << "Trusted"; +- BlueDevil::Manager::self()->usableAdapter()->deviceForUBI(qApp->arguments()[2])->setTrusted(true); ++ BlueDevil::Manager::self()->usableAdapter()->deviceForUBI(qApp->arguments().at(2))->setTrusted(true); + qApp->exit(0); + } + +diff --git a/src/daemon/helpers/authorize/authorize.h b/src/daemon/helpers/authorize/authorize.h +index d881baa..b3b4190 100644 +--- a/src/daemon/helpers/authorize/authorize.h ++++ b/src/daemon/helpers/authorize/authorize.h +@@ -32,8 +32,7 @@ + * Deny quits the app with 1 (which means denied) + * @internal + */ +-class Authorize +- : public QObject ++class Authorize : public QObject + { + Q_OBJECT + +@@ -42,7 +41,7 @@ public: + * Launch the KNotification which the respective actions, also makes the needed connection + * between those actions and the slots + */ +- Authorize(); ++ explicit Authorize(); + + private Q_SLOTS: + /** +@@ -60,4 +59,5 @@ private Q_SLOTS: + */ + void deny(); + }; +-#endif ++ ++#endif // AUTHORIZE_H +diff --git a/src/daemon/helpers/authorize/main.cpp b/src/daemon/helpers/authorize/main.cpp +index 615245f..8106ff6 100644 +--- a/src/daemon/helpers/authorize/main.cpp ++++ b/src/daemon/helpers/authorize/main.cpp +@@ -18,15 +18,10 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * + *************************************************************************************/ + +- + #include "authorize.h" + + #include + +-#include +- +-static const KLocalizedString description = ki18n("KDE Bluetooth System"); +- + int main(int argc, char *argv[]) + { + QApplication app(argc, argv); +diff --git a/src/daemon/helpers/confirmmodechange/confirmmodechange.cpp b/src/daemon/helpers/confirmmodechange/confirmmodechange.cpp +index 1328f74..62eccd3 100644 +--- a/src/daemon/helpers/confirmmodechange/confirmmodechange.cpp ++++ b/src/daemon/helpers/confirmmodechange/confirmmodechange.cpp +@@ -37,7 +37,7 @@ ConfirmModeChange::ConfirmModeChange() + + notification->setText(i18nc( + "Showed in a notification when the Bluetooth mode is going to be changed (for example to flight mode), the %1 is the name of the mode", +- "Change Bluetooth mode to '%1'?", qApp->arguments()[1]) ++ "Change Bluetooth mode to '%1'?", qApp->arguments().at(1)) + ); + + QStringList actions; +@@ -46,14 +46,14 @@ ConfirmModeChange::ConfirmModeChange() + + notification->setActions(actions); + +- connect(notification, SIGNAL(action1Activated()),this, SLOT(confirm())); +- connect(notification, SIGNAL(action2Activated()),this, SLOT(deny())); +- connect(notification, SIGNAL(closed()), this, SLOT(deny())); +- connect(notification, SIGNAL(ignored()), this, SLOT(deny())); ++ connect(notification, &KNotification::action1Activated,this, &ConfirmModeChange::confirm); ++ connect(notification, &KNotification::action2Activated,this, &ConfirmModeChange::deny); ++ connect(notification, &KNotification::closed, this, &ConfirmModeChange::deny); ++ connect(notification, &KNotification::ignored, this, &ConfirmModeChange::deny); + + // We're using persistent notifications so we have to use our own timeout (10s) +- QTimer::singleShot(10000, notification, SLOT(close())); +- notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(42, 42)); ++ QTimer::singleShot(10000, notification, &KNotification::close); ++ notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(42)); + notification->sendEvent(); + } + +@@ -68,4 +68,3 @@ void ConfirmModeChange::deny() + qDebug() << "Denied"; + qApp->exit(1); + } +- +diff --git a/src/daemon/helpers/confirmmodechange/confirmmodechange.h b/src/daemon/helpers/confirmmodechange/confirmmodechange.h +index 4d79b02..572fb57 100644 +--- a/src/daemon/helpers/confirmmodechange/confirmmodechange.h ++++ b/src/daemon/helpers/confirmmodechange/confirmmodechange.h +@@ -19,8 +19,8 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +-#ifndef AUTHORIZE_H +-#define AUTHORIZE_H ++#ifndef CONFIRM_MODE_CHANGE_H ++#define CONFIRM_MODE_CHANGE_H + + #include + +@@ -32,8 +32,7 @@ + * Deny quits the app with 1 (which means denied) + * @internal + */ +-class ConfirmModeChange +- : public QObject ++class ConfirmModeChange : public QObject + { + Q_OBJECT + +@@ -42,7 +41,7 @@ public: + * Launch the KNotification which the respective actions, also makes the needed connection + * between those actions and the slots + */ +- ConfirmModeChange(); ++ explicit ConfirmModeChange(); + + private Q_SLOTS: + /** +@@ -55,4 +54,5 @@ private Q_SLOTS: + */ + void deny(); + }; +-#endif ++ ++#endif // CONFIRM_MODE_CHANGE_H +diff --git a/src/daemon/helpers/confirmmodechange/main.cpp b/src/daemon/helpers/confirmmodechange/main.cpp +index b4ed946..a2e05bb 100644 +--- a/src/daemon/helpers/confirmmodechange/main.cpp ++++ b/src/daemon/helpers/confirmmodechange/main.cpp +@@ -18,15 +18,10 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * + *************************************************************************************/ + +- + #include "confirmmodechange.h" + + #include + +-#include +- +-static const KLocalizedString description = ki18n("KDE Bluetooth System"); +- + int main(int argc, char *argv[]) + { + QApplication app(argc,argv); +diff --git a/src/daemon/helpers/requestconfirmation/main.cpp b/src/daemon/helpers/requestconfirmation/main.cpp +index e7ecde0..f324060 100644 +--- a/src/daemon/helpers/requestconfirmation/main.cpp ++++ b/src/daemon/helpers/requestconfirmation/main.cpp +@@ -22,10 +22,6 @@ + + #include + +-#include +- +-static const KLocalizedString description = ki18n("KDE Bluetooth System"); +- + int main(int argc, char *argv[]) + { + QApplication app(argc, argv); +diff --git a/src/daemon/helpers/requestconfirmation/requestconfirmation.cpp b/src/daemon/helpers/requestconfirmation/requestconfirmation.cpp +index ac24731..31b15c3 100644 +--- a/src/daemon/helpers/requestconfirmation/requestconfirmation.cpp ++++ b/src/daemon/helpers/requestconfirmation/requestconfirmation.cpp +@@ -35,7 +35,7 @@ RequestConfirmation::RequestConfirmation() : QObject() + + notification->setText(i18nc( + "The text is shown in a notification to know if the PIN is correct, %1 is the remote bluetooth device and %2 is the pin", +- "%1 is asking if the PIN is correct: %2", qApp->arguments()[1], qApp->arguments()[2]) ++ "%1 is asking if the PIN is correct: %2", qApp->arguments().at(1), qApp->arguments().at(2)) + ); + + QStringList actions; +@@ -44,14 +44,14 @@ RequestConfirmation::RequestConfirmation() : QObject() + + notification->setActions(actions); + +- connect(notification, SIGNAL(action1Activated()),this, SLOT(pinCorrect())); +- connect(notification, SIGNAL(action2Activated()),this, SLOT(pinWrong())); +- connect(notification, SIGNAL(closed()), this, SLOT(pinWrong())); +- connect(notification, SIGNAL(ignored()), this, SLOT(pinWrong())); ++ connect(notification, &KNotification::action1Activated, this, &RequestConfirmation::pinCorrect); ++ connect(notification, &KNotification::action2Activated, this, &RequestConfirmation::pinWrong); ++ connect(notification, &KNotification::closed, this, &RequestConfirmation::pinWrong); ++ connect(notification, &KNotification::ignored, this, &RequestConfirmation::pinWrong); + +- //We're using persistent notifications so we have to use our own timeout (10s) +- QTimer::singleShot(10000, notification, SLOT(close())); +- notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(42,42)); ++ // We're using persistent notifications so we have to use our own timeout (10s) ++ QTimer::singleShot(10000, notification, &KNotification::close); ++ notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(42)); + notification->sendEvent(); + } + +diff --git a/src/daemon/helpers/requestconfirmation/requestconfirmation.h b/src/daemon/helpers/requestconfirmation/requestconfirmation.h +index 60ebff8..59c6cfa 100644 +--- a/src/daemon/helpers/requestconfirmation/requestconfirmation.h ++++ b/src/daemon/helpers/requestconfirmation/requestconfirmation.h +@@ -19,8 +19,8 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +-#ifndef AUTHORIZE_H +-#define AUTHORIZE_H ++#ifndef REQUEST_CONFIRMATION_H ++#define REQUEST_CONFIRMATION_H + + #include + +@@ -32,8 +32,7 @@ + * Deny quits the app with 1 (which means denied) + * @internal + */ +-class RequestConfirmation +- : public QObject ++class RequestConfirmation : public QObject + { + Q_OBJECT + +@@ -42,7 +41,7 @@ public: + * Launch the KNotification which the respective actions, also makes the needed connection + * between those actions and the slots + */ +- RequestConfirmation(); ++ explicit RequestConfirmation(); + + private Q_SLOTS: + /** +@@ -55,4 +54,5 @@ private Q_SLOTS: + */ + void pinWrong(); + }; +-#endif ++ ++#endif // REQUEST_CONFIRMATION_H +diff --git a/src/daemon/helpers/requestpin/dialogWidget.ui b/src/daemon/helpers/requestpin/dialogWidget.ui +index 478f1be..8e769a3 100644 +--- a/src/daemon/helpers/requestpin/dialogWidget.ui ++++ b/src/daemon/helpers/requestpin/dialogWidget.ui +@@ -7,7 +7,7 @@ + 0 + 0 + 259 +- 127 ++ 138 + + + +@@ -61,12 +61,6 @@ + 0 + + +- +- +- +- +- 32767 +- + + 1234 + +diff --git a/src/daemon/helpers/requestpin/main.cpp b/src/daemon/helpers/requestpin/main.cpp +index 8472108..e3cfb29 100644 +--- a/src/daemon/helpers/requestpin/main.cpp ++++ b/src/daemon/helpers/requestpin/main.cpp +@@ -22,10 +22,6 @@ + + #include + +-#include +- +-static const KLocalizedString description = ki18n("KDE Bluetooth System"); +- + int main(int argc, char *argv[]) + { + QApplication app(argc, argv); +diff --git a/src/daemon/helpers/requestpin/requestpin.cpp b/src/daemon/helpers/requestpin/requestpin.cpp +index 7402b25..8b5f88c 100644 +--- a/src/daemon/helpers/requestpin/requestpin.cpp ++++ b/src/daemon/helpers/requestpin/requestpin.cpp +@@ -37,9 +37,7 @@ + #include + #include + +-using namespace std; +-RequestPin::RequestPin() +- : QObject() ++RequestPin::RequestPin() : QObject() + , m_dialogWidget(0) + { + m_notification = new KNotification(QStringLiteral("bluedevilRequestPin"), +@@ -47,7 +45,7 @@ RequestPin::RequestPin() + + m_notification->setText(i18nc( + "Shown in a notification to announce that a PIN is needed to accomplish a pair action, %1 is the name of the bluetooth device", +- "PIN needed to pair with %1",qApp->arguments()[1]) ++ "PIN needed to pair with %1", qApp->arguments().at(1)) + ); + + QStringList actions; +@@ -58,17 +56,17 @@ RequestPin::RequestPin() + + m_notification->setActions(actions); + +- connect(m_notification, SIGNAL(action1Activated()),this, SLOT(introducePin())); +- connect(m_notification, SIGNAL(closed()), this, SLOT(quit())); +- connect(m_notification, SIGNAL(ignored()), this, SLOT(quit())); ++ connect(m_notification, &KNotification::action1Activated,this, &RequestPin::introducePin); ++ connect(m_notification, &KNotification::closed, this, &RequestPin::quit); ++ connect(m_notification, &KNotification::ignored, this, &RequestPin::quit); + +- //We're using persistent notifications so we have to use our own timeout (10s) ++ // We're using persistent notifications so we have to use our own timeout (10s) + m_timer.setSingleShot(true); + m_timer.setInterval(10000); + m_timer.start(); +- connect(&m_timer, SIGNAL(timeout()), m_notification, SLOT(close())); ++ connect(&m_timer, &QTimer::timeout, m_notification, &KNotification::close); + +- m_notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(42,42)); ++ m_notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(42)); + m_notification->sendEvent(); + } + +@@ -90,27 +88,27 @@ void RequestPin::introducePin() + m_dialogWidget->descLabel->setText(i18nc( + "Shown in a dialog which asks to introduce a PIN that will be used to pair a Bluetooth device, %1 is the name of the Bluetooth device", + "In order to pair this computer with %1, you have to enter a PIN. Please do it below.", +- qApp->arguments()[1]) ++ qApp->arguments().at(1)) + ); +- m_dialogWidget->pixmap->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(64,64)); ++ m_dialogWidget->pixmap->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(64)); + +- connect(m_dialogWidget->pin, SIGNAL(textChanged(QString)), SLOT(checkPin(QString))); +- connect(m_dialogWidget->pin, SIGNAL(returnPressed()), dialog, SLOT(accept())); ++ connect(m_dialogWidget->pin, &KLineEdit::textChanged, this, &RequestPin::checkPin); ++ connect(m_dialogWidget->pin, &KLineEdit::returnPressed, dialog, &QDialog::accept); + + m_dialogWidget->pin->setFocus(Qt::ActiveWindowFocusReason); +- qDebug() << qApp->arguments(); +- if (qApp->arguments().count() > 2 && qApp->arguments()[2] == QLatin1String("numeric")) { +- m_dialogWidget->pin->setValidator(new QRegExpValidator(QRegExp(QStringLiteral("[0-9]{1,6}")), this )); ++ ++ if (qApp->arguments().count() > 2 && qApp->arguments().at(2) == QLatin1String("numeric")) { ++ m_dialogWidget->pin->setValidator(new QRegExpValidator(QRegExp(QStringLiteral("[0-9]{1,6}")), this)); + } else { +- m_dialogWidget->pin->setValidator(new QRegExpValidator(QRegExp(QStringLiteral("[A-Za-z0-9]{1,16}")), this )); ++ m_dialogWidget->pin->setValidator(new QRegExpValidator(QRegExp(QStringLiteral("[A-Za-z0-9]{1,16}")), this)); + } + + m_dialogWidget->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); + dialog->setMinimumSize(dialog->sizeHint()); + dialog->setMaximumSize(dialog->sizeHint()); + if (dialog->exec()) { +- cout << m_dialogWidget->pin->text().toLatin1().constData(); +- flush(cout); ++ std::cout << m_dialogWidget->pin->text().toLatin1().constData(); ++ std::flush(std::cout); + delete dialog; + qApp->exit(0); + return; +@@ -120,7 +118,7 @@ void RequestPin::introducePin() + qApp->exit(1); + } + +-void RequestPin::checkPin(const QString& pin) ++void RequestPin::checkPin(const QString &pin) + { + m_dialogWidget->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!pin.isEmpty()); + } +diff --git a/src/daemon/helpers/requestpin/requestpin.h b/src/daemon/helpers/requestpin/requestpin.h +index 3cc09e6..bfa96dc 100644 +--- a/src/daemon/helpers/requestpin/requestpin.h ++++ b/src/daemon/helpers/requestpin/requestpin.h +@@ -19,14 +19,15 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +-#ifndef REQUESTPIN_H +-#define REQUESTPIN_H ++#ifndef REQUEST_PIN_H ++#define REQUEST_PIN_H + + #include + #include + +-namespace Ui { +-class dialogWidget; ++namespace Ui ++{ ++ class dialogWidget; + } + + class KNotification; +@@ -39,8 +40,7 @@ class KNotification; + * Deny quits the app with 1 (which means denied) + * @internal + */ +-class RequestPin +- : public QObject ++class RequestPin : public QObject + { + Q_OBJECT + +@@ -49,7 +49,7 @@ public: + * Launch the KNotification which the respective actions, also makes the needed connection + * between those actions and the slots + */ +- RequestPin(); ++ explicit RequestPin(); + + private Q_SLOTS: + /** +@@ -70,4 +70,5 @@ private: + Ui::dialogWidget *m_dialogWidget; + KNotification *m_notification; + }; +-#endif //REQUESTPIN_H ++ ++#endif // REQUEST_PIN_H diff --git a/src/daemon/kded/BlueDevilDaemon.cpp b/src/daemon/kded/BlueDevilDaemon.cpp -index 1211103..458ce92 100644 +index 1211103..0b59ce5 100644 --- a/src/daemon/kded/BlueDevilDaemon.cpp +++ b/src/daemon/kded/BlueDevilDaemon.cpp @@ -38,6 +38,7 @@ @@ -618,37 +1093,60 @@ index 1211103..458ce92 100644 #include #include -@@ -64,7 +65,7 @@ struct BlueDevilDaemon::Private - Adapter *m_adapter; - QDBusServiceWatcher *m_monolithicWatcher; - FileReceiver *m_fileReceiver; +@@ -59,21 +60,21 @@ struct BlueDevilDaemon::Private + Offline + } m_status; + +- BluezAgent *m_bluezAgent; +- KFilePlacesModel *m_placesModel; +- Adapter *m_adapter; +- QDBusServiceWatcher *m_monolithicWatcher; +- FileReceiver *m_fileReceiver; - QList m_discovered; -+ KSharedConfig::Ptr m_config; - QTimer m_timer; +- QTimer m_timer; ++ BluezAgent *m_bluezAgent; ++ KFilePlacesModel *m_placesModel; ++ Adapter *m_adapter; ++ QDBusServiceWatcher *m_monolithicWatcher; ++ FileReceiver *m_fileReceiver; ++ KSharedConfig::Ptr m_config; ++ QTimer m_timer; }; + BlueDevilDaemon::BlueDevilDaemon(QObject *parent, const QList&) + : KDEDModule(parent) + , d(new Private) + { +- qDBusRegisterMetaType (); +- qDBusRegisterMetaType (); ++ qDBusRegisterMetaType(); ++ qDBusRegisterMetaType(); + + d->m_bluezAgent = 0; + d->m_adapter = 0; @@ -81,8 +82,8 @@ BlueDevilDaemon::BlueDevilDaemon(QObject *parent, const QList&) d->m_fileReceiver = 0; d->m_monolithicWatcher = new QDBusServiceWatcher(QStringLiteral("org.kde.bluedevilmonolithic") , QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForUnregistration, this); - d->m_timer.setInterval(20000); d->m_timer.setSingleShot(true); -+ d->m_config = KSharedConfig::openConfig("bluedevilglobalrc"); ++ d->m_config = KSharedConfig::openConfig(QStringLiteral("bluedevilglobalrc")); KAboutData aboutData( QStringLiteral("bluedevildaemon"), -@@ -103,11 +104,27 @@ BlueDevilDaemon::BlueDevilDaemon(QObject *parent, const QList&) +@@ -102,12 +103,25 @@ BlueDevilDaemon::BlueDevilDaemon(QObject *parent, const QList&) + aboutData.setComponentName(QStringLiteral("bluedevil")); KAboutData::registerPluginData(aboutData); - connect(d->m_monolithicWatcher, SIGNAL(serviceUnregistered(const QString &)), SLOT(monolithicFinished(const QString &))); -+ connect(&d->m_timer, SIGNAL(timeout()), SLOT(stopDiscovering())); +- connect(d->m_monolithicWatcher, SIGNAL(serviceUnregistered(const QString &)), SLOT(monolithicFinished(const QString &))); ++ connect(d->m_monolithicWatcher, &QDBusServiceWatcher::serviceUnregistered, this, &BlueDevilDaemon::monolithicFinished); ++ connect(&d->m_timer, &QTimer::timeout, this, &BlueDevilDaemon::stopDiscovering); - connect(Manager::self(), SIGNAL(usableAdapterChanged(Adapter*)), - this, SLOT(usableAdapterChanged(Adapter*))); -+ connect(Manager::self(), SIGNAL(adapterAdded(Adapter*)), -+ this, SLOT(adapterAdded(Adapter*))); -+ connect(Manager::self(), SIGNAL(adapterRemoved(Adapter*)), -+ this, SLOT(adapterRemoved(Adapter*))); +- connect(Manager::self(), SIGNAL(usableAdapterChanged(Adapter*)), +- this, SLOT(usableAdapterChanged(Adapter*))); ++ connect(Manager::self(), &Manager::usableAdapterChanged, this, &BlueDevilDaemon::usableAdapterChanged); ++ connect(Manager::self(), &Manager::adapterAdded, this, &BlueDevilDaemon::adapterAdded); ++ connect(Manager::self(), &Manager::adapterRemoved, this, &BlueDevilDaemon::adapterRemoved); + + // Catch suspend/resume events + QDBusConnection::systemBus().connect(QStringLiteral("org.freedesktop.login1"), @@ -665,7 +1163,7 @@ index 1211103..458ce92 100644 usableAdapterChanged(Manager::self()->usableAdapter()); if (!Manager::self()->adapters().isEmpty()) { -@@ -117,6 +134,8 @@ BlueDevilDaemon::BlueDevilDaemon(QObject *parent, const QList&) +@@ -117,6 +131,8 @@ BlueDevilDaemon::BlueDevilDaemon(QObject *parent, const QList&) BlueDevilDaemon::~BlueDevilDaemon() { @@ -674,39 +1172,31 @@ index 1211103..458ce92 100644 if (d->m_status == Private::Online) { offlineMode(); } -@@ -124,6 +143,27 @@ BlueDevilDaemon::~BlueDevilDaemon() +@@ -124,93 +140,111 @@ BlueDevilDaemon::~BlueDevilDaemon() delete d; } -+static Adapter *adapterForAddress(const QString &address) -+{ -+ Q_FOREACH (Adapter *adapter, Manager::self()->adapters()) { -+ if (adapter->address() == address) { -+ return adapter; -+ } -+ } -+ return 0; -+} -+ +-bool BlueDevilDaemon::isOnline() +void BlueDevilDaemon::login1PrepareForSleep(bool active) -+{ + { +- if (d->m_status == Private::Offline) { +- return false; + if (active) { + qCDebug(BLUEDAEMON) << "About to suspend"; + saveAdaptersState(); + } else { + qCDebug(BLUEDAEMON) << "About to resume"; + restoreAdaptersState(); -+ } -+} -+ - bool BlueDevilDaemon::isOnline() - { - if (d->m_status == Private::Offline) { -@@ -132,41 +172,55 @@ bool BlueDevilDaemon::isOnline() - return true; + } +- return true; } -QMapDeviceInfo BlueDevilDaemon::knownDevices() ++bool BlueDevilDaemon::isOnline() ++{ ++ return d->m_status == Private::Online; ++} ++ +QMapDeviceInfo BlueDevilDaemon::allDevices() { QMapDeviceInfo devices; @@ -781,17 +1271,99 @@ index 1211103..458ce92 100644 } void BlueDevilDaemon::executeMonolithic() -@@ -203,9 +257,7 @@ void BlueDevilDaemon::onlineMode() + { +- qCDebug(BLUEDAEMON); +- + QProcess process; + if (!process.startDetached(QStringLiteral("bluedevil-monolithic"))) { +- qCritical() << "Could not start bluedevil-monolithic"; ++ qCCritical(BLUEDAEMON) << "Could not start bluedevil-monolithic"; + } + } + + void BlueDevilDaemon::killMonolithic() + { +- qCDebug(BLUEDAEMON); + QDBusMessage msg = QDBusMessage::createMethodCall( + QStringLiteral("org.kde.bluedevilmonolithic"), + QStringLiteral("/MainApplication"), + QStringLiteral("org.kde.KApplication"), + QStringLiteral("quit") + ); ++ + QDBusPendingCall pending = QDBusConnection::sessionBus().asyncCall(msg); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pending); +- connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(monolithicQuit(QDBusPendingCallWatcher*))); ++ connect(watcher, &QDBusPendingCallWatcher::finished, this, &BlueDevilDaemon::monolithicQuit); + } + + void BlueDevilDaemon::onlineMode() + { +- qCDebug(BLUEDAEMON); + if (d->m_status == Private::Online) { + qCDebug(BLUEDAEMON) << "Already in onlineMode"; + return; + } d->m_bluezAgent = new BluezAgent(new QObject()); - connect(d->m_bluezAgent, SIGNAL(agentReleased()), this, SLOT(agentReleased())); +- connect(d->m_bluezAgent, SIGNAL(agentReleased()), this, SLOT(agentReleased())); - - connect(d->m_adapter, SIGNAL(deviceFound(Device*)), this, SLOT(deviceFound(Device*))); +- connect(d->m_adapter, SIGNAL(deviceFound(Device*)), this, SLOT(deviceFound(Device*))); - connect(&d->m_timer, SIGNAL(timeout()), d->m_adapter, SLOT(stopDiscovery())); ++ connect(d->m_bluezAgent, &BluezAgent::agentReleased, this, &BlueDevilDaemon::agentReleased); ++ connect(d->m_adapter, &Adapter::deviceFound, this, &BlueDevilDaemon::deviceFound); FileReceiverSettings::self()->load(); if (!d->m_fileReceiver && FileReceiverSettings::self()->enabled()) { -@@ -271,9 +323,6 @@ void BlueDevilDaemon::offlineMode() + d->m_fileReceiver = new FileReceiver(this); + } ++ + if (d->m_fileReceiver && !FileReceiverSettings::self()->enabled()) { + qCDebug(BLUEDAEMON) << "Stoppping server"; + delete d->m_fileReceiver; +@@ -221,7 +255,7 @@ void BlueDevilDaemon::onlineMode() + d->m_placesModel = new KFilePlacesModel(); + } + +- //Just in case kded was killed or crashed ++ // Just in case kded was killed or crashed + QModelIndex index = d->m_placesModel->closestItem(QUrl(QStringLiteral("bluetooth:/"))); + while (index.row() != -1) { + d->m_placesModel->removePlace(index); +@@ -237,8 +271,6 @@ void BlueDevilDaemon::onlineMode() + + void BlueDevilDaemon::monolithicFinished(const QString &) + { +- qCDebug(BLUEDAEMON); +- + if (d->m_status == Private::Online) { + executeMonolithic(); + } +@@ -247,6 +279,7 @@ void BlueDevilDaemon::monolithicFinished(const QString &) + void BlueDevilDaemon::offlineMode() + { + qCDebug(BLUEDAEMON) << "Offline mode"; ++ + if (d->m_status == Private::Offline) { + qCDebug(BLUEDAEMON) << "Already in offlineMode"; + return; +@@ -255,7 +288,7 @@ void BlueDevilDaemon::offlineMode() + d->m_adapter = 0; + + if (d->m_bluezAgent) { +- delete d->m_bluezAgent->parent(); // we meed to delete the parent for not leaking it ++ delete d->m_bluezAgent->parent(); // we need to delete the parent for not leaking it + d->m_bluezAgent = 0; + } + +@@ -265,15 +298,12 @@ void BlueDevilDaemon::offlineMode() + d->m_fileReceiver = 0; + } + +- //Just to be sure that online was called ++ // Just to be sure that online was called + if (d->m_placesModel) { + QModelIndex index = d->m_placesModel->closestItem(QUrl(QStringLiteral("bluetooth:/"))); d->m_placesModel->removePlace(index); } @@ -801,7 +1373,7 @@ index 1211103..458ce92 100644 d->m_status = Private::Offline; } -@@ -301,10 +350,23 @@ void BlueDevilDaemon::usableAdapterChanged(Adapter *adapter) +@@ -301,31 +331,84 @@ void BlueDevilDaemon::usableAdapterChanged(Adapter *adapter) } } @@ -826,14 +1398,18 @@ index 1211103..458ce92 100644 org::kde::KDirNotify::emitFilesAdded(QUrl(QStringLiteral("bluetooth:/"))); } -@@ -314,18 +376,59 @@ void BlueDevilDaemon::monolithicQuit(QDBusPendingCallWatcher* watcher) +-void BlueDevilDaemon::monolithicQuit(QDBusPendingCallWatcher* watcher) ++void BlueDevilDaemon::monolithicQuit(QDBusPendingCallWatcher *watcher) + { +- qCDebug(BLUEDAEMON); QDBusPendingReply reply = *watcher; if (reply.isError()) { - qDebug() << "Error response: " << reply.error().message(); +- qDebug() << "Error response: " << reply.error().message(); - killMonolithic(); - } - } - ++ qCDebug(BLUEDAEMON) << "Error response: " << reply.error().message(); ++ } ++} ++ +void BlueDevilDaemon::saveAdaptersState() +{ + Manager *manager = Manager::self(); @@ -844,7 +1420,7 @@ index 1211103..458ce92 100644 + KConfigGroup adaptersGroup = d->m_config->group("Adapters"); + + Q_FOREACH (Adapter *adapter, manager->adapters()) { -+ const QString key = QString("%1_powered").arg(adapter->address()); ++ const QString key = QString(QStringLiteral("%1_powered")).arg(adapter->address()); + adaptersGroup.writeEntry(key, adapter->isPowered()); + } + @@ -862,16 +1438,16 @@ index 1211103..458ce92 100644 + KConfigGroup adaptersGroup = d->m_config->group("Adapters"); + + Q_FOREACH (Adapter *adapter, manager->adapters()) { -+ const QString key = QString("%1_powered").arg(adapter->address()); ++ const QString key = QString(QStringLiteral("%1_powered")).arg(adapter->address()); + adapter->setPowered(adaptersGroup.readEntry(key, true)); -+ } -+} -+ + } + } + +void BlueDevilDaemon::restoreAdapterState(Adapter *adapter) +{ + KConfigGroup adaptersGroup = d->m_config->group("Adapters"); + -+ const QString key = QString("%1_powered").arg(adapter->address()); ++ const QString key = QString(QStringLiteral("%1_powered")).arg(adapter->address()); + adapter->setPowered(adaptersGroup.readEntry(key, true)); +} + @@ -890,11 +1466,47 @@ index 1211103..458ce92 100644 return info; } diff --git a/src/daemon/kded/BlueDevilDaemon.h b/src/daemon/kded/BlueDevilDaemon.h -index a8688ae..5115f1b 100644 +index a8688ae..a4a396b 100644 --- a/src/daemon/kded/BlueDevilDaemon.h +++ b/src/daemon/kded/BlueDevilDaemon.h -@@ -49,16 +49,30 @@ public: - virtual ~BlueDevilDaemon(); +@@ -22,43 +22,59 @@ + #ifndef BLUEDEVILDAEMON_H + #define BLUEDEVILDAEMON_H + +-#include ++#include + #include + +-typedef QMap DeviceInfo; ++typedef QMap DeviceInfo; + typedef QMap QMapDeviceInfo; + + class QDBusPendingCallWatcher; +-namespace BlueDevil { ++ ++namespace BlueDevil ++{ + class Adapter; + class Device; + } ++ + using namespace BlueDevil; + +-class Q_DECL_EXPORT BlueDevilDaemon +- : public KDEDModule ++class Q_DECL_EXPORT BlueDevilDaemon : public KDEDModule + { + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.kde.BlueDevil") + + public: + /** +- * Stablish basics connections with libbluedevil signals and calls online if interfaces are availables ++ * Establish basics connections with libbluedevil signals and calls online if interfaces are availables + */ + BlueDevilDaemon(QObject *parent, const QList&); +- virtual ~BlueDevilDaemon(); ++ ~BlueDevilDaemon(); public Q_SLOTS: + /** @@ -909,15 +1521,15 @@ index a8688ae..5115f1b 100644 - * Then if this slot is consulted again it will return configured and discovered device. Once - * the discovery ends it won't start a new discovery until N seconds pass. + * Returns QMap with all known devices - */ -- Q_SCRIPTABLE QMapDeviceInfo knownDevices(); ++ */ + Q_SCRIPTABLE QMapDeviceInfo allDevices(); - ++ + /** + * Returns DeviceInfo for one device. -+ */ + */ +- Q_SCRIPTABLE QMapDeviceInfo knownDevices(); + Q_SCRIPTABLE DeviceInfo device(const QString &address); -+ + + /** + * Starts discovery for timeout miliseconds (0 = forever) + */ @@ -929,7 +1541,7 @@ index a8688ae..5115f1b 100644 Q_SCRIPTABLE void stopDiscovering(); private: -@@ -81,11 +95,16 @@ private Q_SLOTS: +@@ -81,20 +97,29 @@ private Q_SLOTS: */ void usableAdapterChanged(Adapter *adapter); @@ -941,12 +1553,15 @@ index a8688ae..5115f1b 100644 */ void agentReleased(); +- void deviceFound(Device*); +- void monolithicQuit(QDBusPendingCallWatcher* watcher); + void login1PrepareForSleep(bool active); + - void deviceFound(Device*); - void monolithicQuit(QDBusPendingCallWatcher* watcher); ++ void deviceFound(Device *device); ++ void monolithicQuit(QDBusPendingCallWatcher *watcher); void monolithicFinished(const QString &); -@@ -94,7 +113,11 @@ private: + + private: void executeMonolithic(); void killMonolithic(); @@ -1040,11 +1655,99 @@ index 6799d91..b65cc5a 100644 Comment[x-test]=xxHandles Bluetooth eventsxx Comment[zh_CN]=处理蓝牙事件 +Comment[zh_TW]=處理藍牙事件 +diff --git a/src/daemon/kded/bluezagent.h b/src/daemon/kded/bluezagent.h +index aedfc90..d5f4db7 100644 +--- a/src/daemon/kded/bluezagent.h ++++ b/src/daemon/kded/bluezagent.h +@@ -19,7 +19,6 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +- + #ifndef BLUEZAGENT_H + #define BLUEZAGENT_H + +@@ -28,7 +27,9 @@ + #include + + class QProcess; +-namespace BlueDevil { ++ ++namespace BlueDevil ++{ + class Adapter; + } + +@@ -41,8 +42,7 @@ namespace BlueDevil { + * @ref AgentListenerWorker + * @since 1.0 + */ +-class BluezAgent +- : public QDBusAbstractAdaptor ++class BluezAgent : public QDBusAbstractAdaptor + { + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.bluez.Agent1") +@@ -51,7 +51,7 @@ public: + /** + * Register the path and initialize the m_adapter + */ +- BluezAgent(QObject *parent); ++ explicit BluezAgent(QObject *parent); + + public Q_SLOTS: + /** +@@ -62,12 +62,12 @@ public Q_SLOTS: + /** + * Called by bluez to ask for a device authoritation + */ +- void AuthorizeService(const QDBusObjectPath &device, const QString& uuid, const QDBusMessage &msg); ++ void AuthorizeService(const QDBusObjectPath &device, const QString &uuid, const QDBusMessage &msg); + + /** + * Called by bluez to ask for a PIN + */ +- QString RequestPinCode(const QDBusObjectPath& device, const QDBusMessage& msg); ++ QString RequestPinCode(const QDBusObjectPath &device, const QDBusMessage &msg); + + /** + * Called by bluez to ask for a passkey, currently is a aslias of RequestPinCode +@@ -112,6 +112,7 @@ public Q_SLOTS: + * This slot gets called when the RequestPasskey helper ends + */ + void processClosedPasskey(int exitCode); ++ + Q_SIGNALS: + /** + * Emited to propagate the release call (so BlueDevil can decide what to do) +@@ -131,7 +132,7 @@ private: + * @param helper Name of the helper + * @param msg The msg got from bluez + */ +- void sendBluezError(const QString& helper, const QDBusMessage &msg); ++ void sendBluezError(const QString &helper, const QDBusMessage &msg); + + /** + * Returns the name of the device if it is registered on the bus +@@ -142,8 +143,9 @@ private: + QString deviceName(const QString &UBI); + + private: +- QProcess *m_process; +- QDBusMessage m_msg; +- QString m_currentHelper; ++ QProcess *m_process; ++ QDBusMessage m_msg; ++ QString m_currentHelper; + }; +-#endif ++ ++#endif // BLUEZAGENT_H diff --git a/src/daemon/kded/filereceiver/filereceiver.cpp b/src/daemon/kded/filereceiver/filereceiver.cpp -index 00405b1..1c8570c 100644 +index 00405b1..91d2005 100644 --- a/src/daemon/kded/filereceiver/filereceiver.cpp +++ b/src/daemon/kded/filereceiver/filereceiver.cpp -@@ -19,11 +19,11 @@ +@@ -19,40 +19,46 @@ #include "filereceiver.h" #include "../BlueDevilDaemon.h" #include "obexagent.h" @@ -1055,9 +1758,11 @@ index 00405b1..1c8570c 100644 #include +#include - FileReceiver::FileReceiver(QObject* parent) +-FileReceiver::FileReceiver(QObject* parent) ++FileReceiver::FileReceiver(QObject *parent) : QObject(parent) -@@ -32,14 +32,17 @@ FileReceiver::FileReceiver(QObject* parent) + { +- qCDebug(BLUEDAEMON); qDBusRegisterMetaType(); new ObexAgent(this); @@ -1078,55 +1783,194 @@ index 00405b1..1c8570c 100644 + // obexd should be set to auto-start by D-Bus (D-Bus activation), so this should restart it in case of crash + QDBusServiceWatcher *serviceWatcher = new QDBusServiceWatcher(QStringLiteral("org.bluez.obex"), QDBusConnection::sessionBus(), + QDBusServiceWatcher::WatchForUnregistration, this); -+ connect(serviceWatcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(registerAgent())); - } - - FileReceiver::~FileReceiver() -@@ -47,6 +50,13 @@ FileReceiver::~FileReceiver() - ++ connect(serviceWatcher, &QDBusServiceWatcher::serviceUnregistered, this, &FileReceiver::registerAgent); } +-FileReceiver::~FileReceiver() +void FileReceiver::registerAgent() -+{ -+ QDBusPendingReply r = m_agentManager->RegisterAgent(QDBusObjectPath(QStringLiteral("/BlueDevil_receiveAgent"))); -+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(r, this); -+ connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(agentRegistered(QDBusPendingCallWatcher*))); -+} -+ - void FileReceiver::agentRegistered(QDBusPendingCallWatcher* call) { - QDBusPendingReply r = *call; +- ++ QDBusPendingReply r = m_agentManager->RegisterAgent(QDBusObjectPath(QStringLiteral("/BlueDevil_receiveAgent"))); ++ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(r, this); ++ connect(watcher, &QDBusPendingCallWatcher::finished, this, &FileReceiver::agentRegistered); + } + +-void FileReceiver::agentRegistered(QDBusPendingCallWatcher* call) ++void FileReceiver::agentRegistered(QDBusPendingCallWatcher *call) + { +- QDBusPendingReply r = *call; +- qCDebug(BLUEDAEMON) << "Error: " << r.isError(); ++ QDBusPendingReply r = *call; ++ + if (r.isError()) { +- qCDebug(BLUEDAEMON) << r.error().message(); ++ qCWarning(BLUEDAEMON) << "Error registering agent" << r.error().message(); ++ } else { ++ qCDebug(BLUEDAEMON) << "Agent registered"; + } + + call->deleteLater(); diff --git a/src/daemon/kded/filereceiver/filereceiver.h b/src/daemon/kded/filereceiver/filereceiver.h -index e6dc6fb..dbfa94b 100644 +index e6dc6fb..7011f4a 100644 --- a/src/daemon/kded/filereceiver/filereceiver.h +++ b/src/daemon/kded/filereceiver/filereceiver.h -@@ -21,6 +21,8 @@ +@@ -21,16 +21,23 @@ #include +#include "obex_agent_manager.h" + class QDBusPendingCallWatcher; ++ class FileReceiver : public QObject { -@@ -30,7 +32,11 @@ class FileReceiver : public QObject - virtual ~FileReceiver(); + Q_OBJECT +- public: +- explicit FileReceiver(QObject* parent = 0); +- virtual ~FileReceiver(); - private Q_SLOTS: -+ void registerAgent(); - void agentRegistered(QDBusPendingCallWatcher* call); +- private Q_SLOTS: +- void agentRegistered(QDBusPendingCallWatcher* call); ++public: ++ explicit FileReceiver(QObject *parent = 0); + -+ private: -+ org::bluez::obex::AgentManager1 *m_agentManager; ++private Q_SLOTS: ++ void registerAgent(); ++ void agentRegistered(QDBusPendingCallWatcher *call); ++ ++private: ++ org::bluez::obex::AgentManager1 *m_agentManager; }; - #endif //FILE_RECEIVER_H +-#endif //FILE_RECEIVER_H ++#endif // FILE_RECEIVER_H +diff --git a/src/daemon/kded/filereceiver/obexagent.cpp b/src/daemon/kded/filereceiver/obexagent.cpp +index 7fc7bca..5af1400 100644 +--- a/src/daemon/kded/filereceiver/obexagent.cpp ++++ b/src/daemon/kded/filereceiver/obexagent.cpp +@@ -24,24 +24,17 @@ + #include + #include + +-ObexAgent::ObexAgent(QObject* parent) ++ObexAgent::ObexAgent(QObject *parent) + : QDBusAbstractAdaptor(parent) + { +- qCDebug(BLUEDAEMON); + if (!QDBusConnection::sessionBus().registerObject(QStringLiteral("/BlueDevil_receiveAgent"), parent)) { +- qDebug() << "The dbus object can't be registered"; +- return; ++ qCWarning(BLUEDAEMON) << "The DBus object can't be registered"; + } + } + +-ObexAgent::~ObexAgent() +-{ +- +-} +- + QString ObexAgent::AuthorizePush(const QDBusObjectPath& path, const QDBusMessage &msg) + { +- qCDebug(BLUEDAEMON); ++ qCDebug(BLUEDAEMON) << "AuthorizePush" << path.path(); + + msg.setDelayedReply(true); + +@@ -53,11 +46,10 @@ QString ObexAgent::AuthorizePush(const QDBusObjectPath& path, const QDBusMessage + + void ObexAgent::Cancel() + { +- qCDebug(BLUEDAEMON); ++ qCDebug(BLUEDAEMON) << "Cancel"; + } + +- + void ObexAgent::Release() + { +- qCDebug(BLUEDAEMON); ++ qCDebug(BLUEDAEMON) << "Release"; + } +diff --git a/src/daemon/kded/filereceiver/obexagent.h b/src/daemon/kded/filereceiver/obexagent.h +index 72c3220..2300fe3 100644 +--- a/src/daemon/kded/filereceiver/obexagent.h ++++ b/src/daemon/kded/filereceiver/obexagent.h +@@ -24,20 +24,19 @@ + #include + + class QDBusMessage; ++ + class ObexAgent : public QDBusAbstractAdaptor + { + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.bluez.obex.Agent1") + +- public: +- explicit ObexAgent(QObject* parent); +- virtual ~ObexAgent(); +- +- public Q_SLOTS: +- QString AuthorizePush(const QDBusObjectPath &path, const QDBusMessage &msg); ++public: ++ explicit ObexAgent(QObject *parent); + +- void Release(); +- void Cancel(); ++public Q_SLOTS: ++ QString AuthorizePush(const QDBusObjectPath &path, const QDBusMessage &msg); ++ void Release(); ++ void Cancel(); + }; + +-#endif //OBEX_AGENT_H ++#endif // OBEX_AGENT_H diff --git a/src/daemon/kded/filereceiver/receivefilejob.cpp b/src/daemon/kded/filereceiver/receivefilejob.cpp -index 5b9a8f4..a3e6190 100644 +index 5b9a8f4..f6342fd 100644 --- a/src/daemon/kded/filereceiver/receivefilejob.cpp +++ b/src/daemon/kded/filereceiver/receivefilejob.cpp -@@ -95,18 +95,29 @@ void ReceiveFileJob::init() +@@ -42,7 +42,7 @@ + + using namespace BlueDevil; + +-ReceiveFileJob::ReceiveFileJob(const QDBusMessage& msg, const QString &path, QObject* parent) ++ReceiveFileJob::ReceiveFileJob(const QDBusMessage &msg, const QString &path, QObject *parent) + : KJob(parent) + , m_speedBytes(0) + , m_path(path) +@@ -51,11 +51,6 @@ ReceiveFileJob::ReceiveFileJob(const QDBusMessage& msg, const QString &path, QOb + setCapabilities(Killable); + } + +-ReceiveFileJob::~ReceiveFileJob() +-{ +- +-} +- + void ReceiveFileJob::start() + { + QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection); +@@ -63,7 +58,6 @@ void ReceiveFileJob::start() + + bool ReceiveFileJob::doKill() + { +- qCDebug(BLUEDAEMON); + m_transfer->Cancel(); + return true; + } +@@ -85,28 +79,40 @@ void ReceiveFileJob::init() + m_path, + QDBusConnection::sessionBus(), + this); +- connect(m_transferProps, +- SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)), +- SLOT(transferPropertiesChanged(QString,QVariantMap,QStringList))); ++ connect(m_transferProps, &org::freedesktop::DBus::Properties::PropertiesChanged, ++ this, &ReceiveFileJob::transferPropertiesChanged); + + m_session = new org::bluez::obex::Session1(QStringLiteral("org.bluez.obex"), + m_transfer->session().path(), + QDBusConnection::sessionBus(), this); ++ qCDebug(BLUEDAEMON) << m_session->destination(); - Device* device = Manager::self()->usableAdapter()->deviceForAddress(m_session->destination()); @@ -1153,10 +1997,195 @@ index 5b9a8f4..a3e6190 100644 FileReceiverSettings::self()->load(); qCDebug(BLUEDAEMON) << "Auto Accept: " << FileReceiverSettings::self()->autoAccept(); - if (FileReceiverSettings::self()->autoAccept() == 1 && device->isTrusted()) { ++ + if (FileReceiverSettings::self()->autoAccept() == 1 && isDeviceTrusted) { slotAccept(); return; } else if (FileReceiverSettings::self()->autoAccept() == 2) { +@@ -133,9 +139,9 @@ void ReceiveFileJob::showNotification() + + m_notification->setActions(actions); + +- connect(m_notification, SIGNAL(action1Activated()), SLOT(slotAccept())); +- connect(m_notification, SIGNAL(action2Activated()), SLOT(slotCancel())); +- connect(m_notification, SIGNAL(closed()), SLOT(slotCancel())); ++ connect(m_notification, &KNotification::action1Activated, this, &ReceiveFileJob::slotAccept); ++ connect(m_notification, &KNotification::action2Activated, this, &ReceiveFileJob::slotCancel); ++ connect(m_notification, &KNotification::closed, this, &ReceiveFileJob::slotCancel); + + int size = IconSize(KIconLoader::Desktop); + m_notification->setPixmap(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")).pixmap(size, size)); +@@ -145,12 +151,13 @@ void ReceiveFileJob::showNotification() + + void ReceiveFileJob::slotAccept() + { +- qCDebug(BLUEDAEMON); + KIO::getJobTracker()->registerJob(this); + + m_originalFileName = m_transfer->name(); + m_tempPath = createTempPath(m_transfer->name()); ++ + qCDebug(BLUEDAEMON) << m_tempPath; ++ + QDBusMessage msg = m_msg.createReply(m_tempPath); + QDBusConnection::sessionBus().send(msg); + } +@@ -166,13 +173,12 @@ void ReceiveFileJob::slotSaveAs() + + void ReceiveFileJob::slotCancel() + { +- qCDebug(BLUEDAEMON); + QDBusMessage msg = m_msg.createErrorReply(QStringLiteral("org.bluez.obex.Error.Rejected"), + QStringLiteral("org.bluez.obex.Error.Rejected")); + QDBusConnection::sessionBus().send(msg); + } + +-void ReceiveFileJob::transferPropertiesChanged(const QString& interface, const QVariantMap& properties, const QStringList& invalidatedProperties) ++void ReceiveFileJob::transferPropertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidatedProperties) + { + qCDebug(BLUEDAEMON) << interface; + qCDebug(BLUEDAEMON) << properties; +@@ -188,9 +194,10 @@ void ReceiveFileJob::transferPropertiesChanged(const QString& interface, const Q + } + } + +-void ReceiveFileJob::statusChanged(const QVariant& value) ++void ReceiveFileJob::statusChanged(const QVariant &value) + { + qCDebug(BLUEDAEMON) << value; ++ + QString status = value.toString(); + + FileReceiverSettings::self()->load(); +@@ -210,7 +217,7 @@ void ReceiveFileJob::statusChanged(const QVariant& value) + } else if (status == QLatin1String("complete")) { + KIO::CopyJob* job = KIO::move(QUrl::fromLocalFile(m_tempPath), savePath, KIO::HideProgressInfo); + job->setUiDelegate(0); +- connect(job, SIGNAL(finished(KJob*)), SLOT(moveFinished(KJob*))); ++ connect(job, &KIO::CopyJob::finished, this, &ReceiveFileJob::moveFinished); + return; + } else if (status == QLatin1String("error")) { + setError(KJob::UserDefinedError); +@@ -224,6 +231,7 @@ void ReceiveFileJob::statusChanged(const QVariant& value) + void ReceiveFileJob::transferChanged(const QVariant& value) + { + qCDebug(BLUEDAEMON) << value; ++ + bool ok = false; + qulonglong bytes = value.toULongLong(&ok); + if (!ok) { +@@ -231,7 +239,7 @@ void ReceiveFileJob::transferChanged(const QVariant& value) + return; + } + +- //If a least 1 second has passed since last update ++ // If a least 1 second has passed since last update + int secondsSinceLastTime = m_time.secsTo(QTime::currentTime()); + if (secondsSinceLastTime > 0) { + float speed = (bytes - m_speedBytes) / secondsSinceLastTime; +@@ -260,13 +268,13 @@ QString ReceiveFileJob::createTempPath(const QString &fileName) const + { + QString xdgCacheHome = QFile::decodeName(qgetenv("XDG_CACHE_HOME")); + if (xdgCacheHome.isEmpty()) { +- xdgCacheHome = QDir::homePath() + QLatin1String("/.cache"); ++ xdgCacheHome = QDir::homePath() + QLatin1String("/.cache"); + } + + xdgCacheHome.append(QLatin1String("/obexd/")); +- QString path = xdgCacheHome + fileName; +- int i = 0; ++ QString path = xdgCacheHome + fileName; + ++ int i = 0; + while (QFile::exists(path)) { + path = xdgCacheHome + fileName + QString::number(i); + i++; +diff --git a/src/daemon/kded/filereceiver/receivefilejob.h b/src/daemon/kded/filereceiver/receivefilejob.h +index 13c6913..68a88fe 100644 +--- a/src/daemon/kded/filereceiver/receivefilejob.h ++++ b/src/daemon/kded/filereceiver/receivefilejob.h +@@ -16,7 +16,6 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * + *************************************************************************************/ + +- + #ifndef RECEIVE_FILE_JOB_H + #define RECEIVE_FILE_JOB_H + +@@ -28,42 +27,44 @@ + class OrgBluezObexSession1Interface; + class OrgBluezObexTransfer1Interface; + class OrgFreedesktopDBusPropertiesInterface; ++ + class ReceiveFileJob : public KJob + { + Q_OBJECT +- public: +- explicit ReceiveFileJob(const QDBusMessage &msg, const QString &path, QObject* parent = 0); +- virtual ~ReceiveFileJob(); + +- virtual void start(); +- protected: +- virtual bool doKill(); ++public: ++ explicit ReceiveFileJob(const QDBusMessage &msg, const QString &path, QObject *parent = 0); ++ ++ void start() Q_DECL_OVERRIDE; ++ ++protected: ++ bool doKill() Q_DECL_OVERRIDE; + +- private Q_SLOTS: +- void init(); +- void showNotification(); +- void slotCancel(); +- void slotAccept(); +- void slotSaveAs(); +- void transferPropertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidatedProperties); +- void moveFinished(KJob* job); ++private Q_SLOTS: ++ void init(); ++ void showNotification(); ++ void slotCancel(); ++ void slotAccept(); ++ void slotSaveAs(); ++ void transferPropertiesChanged(const QString &interface, const QVariantMap &properties, const QStringList &invalidatedProperties); ++ void moveFinished(KJob *job); + +- private: +- void transferChanged(const QVariant &value); +- void statusChanged(const QVariant &value); +- QString createTempPath(const QString &fileName) const; ++private: ++ void transferChanged(const QVariant &value); ++ void statusChanged(const QVariant &value); ++ QString createTempPath(const QString &fileName) const; + +- QTime m_time; +- qulonglong m_speedBytes; +- QString m_path; +- QString m_tempPath; +- QString m_originalFileName; +- QString m_deviceName; +- QDBusMessage m_msg; +- OrgBluezObexSession1Interface *m_session; +- OrgBluezObexTransfer1Interface *m_transfer; +- OrgFreedesktopDBusPropertiesInterface *m_transferProps; ++ QTime m_time; ++ qulonglong m_speedBytes; ++ QString m_path; ++ QString m_tempPath; ++ QString m_originalFileName; ++ QString m_deviceName; ++ QDBusMessage m_msg; ++ OrgBluezObexSession1Interface *m_session; ++ OrgBluezObexTransfer1Interface *m_transfer; ++ OrgFreedesktopDBusPropertiesInterface *m_transferProps; + }; + +-#endif //RECEIVE_FILE_JOB_H ++#endif // RECEIVE_FILE_JOB_H + diff --git a/src/fileitemactionplugin/CMakeLists.txt b/src/fileitemactionplugin/CMakeLists.txt index 3737c68..39d6e33 100644 --- a/src/fileitemactionplugin/CMakeLists.txt @@ -1288,10 +2317,10 @@ index 0000000..e447897 + + diff --git a/src/fileitemactionplugin/sendfileitemaction.cpp b/src/fileitemactionplugin/sendfileitemaction.cpp -index c750bc4..b240470 100644 +index c750bc4..ba9d1fd 100644 --- a/src/fileitemactionplugin/sendfileitemaction.cpp +++ b/src/fileitemactionplugin/sendfileitemaction.cpp -@@ -33,10 +33,6 @@ +@@ -33,57 +33,56 @@ #include #include @@ -1302,7 +2331,9 @@ index c750bc4..b240470 100644 K_PLUGIN_FACTORY_WITH_JSON(SendFileItemActionFactory, "bluedevilsendfile.json", registerPlugin();) -@@ -45,34 +41,37 @@ SendFileItemAction::SendFileItemAction(QObject* parent, const QVariantList& args + +-SendFileItemAction::SendFileItemAction(QObject* parent, const QVariantList& args) ++SendFileItemAction::SendFileItemAction(QObject *parent, const QVariantList &args) : KAbstractFileItemActionPlugin(parent) { Q_UNUSED(args) @@ -1314,10 +2345,12 @@ index c750bc4..b240470 100644 + QDBusConnection::sessionBus(), this); } - QList< QAction* > SendFileItemAction::actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) +-QList< QAction* > SendFileItemAction::actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) ++QList SendFileItemAction::actions(const KFileItemListProperties &infos, QWidget *parent) { - Q_UNUSED(parentWidget) +- Q_UNUSED(parentWidget) - QList< QAction* > list; ++ Q_UNUSED(parent) - m_fileItemInfos = fileItemInfos; + QList list; @@ -1325,12 +2358,12 @@ index c750bc4..b240470 100644 - //If there is no adaptor, there is no bluetooth - if (!Manager::self()->usableAdapter()) { + // Don't show the action for files that we can't send or when Bluetooth is offline. -+ if (!fileItemInfos.isLocal() || !m_kded->isOnline()) { ++ if (!infos.isLocal() || !m_kded->isOnline()) { return list; } - Adapter *adapter = Manager::self()->usableAdapter(); + -+ m_fileItemInfos = fileItemInfos; ++ m_infos = infos; QAction *menuAction = new QAction(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")), i18n("Send via Bluetooth"), this); QMenu *menu = new QMenu(); @@ -1347,19 +2380,66 @@ index c750bc4..b240470 100644 - } + const QMapDeviceInfo &devices = m_kded->allDevices().value(); + Q_FOREACH (const DeviceInfo &device, devices) { -+ if (device[QStringLiteral("UUIDs")].contains(QLatin1String("00001105-0000-1000-8000-00805F9B34FB"))) { -+ QAction *action = new QAction(QIcon::fromTheme(device[QStringLiteral("icon")]), device[QStringLiteral("name")], this); -+ connect(action, SIGNAL(triggered(bool)), this, SLOT(deviceTriggered())); -+ action->setData(device["UBI"]); ++ if (device.value(QStringLiteral("UUIDs")).contains(QLatin1String("00001105-0000-1000-8000-00805F9B34FB"))) { ++ QAction *action = new QAction(QIcon::fromTheme(device[QStringLiteral("icon")]), device.value(QStringLiteral("name")), this); ++ connect(action, &QAction::triggered, this, &SendFileItemAction::deviceTriggered); ++ action->setData(device.value(QStringLiteral("UBI"))); + menu->addAction(action); } } + QAction *otherAction = new QAction(this); +- connect(otherAction, SIGNAL(triggered(bool)), this, SLOT(otherTriggered())); + if (menu->actions().isEmpty()) { + otherAction->setText(i18nc("Find Bluetooth device", "Find Device...")); + } else { + menu->addSeparator(); + otherAction->setText(i18nc("Other Bluetooth device", "Other...")); + } ++ connect(otherAction, &QAction::triggered, this, &SendFileItemAction::otherTriggered); + menu->addAction(otherAction); + + menuAction->setMenu(menu); +@@ -94,13 +93,13 @@ QList< QAction* > SendFileItemAction::actions(const KFileItemListProperties& fil + void SendFileItemAction::deviceTriggered() + { + QStringList args; +- args.append(QLatin1String("-u") % static_cast(sender())->data().toString()); ++ args.append(QStringLiteral("-u") % static_cast(sender())->data().toString()); + +- const QList &fileList = m_fileItemInfos.urlList(); +- Q_FOREACH(const QUrl &url, fileList) { +- args.append(QLatin1String("-f") % url.path()); ++ const QList &fileList = m_infos.urlList(); ++ Q_FOREACH (const QUrl &url, fileList) { ++ args.append(QStringLiteral("-f") % url.path()); + } +- qDebug() << args; ++ + KProcess process; + process.setProgram(QStringLiteral("bluedevil-sendfile"), args); + process.startDetached(); +@@ -108,12 +107,11 @@ void SendFileItemAction::deviceTriggered() + + void SendFileItemAction::otherTriggered() + { +- qDebug(); + QStringList args; + +- const QList &fileList = m_fileItemInfos.urlList(); +- Q_FOREACH(const QUrl &url, fileList) { +- args.append(QLatin1String("-f") % url.path()); ++ const QList &fileList = m_infos.urlList(); ++ Q_FOREACH (const QUrl &url, fileList) { ++ args.append(QStringLiteral("-f") % url.path()); + } + + KProcess process; diff --git a/src/fileitemactionplugin/sendfileitemaction.h b/src/fileitemactionplugin/sendfileitemaction.h -index f9eecc3..389fb64 100644 +index f9eecc3..a194831 100644 --- a/src/fileitemactionplugin/sendfileitemaction.h +++ b/src/fileitemactionplugin/sendfileitemaction.h -@@ -24,12 +24,14 @@ +@@ -24,22 +24,26 @@ #include #include @@ -1372,17 +2452,24 @@ index f9eecc3..389fb64 100644 { -Q_OBJECT + Q_OBJECT ++ public: - SendFileItemAction(QObject* parent, const QVariantList &args); - virtual QList< QAction* > actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget); -@@ -39,6 +41,7 @@ private Q_SLOTS: +- SendFileItemAction(QObject* parent, const QVariantList &args); +- virtual QList< QAction* > actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget); ++ SendFileItemAction(QObject *parent, const QVariantList &args); ++ QList actions(const KFileItemListProperties &infos, QWidget *parent) Q_DECL_OVERRIDE; + + private Q_SLOTS: + void deviceTriggered(); void otherTriggered(); private: +- KFileItemListProperties m_fileItemInfos; + org::kde::BlueDevil *m_kded; - KFileItemListProperties m_fileItemInfos; ++ KFileItemListProperties m_infos; }; + #endif // SENDFILEITEMACTION_H diff --git a/src/fileitemactionplugin/types.h b/src/fileitemactionplugin/types.h new file mode 100644 index 0000000..53f2e4a @@ -1418,7 +2505,7 @@ index 64e6050..4145c1b 100644 target_link_libraries(kcm_bluedevildevices Qt5::Widgets diff --git a/src/kcmodule/bluedeviladapters.cpp b/src/kcmodule/bluedeviladapters.cpp -index 9185552..64dfce2 100644 +index 9185552..13504c9 100644 --- a/src/kcmodule/bluedeviladapters.cpp +++ b/src/kcmodule/bluedeviladapters.cpp @@ -62,8 +62,8 @@ AdapterSettings::AdapterSettings(Adapter *adapter, KCModule *parent) @@ -1465,6 +2552,15 @@ index 9185552..64dfce2 100644 } blockSignals(false); +@@ -320,7 +320,7 @@ void KCMBlueDevilAdapters::generateNoAdaptersMessage() + QGridLayout *layout = new QGridLayout; + m_noAdaptersMessage = new QWidget(this); + QLabel *label = new QLabel(m_noAdaptersMessage); +- label->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(128, 128)); ++ label->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(128)); + layout->addWidget(label, 0, 1, Qt::AlignHCenter); + layout->addWidget(new QLabel(i18n("No adapters found. Please connect one."), m_noAdaptersMessage), + 1, 1, Qt::AlignHCenter); diff --git a/src/kcmodule/bluedeviladapters.desktop b/src/kcmodule/bluedeviladapters.desktop index f1f5e50..7a32916 100644 --- a/src/kcmodule/bluedeviladapters.desktop @@ -1561,10 +2657,41 @@ index f1f5e50..7a32916 100644 +X-KDE-Keywords[zh_TW]=Network,Connectivity,Bluetooth Categories=Qt;KDE;X-KDE-settings-bluetooth; +diff --git a/src/kcmodule/bluedeviladapters.h b/src/kcmodule/bluedeviladapters.h +index 5a775bd..7ecbeb8 100644 +--- a/src/kcmodule/bluedeviladapters.h ++++ b/src/kcmodule/bluedeviladapters.h +@@ -36,7 +36,8 @@ class QLineEdit; + class SystemCheck; + class AdapterSettings; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Adapter; + } + diff --git a/src/kcmodule/bluedevildevices.cpp b/src/kcmodule/bluedevildevices.cpp -index 1135d6f..50a92d0 100644 +index 1135d6f..9474e93 100644 --- a/src/kcmodule/bluedevildevices.cpp +++ b/src/kcmodule/bluedevildevices.cpp +@@ -226,11 +226,11 @@ BluetoothDevicesDelegate::BluetoothDevicesDelegate(QObject *parent) + : QStyledItemDelegate(parent) + , smallIconSize(IconSize(KIconLoader::Toolbar)) + { +- m_blockedPixmap = QIcon::fromTheme(QStringLiteral("dialog-cancel")).pixmap(smallIconSize, smallIconSize); +- m_trustedPixmap = QIcon::fromTheme(QStringLiteral("security-high")).pixmap(smallIconSize, smallIconSize); +- m_untrustedPixmap = QIcon::fromTheme(QStringLiteral("security-low")).pixmap(smallIconSize, smallIconSize); +- m_connectedPixmap = QIcon::fromTheme(QStringLiteral("user-online")).pixmap(smallIconSize, smallIconSize); +- m_disconnectedPixmap = QIcon::fromTheme(QStringLiteral("user-offline")).pixmap(smallIconSize, smallIconSize); ++ m_blockedPixmap = QIcon::fromTheme(QStringLiteral("dialog-cancel")).pixmap(smallIconSize); ++ m_trustedPixmap = QIcon::fromTheme(QStringLiteral("security-high")).pixmap(smallIconSize); ++ m_untrustedPixmap = QIcon::fromTheme(QStringLiteral("security-low")).pixmap(smallIconSize); ++ m_connectedPixmap = QIcon::fromTheme(QStringLiteral("user-online")).pixmap(smallIconSize); ++ m_disconnectedPixmap = QIcon::fromTheme(QStringLiteral("user-offline")).pixmap(smallIconSize); + } + + BluetoothDevicesDelegate::~BluetoothDevicesDelegate() @@ -518,7 +518,11 @@ void KCMBlueDevilDevices::usableAdapterChanged(Adapter *adapter) if (adapter) { connect(adapter, SIGNAL(discoverableChanged(bool)), @@ -1578,6 +2705,15 @@ index 1135d6f..50a92d0 100644 this, SLOT(adapterDevicesChanged())); } fillRemoteDevicesModelInformation(); +@@ -547,7 +551,7 @@ void KCMBlueDevilDevices::generateNoDevicesMessage() + m_noDevicesMessage->setBackgroundRole(QPalette::Base); + m_noDevicesMessage->setAutoFillBackground(true); + QLabel *label = new QLabel(m_noDevicesMessage); +- label->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(128, 128)); ++ label->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(128)); + layout->addWidget(label, 0, 1, Qt::AlignHCenter); + layout->addWidget(new QLabel(i18n("No remote devices have been added"), m_noDevicesMessage), + 1, 1, Qt::AlignHCenter); diff --git a/src/kcmodule/bluedevildevices.desktop b/src/kcmodule/bluedevildevices.desktop index ecf6b45..38b83f9 100644 --- a/src/kcmodule/bluedevildevices.desktop @@ -1679,6 +2815,54 @@ index ecf6b45..38b83f9 100644 +X-KDE-Keywords[zh_TW]=Network,Connectivity,Bluetooth Categories=Qt;KDE;X-KDE-settings-bluetooth; +diff --git a/src/kcmodule/bluedevildevices.h b/src/kcmodule/bluedevildevices.h +index e47b43e..db28629 100644 +--- a/src/kcmodule/bluedevildevices.h ++++ b/src/kcmodule/bluedevildevices.h +@@ -32,7 +32,8 @@ class QCheckBox; + class QPushButton; + class QItemSelection; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Adapter; + class Device; + } +diff --git a/src/kcmodule/bluedeviltransfer.cpp b/src/kcmodule/bluedeviltransfer.cpp +index fd1b120..fa0d55f 100644 +--- a/src/kcmodule/bluedeviltransfer.cpp ++++ b/src/kcmodule/bluedeviltransfer.cpp +@@ -40,6 +40,8 @@ K_PLUGIN_FACTORY_WITH_JSON(BlueDevilFactory, + "bluedeviltransfer.json", + registerPlugin();) + ++using namespace BlueDevil; ++ + //////////////////////////////////////////////////////////////////////////////////////////////////// + + KCMBlueDevilTransfer::KCMBlueDevilTransfer(QWidget *parent, const QVariantList&) +@@ -78,8 +80,7 @@ KCMBlueDevilTransfer::KCMBlueDevilTransfer(QWidget *parent, const QVariantList&) + + addConfig(FileReceiverSettings::self(), transfer); + +- connect(BlueDevil::Manager::self(), SIGNAL(usableAdapterChanged(Adapter*)), +- this, SLOT(usableAdapterChanged(Adapter*))); ++ connect(BlueDevil::Manager::self(), &Manager::usableAdapterChanged, this, &KCMBlueDevilTransfer::usableAdapterChanged); + + BlueDevil::Adapter *const usableAdapter = BlueDevil::Manager::self()->usableAdapter(); + if (usableAdapter) { +@@ -90,10 +91,6 @@ KCMBlueDevilTransfer::KCMBlueDevilTransfer(QWidget *parent, const QVariantList&) + updateInformationState(); + } + +-KCMBlueDevilTransfer::~KCMBlueDevilTransfer() +-{ +-} +- + void KCMBlueDevilTransfer::save() + { + if (!m_restartNeeded) { diff --git a/src/kcmodule/bluedeviltransfer.desktop b/src/kcmodule/bluedeviltransfer.desktop index 804b118..5bea142 100644 --- a/src/kcmodule/bluedeviltransfer.desktop @@ -1772,6 +2956,66 @@ index 804b118..5bea142 100644 +X-KDE-Keywords[zh_TW]=Network,Connectivity,Bluetooth Categories=Qt;KDE;X-KDE-settings-bluetooth; +diff --git a/src/kcmodule/bluedeviltransfer.h b/src/kcmodule/bluedeviltransfer.h +index 5be3ae3..ace8542 100644 +--- a/src/kcmodule/bluedeviltransfer.h ++++ b/src/kcmodule/bluedeviltransfer.h +@@ -24,26 +24,28 @@ + #include + + class SystemCheck; +-namespace Ui { ++ ++namespace Ui ++{ + class Transfer; + } +-namespace BlueDevil { ++ ++namespace BlueDevil ++{ + class Adapter; + } + +-typedef BlueDevil::Adapter Adapter; +- + class KCMBlueDevilTransfer : public KCModule + { + Q_OBJECT + + public: + KCMBlueDevilTransfer(QWidget *parent, const QVariantList&); +- virtual ~KCMBlueDevilTransfer(); + +- virtual void save(); ++ void save() Q_DECL_OVERRIDE; ++ + private Q_SLOTS: +- void usableAdapterChanged(Adapter *adapter); ++ void usableAdapterChanged(BlueDevil::Adapter *adapter); + void adapterDiscoverableChanged(); + void updateInformationState(); + void changed(bool); +@@ -54,4 +56,4 @@ private: + bool m_restartNeeded; + }; + +-#endif ++#endif // _BLUEDEVILTRANSFER_H +diff --git a/src/kcmodule/devicedetails.h b/src/kcmodule/devicedetails.h +index b612587..37326da 100644 +--- a/src/kcmodule/devicedetails.h ++++ b/src/kcmodule/devicedetails.h +@@ -28,7 +28,8 @@ class QLineEdit; + class QAbstractButton; + class QDialogButtonBox; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + } + diff --git a/src/kcmodule/systemcheck.cpp b/src/kcmodule/systemcheck.cpp index 122021b..43cd864 100644 --- a/src/kcmodule/systemcheck.cpp @@ -1914,7 +3158,7 @@ index cb4d6fd..e447897 100644 \ No newline at end of file + diff --git a/src/kio/bluetooth/kiobluetooth.cpp b/src/kio/bluetooth/kiobluetooth.cpp -index e7b1289..6f9c700 100644 +index e7b1289..7d529e6 100644 --- a/src/kio/bluetooth/kiobluetooth.cpp +++ b/src/kio/bluetooth/kiobluetooth.cpp @@ -30,10 +30,6 @@ @@ -1928,36 +3172,46 @@ index e7b1289..6f9c700 100644 extern "C" int Q_DECL_EXPORT kdemain(int argc, char **argv) { QCoreApplication app(argc, argv); -@@ -62,21 +58,22 @@ KioBluetooth::KioBluetooth(const QByteArray &pool, const QByteArray &app) +@@ -61,27 +57,30 @@ KioBluetooth::KioBluetooth(const QByteArray &pool, const QByteArray &app) + s.icon = QStringLiteral("edit-copy"); s.mimetype = QStringLiteral("application/vnd.kde.bluedevil-sendfile"); s.uuid = QStringLiteral("00001105-0000-1000-8000-00805F9B34FB"); - m_supportedServices.insert(QStringLiteral("00001105-0000-1000-8000-00805F9B34FB"), s); +- m_supportedServices.insert(QStringLiteral("00001105-0000-1000-8000-00805F9B34FB"), s); ++ m_supportedServices.insert(s.uuid, s); + s.name = i18n("Browse Files"); s.icon = QStringLiteral("edit-find"); s.mimetype = QString(); s.uuid = QStringLiteral("00001106-0000-1000-8000-00805F9B34FB"); - m_supportedServices.insert(QStringLiteral("00001106-0000-1000-8000-00805F9B34FB"), s); +- m_supportedServices.insert(QStringLiteral("00001106-0000-1000-8000-00805F9B34FB"), s); ++ m_supportedServices.insert(s.uuid, s); - if (!Manager::self()->usableAdapter()) { - qCDebug(BLUETOOTH) << "No available interface"; -- infoMessage(i18n("No Bluetooth adapters have been found.")); -- return; -- } -- - qCDebug(BLUETOOTH) << "Kio Bluetooth instanced!"; - m_kded = new org::kde::BlueDevil(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/bluedevil"), - QDBusConnection::sessionBus(), 0); ++ qCDebug(BLUETOOTH) << "Kio Bluetooth instanced!"; ++ ++ m_kded = new org::kde::BlueDevil(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/bluedevil"), ++ QDBusConnection::sessionBus()); + + if (!m_kded->isOnline()) { + qCDebug(BLUETOOTH) << "Bluetooth is offline"; -+ infoMessage(i18n("No Bluetooth adapters have been found.")); -+ return; -+ } + infoMessage(i18n("No Bluetooth adapters have been found.")); + return; + } +- +- qCDebug(BLUETOOTH) << "Kio Bluetooth instanced!"; +- m_kded = new org::kde::BlueDevil(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/bluedevil"), +- QDBusConnection::sessionBus(), 0); } QList KioBluetooth::getSupportedServices(const QStringList &uuids) -@@ -93,14 +90,22 @@ QList KioBluetooth::getSupportedServices(const QStringLis + { + qCDebug(BLUETOOTH) << "supported services: " << uuids; ++ + QList retValue; + Q_FOREACH (const QString &uuid, uuids) { + if (m_supportedServices.contains(uuid)) { +@@ -93,14 +92,22 @@ QList KioBluetooth::getSupportedServices(const QStringLis void KioBluetooth::listRemoteDeviceServices() { @@ -1983,7 +3237,16 @@ index e7b1289..6f9c700 100644 totalSize(m_currentHostServices.count()); int i = 1; Q_FOREACH (const Service &service, m_currentHostServices) { -@@ -137,11 +142,15 @@ void KioBluetooth::listRemoteDeviceServices() +@@ -109,7 +116,7 @@ void KioBluetooth::listRemoteDeviceServices() + entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, service.name); + entry.insert(KIO::UDSEntry::UDS_ICON_NAME, service.icon); + +- //If it is browse files, act as a folder ++ // If it is browse files, act as a folder + if (service.uuid == QLatin1String("00001106-0000-1000-8000-00805F9B34FB")) { + QUrl obexUrl; + obexUrl.setScheme(QStringLiteral("obexftp")); +@@ -137,11 +144,15 @@ void KioBluetooth::listRemoteDeviceServices() void KioBluetooth::listDevices() { qCDebug(BLUETOOTH) << "Asking kded for devices"; @@ -2000,13 +3263,24 @@ index e7b1289..6f9c700 100644 infoMessage(i18n("Scanning for new devices...")); finished(); } -@@ -207,24 +216,25 @@ void KioBluetooth::get(const QUrl &url) +@@ -173,8 +184,8 @@ void KioBluetooth::listDir(const QUrl &url) + { + qCDebug(BLUETOOTH) << "Listing..." << url; + +- /// Url is not used here becuase all we could care about the url is the host, and that's already +- /// handled in @p setHost ++ // Url is not used here becuase all we could care about the url is the host, and that's already ++ // handled in @p setHost + Q_UNUSED(url); + + // If we are not online (ie. there's no working bluetooth adapter), list an empty dir +@@ -207,24 +218,24 @@ void KioBluetooth::get(const QUrl &url) finished(); } -void KioBluetooth::setHost(const QString &constHostname, quint16 port, const QString &user, -+void KioBluetooth::setHost(const QString &hostname, quint16 port, const QString &user, - const QString &pass) +- const QString &pass) ++void KioBluetooth::setHost(const QString &hostname, quint16 port, const QString &user, const QString &pass) { - qCDebug(BLUETOOTH) << "Setting host: " << constHostname; + qCDebug(BLUETOOTH) << "Setting host: " << hostname; @@ -2032,7 +3306,7 @@ index e7b1289..6f9c700 100644 } diff --git a/src/kio/bluetooth/kiobluetooth.h b/src/kio/bluetooth/kiobluetooth.h -index a353ca9..294835a 100644 +index a353ca9..756bf92 100644 --- a/src/kio/bluetooth/kiobluetooth.h +++ b/src/kio/bluetooth/kiobluetooth.h @@ -36,13 +36,6 @@ @@ -2049,16 +3323,44 @@ index a353ca9..294835a 100644 class KioBluetooth : public QObject, public KIO::SlaveBase { Q_OBJECT -@@ -81,7 +74,7 @@ public: +@@ -62,7 +55,7 @@ public: + * get function shall not do much other than setting a mimetype and returning some data that + * could be useful for the mimetype handler. + */ +- void get(const QUrl &url); ++ void get(const QUrl &url) Q_DECL_OVERRIDE; + + /** + * List current directory. There are two types of current directories in this kio: +@@ -72,16 +65,16 @@ public: + * 2. Remote device directory (something like bluetoth:/00_12_34_56_6d_34). This directory lists + * the services provided by the given remote device. + */ +- void listDir(const QUrl &url); ++ void listDir(const QUrl &url) Q_DECL_OVERRIDE; + +- void stat(const QUrl &url); ++ void stat(const QUrl &url) Q_DECL_OVERRIDE; + + /** + * As at the momento we don't handle more than one level url paths, @p setHost has not much * difference with @p listDir * */ - void setHost(const QString &constHostname, quint16 port, const QString &user, const QString &pass); -+ void setHost(const QString &hostname, quint16 port, const QString &user, const QString &pass); ++ void setHost(const QString &hostname, quint16 port, const QString &user, const QString &pass) Q_DECL_OVERRIDE; /** * Returns a list of supported service names corresponding to the given uuids list. If an uuid is -@@ -120,10 +113,9 @@ private: +@@ -104,7 +97,6 @@ public Q_SLOTS: + void listDevice(const DeviceInfo device); + + private: +- + /** + * This is set to true when @p setHost is called to list a given remote device, like for example + * 00:2a:5E:8e:6e:f5. If listing the remote devices (bluetooth:/ uri), it's set back to false. +@@ -120,10 +112,9 @@ private: QString m_currentHostname; /** @@ -2071,7 +3373,7 @@ index a353ca9..294835a 100644 /** * When @p hasCurrentHost to true, this list holds the list of service names provided by the -@@ -133,12 +125,6 @@ private: +@@ -133,12 +124,6 @@ private: /** * This is an array containing as key the uuid and as value the name of the service that the @@ -2084,6 +3386,16 @@ index a353ca9..294835a 100644 * given uuid represents, and a representative icon. It only contains the supported service names. */ QMap m_supportedServices; +diff --git a/src/kio/obexftp/CMakeLists.txt b/src/kio/obexftp/CMakeLists.txt +index d50825b..a770238 100644 +--- a/src/kio/obexftp/CMakeLists.txt ++++ b/src/kio/obexftp/CMakeLists.txt +@@ -1,5 +1,3 @@ +-project(kio_obexftp) +- + add_subdirectory(daemon) + + set(kio_obexftp_SRCS diff --git a/src/kio/obexftp/daemon/CMakeLists.txt b/src/kio/obexftp/daemon/CMakeLists.txt index b7ad5d2..8a4ff87 100644 --- a/src/kio/obexftp/daemon/CMakeLists.txt @@ -3152,110 +4464,128 @@ index d82cd30..d594359 100644 -#endif //KIO_GET_FILE_JOB_H \ No newline at end of file +#endif //KIO_GET_FILE_JOB_H +diff --git a/src/monolithic/CMakeLists.txt b/src/monolithic/CMakeLists.txt +index f39964e..685e30f 100644 +--- a/src/monolithic/CMakeLists.txt ++++ b/src/monolithic/CMakeLists.txt +@@ -17,4 +17,4 @@ target_link_libraries(bluedevil-monolithic + ${LibBlueDevil_LIBRARIES}) + + install(TARGETS bluedevil-monolithic ${INSTALL_TARGETS_DEFAULT_ARGS}) +-install(FILES bluedevil-monolithic.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) ++install(FILES org.kde.bluedevilmonolithic.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) diff --git a/src/monolithic/bluedevil-monolithic.desktop b/src/monolithic/bluedevil-monolithic.desktop -index 3911e87..f69c51d 100644 +deleted file mode 100644 +index 3911e87..0000000 --- a/src/monolithic/bluedevil-monolithic.desktop -+++ b/src/monolithic/bluedevil-monolithic.desktop -@@ -2,14 +2,22 @@ - Type=Application - Version=1.0 - Name=BlueDevil -+Name[bs]=BlueDevil - Name[ca]=BlueDevil - Name[cs]=BlueDevil - Name[de]=BlueDevil -+Name[el]=BlueDevil - Name[en_GB]=BlueDevil - Name[es]=BlueDevil - Name[fi]=BlueDevil - Name[fr]=BlueDevil - Name[it]=BlueDevil -+Name[ja]=BlueDevil -+Name[kk]=BlueDevil -+Name[km]=BlueDevil -+Name[ko]=BlueDevil -+Name[lt]=BlueDevil -+Name[mr]=ब्लु-डेव्हिल - Name[nb]=BlueDevil - Name[nl]=BlueDevil - Name[pl]=BlueDevil -@@ -22,20 +30,31 @@ Name[sr@ijekavian]=Блудевил - Name[sr@ijekavianlatin]=BlueDevil - Name[sr@latin]=BlueDevil - Name[sv]=Blådjävul -+Name[tr]=BlueDevil - Name[uk]=BlueDevil - Name[x-test]=xxBlueDevilxx - Name[zh_CN]=BlueDevil -+Name[zh_TW]=BlueDevil - GenericName=BlueDevil -+GenericName[bs]=BlueDevil - GenericName[ca]=BlueDevil - GenericName[cs]=BlueDevil - GenericName[de]=BlueDevil -+GenericName[el]=BlueDevil - GenericName[en_GB]=BlueDevil - GenericName[es]=BlueDevil - GenericName[fi]=BlueDevil - GenericName[fr]=BlueDevil - GenericName[it]=BlueDevil -+GenericName[ja]=BlueDevil -+GenericName[kk]=BlueDevil -+GenericName[km]=BlueDevil -+GenericName[ko]=BlueDevil -+GenericName[lt]=BlueDevil -+GenericName[mr]=ब्लु-डेव्हिल - GenericName[nb]=BlueDevil - GenericName[nl]=BlueDevil -+GenericName[pa]=BlueDevil - GenericName[pl]=BlueDevil - GenericName[pt]=BlueDevil - GenericName[pt_BR]=BlueDevil -@@ -46,21 +65,32 @@ GenericName[sr@ijekavian]=Блудевил - GenericName[sr@ijekavianlatin]=BlueDevil - GenericName[sr@latin]=BlueDevil - GenericName[sv]=Blådjävul -+GenericName[tr]=BlueDevil - GenericName[uk]=BlueDevil - GenericName[x-test]=xxBlueDevilxx - GenericName[zh_CN]=BlueDevil -+GenericName[zh_TW]=BlueDevil - Exec=bluedevil-monolithic - Comment=KDE Bluetooth support -+Comment[bs]=Podrška blututa u KDE‑u - Comment[ca]=Implementació Bluetooth del KDE - Comment[cs]=Podpora Bluetooth v KDE - Comment[de]=KDE-Bluetooth-Unterstützung -+Comment[el]=Υποστήριξη Bluetooth στο KDE - Comment[en_GB]=KDE Bluetooth support - Comment[es]=Implementación Bluetooth para KDE - Comment[fi]=KDE:n Bluetooth-tuki - Comment[fr]=Prise en charge de Bluetooth pour KDE - Comment[it]=Supporto Bluetooth per KDE -+Comment[ja]=KDE Bluetooth サポート -+Comment[kk]=KDE Bluetooth қолдауы -+Comment[km]=គាំទ្រ​ប៊្លូធូស​របស់​ KDE -+Comment[ko]=KDE 블루투스 지원 -+Comment[lt]=KDE Bluetooth palaikymas -+Comment[mr]=केडीई ब्लूटूथ समर्थन - Comment[nb]=KDE Blåtann-støtte - Comment[nl]=KDE Bluetooth ondersteuning -+Comment[pa]=KDE ਬਲਿਊਟੁੱਥ ਸਹਿਯੋਗ - Comment[pl]=Obsługa Bluetooth w KDE - Comment[pt]=Suporte para Bluetooth no KDE - Comment[pt_BR]=Suporte para Bluetooth do KDE -@@ -71,9 +101,11 @@ Comment[sr@ijekavian]=Подршка блутута у КДЕ‑у - Comment[sr@ijekavianlatin]=Podrška Bluetootha u KDE‑u - Comment[sr@latin]=Podrška Bluetootha u KDE‑u - Comment[sv]=KDE:s Blåtandstöd -+Comment[tr]=KDE Bluetooth desteği - Comment[uk]=Підтримка Bluetooth у KDE - Comment[x-test]=xxKDE Bluetooth supportxx - Comment[zh_CN]=KDE 蓝牙支持 -+Comment[zh_TW]=KDE 藍牙支援 - Icon=preferences-system-bluetooth - Terminal=false - Categories=Qt;KDE;X-Bluetooth;Network; ++++ /dev/null +@@ -1,79 +0,0 @@ +-[Desktop Entry] +-Type=Application +-Version=1.0 +-Name=BlueDevil +-Name[ca]=BlueDevil +-Name[cs]=BlueDevil +-Name[de]=BlueDevil +-Name[en_GB]=BlueDevil +-Name[es]=BlueDevil +-Name[fi]=BlueDevil +-Name[fr]=BlueDevil +-Name[it]=BlueDevil +-Name[nb]=BlueDevil +-Name[nl]=BlueDevil +-Name[pl]=BlueDevil +-Name[pt]=BlueDevil +-Name[pt_BR]=BlueDevil +-Name[sk]=BlueDevil +-Name[sl]=BlueDevil +-Name[sr]=Блудевил +-Name[sr@ijekavian]=Блудевил +-Name[sr@ijekavianlatin]=BlueDevil +-Name[sr@latin]=BlueDevil +-Name[sv]=Blådjävul +-Name[uk]=BlueDevil +-Name[x-test]=xxBlueDevilxx +-Name[zh_CN]=BlueDevil +-GenericName=BlueDevil +-GenericName[ca]=BlueDevil +-GenericName[cs]=BlueDevil +-GenericName[de]=BlueDevil +-GenericName[en_GB]=BlueDevil +-GenericName[es]=BlueDevil +-GenericName[fi]=BlueDevil +-GenericName[fr]=BlueDevil +-GenericName[it]=BlueDevil +-GenericName[nb]=BlueDevil +-GenericName[nl]=BlueDevil +-GenericName[pl]=BlueDevil +-GenericName[pt]=BlueDevil +-GenericName[pt_BR]=BlueDevil +-GenericName[sk]=BlueDevil +-GenericName[sl]=BlueDevil +-GenericName[sr]=Блудевил +-GenericName[sr@ijekavian]=Блудевил +-GenericName[sr@ijekavianlatin]=BlueDevil +-GenericName[sr@latin]=BlueDevil +-GenericName[sv]=Blådjävul +-GenericName[uk]=BlueDevil +-GenericName[x-test]=xxBlueDevilxx +-GenericName[zh_CN]=BlueDevil +-Exec=bluedevil-monolithic +-Comment=KDE Bluetooth support +-Comment[ca]=Implementació Bluetooth del KDE +-Comment[cs]=Podpora Bluetooth v KDE +-Comment[de]=KDE-Bluetooth-Unterstützung +-Comment[en_GB]=KDE Bluetooth support +-Comment[es]=Implementación Bluetooth para KDE +-Comment[fi]=KDE:n Bluetooth-tuki +-Comment[fr]=Prise en charge de Bluetooth pour KDE +-Comment[it]=Supporto Bluetooth per KDE +-Comment[nb]=KDE Blåtann-støtte +-Comment[nl]=KDE Bluetooth ondersteuning +-Comment[pl]=Obsługa Bluetooth w KDE +-Comment[pt]=Suporte para Bluetooth no KDE +-Comment[pt_BR]=Suporte para Bluetooth do KDE +-Comment[sk]=Podpora Bluetooth KDE +-Comment[sl]=KDE-jeva podpora za Bluetooth +-Comment[sr]=Подршка блутута у КДЕ‑у +-Comment[sr@ijekavian]=Подршка блутута у КДЕ‑у +-Comment[sr@ijekavianlatin]=Podrška Bluetootha u KDE‑u +-Comment[sr@latin]=Podrška Bluetootha u KDE‑u +-Comment[sv]=KDE:s Blåtandstöd +-Comment[uk]=Підтримка Bluetooth у KDE +-Comment[x-test]=xxKDE Bluetooth supportxx +-Comment[zh_CN]=KDE 蓝牙支持 +-Icon=preferences-system-bluetooth +-Terminal=false +-Categories=Qt;KDE;X-Bluetooth;Network; +diff --git a/src/monolithic/main.cpp b/src/monolithic/main.cpp +index ae560a7..13ae42e 100644 +--- a/src/monolithic/main.cpp ++++ b/src/monolithic/main.cpp +@@ -42,11 +42,11 @@ int main(int argc, char *argv[]) + QStringLiteral("ereslibre@kde.org"), QStringLiteral("http://www.ereslibre.es/")); + + QApplication app(argc, argv); +- app.setApplicationName(QStringLiteral("bluedevilmonolithic")); +- app.setApplicationVersion(bluedevil_version); +- app.setOrganizationDomain(QStringLiteral("kde.org")); + app.setQuitOnLastWindowClosed(false); + ++ KAboutData::setApplicationData(aboutData); ++ KDBusService service(KDBusService::Unique); ++ + QCommandLineParser parser; + parser.setApplicationDescription(i18n("Bluetooth")); + parser.addVersionOption(); +@@ -54,7 +54,6 @@ int main(int argc, char *argv[]) + + parser.process(app); + +- KDBusService service(KDBusService::Unique); + Monolithic monolithic; + + return app.exec(); diff --git a/src/monolithic/monolithic.cpp b/src/monolithic/monolithic.cpp index 5480752..fb6a23c 100644 --- a/src/monolithic/monolithic.cpp @@ -3307,72 +4637,1142 @@ index 5480752..fb6a23c 100644 setTooltipTitleStatus(false); QMenu *const menu = contextMenu(); +diff --git a/src/monolithic/monolithic.h b/src/monolithic/monolithic.h +index 00baf1b..cb13cad 100644 +--- a/src/monolithic/monolithic.h ++++ b/src/monolithic/monolithic.h +@@ -22,7 +22,8 @@ + + #include + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Adapter; + class Device; + } +@@ -31,8 +32,7 @@ class QAction; + + using namespace BlueDevil; + +-class Monolithic +- : public KStatusNotifierItem ++class Monolithic : public KStatusNotifierItem + { + + Q_OBJECT +diff --git a/src/monolithic/org.kde.bluedevilmonolithic.desktop b/src/monolithic/org.kde.bluedevilmonolithic.desktop +new file mode 100644 +index 0000000..f4572ef +--- /dev/null ++++ b/src/monolithic/org.kde.bluedevilmonolithic.desktop +@@ -0,0 +1,98 @@ ++[Desktop Entry] ++Name=BlueDevil ++Name[bs]=BlueDevil ++Name[ca]=BlueDevil ++Name[cs]=BlueDevil ++Name[de]=BlueDevil ++Name[el]=BlueDevil ++Name[en_GB]=BlueDevil ++Name[es]=BlueDevil ++Name[fi]=BlueDevil ++Name[fr]=BlueDevil ++Name[it]=BlueDevil ++Name[ja]=BlueDevil ++Name[nb]=BlueDevil ++Name[nl]=BlueDevil ++Name[pl]=BlueDevil ++Name[pt]=BlueDevil ++Name[pt_BR]=BlueDevil ++Name[sk]=BlueDevil ++Name[sl]=BlueDevil ++Name[sr]=Блудевил ++Name[sr@ijekavian]=Блудевил ++Name[sr@ijekavianlatin]=BlueDevil ++Name[sr@latin]=BlueDevil ++Name[sv]=Blådjävul ++Name[tr]=BlueDevil ++Name[uk]=BlueDevil ++Name[x-test]=xxBlueDevilxx ++Name[zh_CN]=BlueDevil ++Name[zh_TW]=BlueDevil ++GenericName=BlueDevil ++GenericName[bs]=BlueDevil ++GenericName[ca]=BlueDevil ++GenericName[cs]=BlueDevil ++GenericName[de]=BlueDevil ++GenericName[el]=BlueDevil ++GenericName[en_GB]=BlueDevil ++GenericName[es]=BlueDevil ++GenericName[fi]=BlueDevil ++GenericName[fr]=BlueDevil ++GenericName[it]=BlueDevil ++GenericName[ja]=BlueDevil ++GenericName[nb]=BlueDevil ++GenericName[nl]=BlueDevil ++GenericName[pa]=BlueDevil ++GenericName[pl]=BlueDevil ++GenericName[pt]=BlueDevil ++GenericName[pt_BR]=BlueDevil ++GenericName[sk]=BlueDevil ++GenericName[sl]=BlueDevil ++GenericName[sr]=Блудевил ++GenericName[sr@ijekavian]=Блудевил ++GenericName[sr@ijekavianlatin]=BlueDevil ++GenericName[sr@latin]=BlueDevil ++GenericName[sv]=Blådjävul ++GenericName[tr]=BlueDevil ++GenericName[uk]=BlueDevil ++GenericName[x-test]=xxBlueDevilxx ++GenericName[zh_CN]=BlueDevil ++GenericName[zh_TW]=BlueDevil ++Comment=KDE Bluetooth support ++Comment[bs]=Podrška blututa u KDE‑u ++Comment[ca]=Implementació Bluetooth del KDE ++Comment[cs]=Podpora Bluetooth v KDE ++Comment[de]=KDE-Bluetooth-Unterstützung ++Comment[el]=Υποστήριξη Bluetooth στο KDE ++Comment[en_GB]=KDE Bluetooth support ++Comment[es]=Implementación Bluetooth para KDE ++Comment[fi]=KDE:n Bluetooth-tuki ++Comment[fr]=Prise en charge de Bluetooth pour KDE ++Comment[it]=Supporto Bluetooth per KDE ++Comment[ja]=KDE Bluetooth サポート ++Comment[nb]=KDE Blåtann-støtte ++Comment[nl]=KDE Bluetooth ondersteuning ++Comment[pa]=KDE ਬਲਿਊਟੁੱਥ ਸਹਿਯੋਗ ++Comment[pl]=Obsługa Bluetooth w KDE ++Comment[pt]=Suporte para Bluetooth no KDE ++Comment[pt_BR]=Suporte para Bluetooth do KDE ++Comment[sk]=Podpora Bluetooth KDE ++Comment[sl]=KDE-jeva podpora za Bluetooth ++Comment[sr]=Подршка блутута у КДЕ‑у ++Comment[sr@ijekavian]=Подршка блутута у КДЕ‑у ++Comment[sr@ijekavianlatin]=Podrška Bluetootha u KDE‑u ++Comment[sr@latin]=Podrška Bluetootha u KDE‑u ++Comment[sv]=KDE:s Blåtandstöd ++Comment[tr]=KDE Bluetooth desteği ++Comment[uk]=Підтримка Bluetooth у KDE ++Comment[x-test]=xxKDE Bluetooth supportxx ++Comment[zh_CN]=KDE 蓝牙支持 ++Comment[zh_TW]=KDE 藍牙支援 ++ ++Type=Application ++Exec=bluedevil-monolithic ++Icon=preferences-system-bluetooth ++Terminal=false ++Categories=Qt;KDE;X-Bluetooth;Network; ++X-DBUS-StartupType=Unique ++X-DBUS-ServiceName=org.kde.bluedevilmonolithic +diff --git a/src/sendfile/CMakeLists.txt b/src/sendfile/CMakeLists.txt +index 9004cbe..c0ea4c7 100644 +--- a/src/sendfile/CMakeLists.txt ++++ b/src/sendfile/CMakeLists.txt +@@ -32,10 +32,11 @@ target_link_libraries(bluedevil-sendfile + Qt5::DBus + KF5::I18n + KF5::CoreAddons ++ KF5::DBusAddons + KF5::IconThemes + KF5::KIOFileWidgets + ${LibBlueDevil_LIBRARIES} + ) + + install(TARGETS bluedevil-sendfile DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) +-install(FILES bluedevil-sendfile.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) ++install(FILES org.kde.bluedevilsendfile.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) diff --git a/src/sendfile/bluedevil-sendfile.desktop b/src/sendfile/bluedevil-sendfile.desktop -index 4e7169e..d1cbd29 100644 +deleted file mode 100644 +index 4e7169e..0000000 --- a/src/sendfile/bluedevil-sendfile.desktop -+++ b/src/sendfile/bluedevil-sendfile.desktop -@@ -2,9 +2,11 @@ - Type=Application - Version=1.0 - Name=BlueDevil Send File ++++ /dev/null +@@ -1,81 +0,0 @@ +-[Desktop Entry] +-Type=Application +-Version=1.0 +-Name=BlueDevil Send File +-Name[ca]=Envia fitxer amb BlueDevil +-Name[cs]=Posílání souborů BlueDevil +-Name[de]=BlueDevil-Dateiversand +-Name[en_GB]=BlueDevil Send File +-Name[es]=Enviar archivo con BlueDevil +-Name[fi]=BlueDevil-tiedostonlähetys +-Name[fr]=Envoi de fichiers par BlueDevil +-Name[it]=Invio file di BlueDevil +-Name[nb]=BlueDevil send fil +-Name[nl]=BlueDevil bestand verzenden +-Name[pl]=Wysłanie pliku BlueDevil +-Name[pt]=Envio de Ficheiro do Bluetooth +-Name[pt_BR]=Envio de arquivo do BlueDevil +-Name[sk]=Posielanie súborov BlueDevil +-Name[sl]=BlueDevil – pošiljanje datotek +-Name[sr]=Блудевилово слање фајла +-Name[sr@ijekavian]=Блудевилово слање фајла +-Name[sr@ijekavianlatin]=BlueDevilovo slanje fajla +-Name[sr@latin]=BlueDevilovo slanje fajla +-Name[sv]=Blådjävul skicka fil +-Name[uk]=Надсилання файла BlueDevil +-Name[x-test]=xxBlueDevil Send Filexx +-Name[zh_CN]=BlueDevil 发送文件 +-GenericName=BlueDevil Send File +-GenericName[ca]=Envia fitxers amb BlueDevil +-GenericName[cs]=Posílání souborů BlueDevil +-GenericName[de]=BlueDevil-Dateiversand +-GenericName[en_GB]=BlueDevil Send File +-GenericName[es]=Enviar archivo con BlueDevil +-GenericName[fi]=BlueDevil-tiedostonlähetys +-GenericName[fr]=Envoi de fichiers par BlueDevil +-GenericName[it]=Invio file di BlueDevil +-GenericName[nb]=BlueDevil send fil +-GenericName[nl]=BlueDevil bestand verzenden +-GenericName[pl]=Wysłanie pliku BlueDevil +-GenericName[pt]=Envio de Ficheiro do Bluetooth +-GenericName[pt_BR]=Envio de arquivo do BlueDevil +-GenericName[sk]=Posielanie súborov BlueDevil +-GenericName[sl]=BlueDevil – pošiljanje datotek +-GenericName[sr]=Блудевилово слање фајла +-GenericName[sr@ijekavian]=Блудевилово слање фајла +-GenericName[sr@ijekavianlatin]=BlueDevilovo slanje fajla +-GenericName[sr@latin]=BlueDevilovo slanje fajla +-GenericName[sv]=Blådjävul skicka fil +-GenericName[uk]=Надсилання файла BlueDevil +-GenericName[x-test]=xxBlueDevil Send Filexx +-GenericName[zh_CN]=BlueDevil 发送文件 +-MimeType=application/vnd.kde.bluedevil-sendfile; +-Exec=bluedevil-sendfile -k%U +-Comment=BlueDevil Send File +-Comment[ca]=Envia fitxers amb BlueDevil +-Comment[cs]=Posílání souborů BlueDevil +-Comment[de]=BlueDevil-Dateiversand +-Comment[en_GB]=BlueDevil Send File +-Comment[es]=Enviar archivo con BlueDevil +-Comment[fi]=BlueDevil-tiedostonlähetys +-Comment[fr]=Envoi de fichiers par BlueDevil +-Comment[it]=Invio file di BlueDevil +-Comment[nb]=BlueDevil send fil +-Comment[nl]=BlueDevil bestand verzenden +-Comment[pl]=Wysłanie pliku BlueDevil +-Comment[pt]=Envio de Ficheiro do Bluetooth +-Comment[pt_BR]=Envio de arquivo do BlueDevil +-Comment[sk]=Posielanie súborov BlueDevil +-Comment[sl]=BlueDevil – pošiljanje datotek +-Comment[sr]=Блудевилово слање фајла +-Comment[sr@ijekavian]=Блудевилово слање фајла +-Comment[sr@ijekavianlatin]=BlueDevilovo slanje fajla +-Comment[sr@latin]=BlueDevilovo slanje fajla +-Comment[sv]=Blådjävul skicka fil +-Comment[uk]=Надсилання файла BlueDevil +-Comment[x-test]=xxBlueDevil Send Filexx +-Comment[zh_CN]=BlueDevil 发送文件 +-Icon=preferences-system-bluetooth +-Terminal=false +-Categories=Qt;KDE;X-Bluetooth;Network; +-NoDisplay=true +diff --git a/src/sendfile/discoverwidget.cpp b/src/sendfile/discoverwidget.cpp +index 903da16..4cb5af9 100644 +--- a/src/sendfile/discoverwidget.cpp ++++ b/src/sendfile/discoverwidget.cpp +@@ -20,9 +20,9 @@ + * Boston, MA 02110-1301, USA. * + *****************************************************************************/ + +- + #include "discoverwidget.h" + #include "ui_discover.h" ++#include "debug_p.h" + + #include + #include +@@ -35,28 +35,23 @@ + + using namespace BlueDevil; + +-DiscoverWidget::DiscoverWidget(QWidget* parent) : QWidget(parent) ++DiscoverWidget::DiscoverWidget(QWidget* parent) ++ : QWidget(parent) + { + setupUi(this); + +- connect(deviceList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, +- SLOT(itemSelected(QListWidgetItem*))); +- connect(Manager::self()->usableAdapter(), SIGNAL(deviceFound(Device*)), this, +- SLOT(deviceFound(Device*))); ++ connect(deviceList, &QListWidget::currentItemChanged, this, &DiscoverWidget::itemSelected); ++ connect(Manager::self()->usableAdapter(), &Adapter::deviceFound, this, &DiscoverWidget::deviceFound); + + startScan(); + } + +-DiscoverWidget::~DiscoverWidget() +-{ +-} +- + void DiscoverWidget::startScan() + { + deviceList->clear(); + stopScan(); + +- QList knownDevices = Manager::self()->usableAdapter()->devices(); ++ QList knownDevices = Manager::self()->usableAdapter()->devices(); + Q_FOREACH(Device *device, knownDevices) { + if (device->UUIDs().contains(QLatin1String("00001105-0000-1000-8000-00805F9B34FB"), Qt::CaseInsensitive)) { + deviceFound(device); +@@ -72,27 +67,19 @@ void DiscoverWidget::stopScan() + } + } + +-void DiscoverWidget::deviceFound(const QVariantMap& deviceInfo) +-{ +- deviceFoundGeneric(deviceInfo[QStringLiteral("Address")].toString(), +- deviceInfo[QStringLiteral("Name")].toString(), +- deviceInfo[QStringLiteral("Icon")].toString(), +- deviceInfo[QStringLiteral("Alias")].toString()); +-} +- +-void DiscoverWidget::deviceFound(Device* device) ++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; +- qDebug() << "Alias: " << alias; +- qDebug() << "Icon: " << icon; +- qDebug() << "\n"; ++ qCDebug(SENDFILE) << "========================"; ++ qCDebug(SENDFILE) << "Address: " << address; ++ qCDebug(SENDFILE) << "Name: " << name; ++ qCDebug(SENDFILE) << "Alias: " << alias; ++ qCDebug(SENDFILE) << "Icon: " << icon; ++ qCDebug(SENDFILE) << "\n"; + + + bool origName = false; +@@ -101,7 +88,7 @@ void DiscoverWidget::deviceFoundGeneric(QString address, QString name, QString i + } + + if (!alias.isEmpty() && alias != name && !name.isEmpty()) { +- name = QString("%1 (%2)").arg(alias).arg(name); ++ name = QString(QStringLiteral("%1 (%2)")).arg(alias).arg(name); + } + + if (name.isEmpty()) { +@@ -131,7 +118,7 @@ void DiscoverWidget::deviceFoundGeneric(QString address, QString name, QString i + m_itemRelation.insert(address, item); + } + +-void DiscoverWidget::itemSelected(QListWidgetItem* item) ++void DiscoverWidget::itemSelected(QListWidgetItem *item) + { + emit deviceSelected(Manager::self()->usableAdapter()->deviceForAddress(item->data(Qt::UserRole).toString())); + } +diff --git a/src/sendfile/discoverwidget.h b/src/sendfile/discoverwidget.h +index d1cc03b..3516c61 100644 +--- a/src/sendfile/discoverwidget.h ++++ b/src/sendfile/discoverwidget.h +@@ -20,7 +20,6 @@ + * Boston, MA 02110-1301, USA. * + *****************************************************************************/ + +- + #ifndef DISCOVERWIDGET_H + #define DISCOVERWIDGET_H + +@@ -31,28 +30,26 @@ + class QTimer; + class BlueWizard; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + } +-using namespace BlueDevil; + +-class DiscoverWidget : public QWidget +-, public Ui::Discover ++class DiscoverWidget : public QWidget, public Ui::Discover + { +-Q_OBJECT ++ Q_OBJECT + + public: +- DiscoverWidget(QWidget* parent = 0); +- virtual ~DiscoverWidget(); ++ explicit DiscoverWidget(QWidget *parent = 0); ++ + void stopScan(); + + public Q_SLOTS: + void startScan(); + + private Q_SLOTS: +- void deviceFound(const QVariantMap &deviceInfo); +- void deviceFound(Device* device); +- void itemSelected(QListWidgetItem* item); ++ void deviceFound(BlueDevil::Device *device); ++ void itemSelected(QListWidgetItem *item); + + private: + void deviceFoundGeneric(QString address, QString name, QString icon, QString alias); +@@ -62,7 +59,7 @@ private: + BlueWizard *m_wizard; + + Q_SIGNALS: +- void deviceSelected(Device *device); ++ void deviceSelected(BlueDevil::Device *device); + }; + + #endif // DISCOVERWIDGET_H +diff --git a/src/sendfile/main.cpp b/src/sendfile/main.cpp +index 1b1bb8b..4f593d3 100644 +--- a/src/sendfile/main.cpp ++++ b/src/sendfile/main.cpp +@@ -25,6 +25,7 @@ + #include + + #include ++#include + #include + + #include +@@ -44,13 +45,12 @@ int main(int argc, char *argv[]) + QStringLiteral("afiestas@kde.org"), QStringLiteral("http://www.afiestas.org/")); + + QApplication app(argc, argv); +- app.setApplicationName(QStringLiteral("bluedevilsendfile")); +- app.setApplicationVersion(bluedevil_version); +- app.setApplicationDisplayName(i18n("Bluetooth Send File Helper")); +- app.setOrganizationDomain(QStringLiteral("kde.org")); + app.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth"))); + app.setQuitOnLastWindowClosed(false); + ++ KAboutData::setApplicationData(aboutData); ++ KDBusService service; ++ + QCommandLineOption kioOption({QLatin1String("kio"), QLatin1String("k")}, i18n("Device UUID where the files will be sent")); + kioOption.setValueName(QStringLiteral("bluetooth://mac")); + +@@ -75,8 +75,12 @@ int main(int argc, char *argv[]) + deviceInfo = parser.value(kioOption); + } + +- SendFileWizard *sendFileWizard = new SendFileWizard(deviceInfo, parser.values(filesOption)); +- sendFileWizard->show(); ++ SendFileWizard *wizard = new SendFileWizard(deviceInfo, parser.values(filesOption)); ++ wizard->show(); ++ ++ QObject::connect(&service, &KDBusService::activateRequested, wizard, [wizard]() { ++ wizard->setWindowState((wizard->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive); ++ }); + + return app.exec(); + } +diff --git a/src/sendfile/org.kde.bluedevilsendfile.desktop b/src/sendfile/org.kde.bluedevilsendfile.desktop +new file mode 100644 +index 0000000..d976633 +--- /dev/null ++++ b/src/sendfile/org.kde.bluedevilsendfile.desktop +@@ -0,0 +1,94 @@ ++[Desktop Entry] ++Name=BlueDevil Send File +Name[bs]=Bludevilovo slanje datoteke - Name[ca]=Envia fitxer amb BlueDevil - Name[cs]=Posílání souborů BlueDevil - Name[de]=BlueDevil-Dateiversand ++Name[ca]=Envia fitxer amb BlueDevil ++Name[cs]=Posílání souborů BlueDevil ++Name[de]=BlueDevil-Dateiversand +Name[el]=Αποστολή αρχείου μέσω BlueDevil - Name[en_GB]=BlueDevil Send File - Name[es]=Enviar archivo con BlueDevil - Name[fi]=BlueDevil-tiedostonlähetys -@@ -22,13 +24,17 @@ Name[sr@ijekavian]=Блудевилово слање фајла - Name[sr@ijekavianlatin]=BlueDevilovo slanje fajla - Name[sr@latin]=BlueDevilovo slanje fajla - Name[sv]=Blådjävul skicka fil ++Name[en_GB]=BlueDevil Send File ++Name[es]=Enviar archivo con BlueDevil ++Name[fi]=BlueDevil-tiedostonlähetys ++Name[fr]=Envoi de fichiers par BlueDevil ++Name[it]=Invio file di BlueDevil ++Name[nb]=BlueDevil send fil ++Name[nl]=BlueDevil bestand verzenden ++Name[pl]=Wysłanie pliku BlueDevil ++Name[pt]=Envio de Ficheiro do Bluetooth ++Name[pt_BR]=Envio de arquivo do BlueDevil ++Name[sk]=Posielanie súborov BlueDevil ++Name[sl]=BlueDevil – pošiljanje datotek ++Name[sr]=Блудевилово слање фајла ++Name[sr@ijekavian]=Блудевилово слање фајла ++Name[sr@ijekavianlatin]=BlueDevilovo slanje fajla ++Name[sr@latin]=BlueDevilovo slanje fajla ++Name[sv]=Blådjävul skicka fil +Name[tr]=BlueDevil Dosya Gönder - Name[uk]=Надсилання файла BlueDevil - Name[x-test]=xxBlueDevil Send Filexx - Name[zh_CN]=BlueDevil 发送文件 ++Name[uk]=Надсилання файла BlueDevil ++Name[x-test]=xxBlueDevil Send Filexx ++Name[zh_CN]=BlueDevil 发送文件 +Name[zh_TW]=BlueDevil 傳送檔案 - GenericName=BlueDevil Send File ++GenericName=BlueDevil Send File +GenericName[bs]=Bludevilovo slanje datoteke - GenericName[ca]=Envia fitxers amb BlueDevil - GenericName[cs]=Posílání souborů BlueDevil - GenericName[de]=BlueDevil-Dateiversand ++GenericName[ca]=Envia fitxers amb BlueDevil ++GenericName[cs]=Posílání souborů BlueDevil ++GenericName[de]=BlueDevil-Dateiversand +GenericName[el]=Αποστολή αρχείου μέσω BlueDevil - GenericName[en_GB]=BlueDevil Send File - GenericName[es]=Enviar archivo con BlueDevil - GenericName[fi]=BlueDevil-tiedostonlähetys -@@ -46,15 +52,19 @@ GenericName[sr@ijekavian]=Блудевилово слање фајла - GenericName[sr@ijekavianlatin]=BlueDevilovo slanje fajla - GenericName[sr@latin]=BlueDevilovo slanje fajla - GenericName[sv]=Blådjävul skicka fil ++GenericName[en_GB]=BlueDevil Send File ++GenericName[es]=Enviar archivo con BlueDevil ++GenericName[fi]=BlueDevil-tiedostonlähetys ++GenericName[fr]=Envoi de fichiers par BlueDevil ++GenericName[it]=Invio file di BlueDevil ++GenericName[nb]=BlueDevil send fil ++GenericName[nl]=BlueDevil bestand verzenden ++GenericName[pl]=Wysłanie pliku BlueDevil ++GenericName[pt]=Envio de Ficheiro do Bluetooth ++GenericName[pt_BR]=Envio de arquivo do BlueDevil ++GenericName[sk]=Posielanie súborov BlueDevil ++GenericName[sl]=BlueDevil – pošiljanje datotek ++GenericName[sr]=Блудевилово слање фајла ++GenericName[sr@ijekavian]=Блудевилово слање фајла ++GenericName[sr@ijekavianlatin]=BlueDevilovo slanje fajla ++GenericName[sr@latin]=BlueDevilovo slanje fajla ++GenericName[sv]=Blådjävul skicka fil +GenericName[tr]=BlueDevil Dosya Gönder - GenericName[uk]=Надсилання файла BlueDevil - GenericName[x-test]=xxBlueDevil Send Filexx - GenericName[zh_CN]=BlueDevil 发送文件 ++GenericName[uk]=Надсилання файла BlueDevil ++GenericName[x-test]=xxBlueDevil Send Filexx ++GenericName[zh_CN]=BlueDevil 发送文件 +GenericName[zh_TW]=BlueDevil 傳送檔案 - MimeType=application/vnd.kde.bluedevil-sendfile; - Exec=bluedevil-sendfile -k%U - Comment=BlueDevil Send File ++Comment=BlueDevil Send File +Comment[bs]=Bludevilovo slanje datoteke - Comment[ca]=Envia fitxers amb BlueDevil - Comment[cs]=Posílání souborů BlueDevil - Comment[de]=BlueDevil-Dateiversand ++Comment[ca]=Envia fitxers amb BlueDevil ++Comment[cs]=Posílání souborů BlueDevil ++Comment[de]=BlueDevil-Dateiversand +Comment[el]=Αποστολή αρχείου μέσω BlueDevil - Comment[en_GB]=BlueDevil Send File - Comment[es]=Enviar archivo con BlueDevil - Comment[fi]=BlueDevil-tiedostonlähetys -@@ -72,9 +82,11 @@ Comment[sr@ijekavian]=Блудевилово слање фајла - Comment[sr@ijekavianlatin]=BlueDevilovo slanje fajla - Comment[sr@latin]=BlueDevilovo slanje fajla - Comment[sv]=Blådjävul skicka fil ++Comment[en_GB]=BlueDevil Send File ++Comment[es]=Enviar archivo con BlueDevil ++Comment[fi]=BlueDevil-tiedostonlähetys ++Comment[fr]=Envoi de fichiers par BlueDevil ++Comment[it]=Invio file di BlueDevil ++Comment[nb]=BlueDevil send fil ++Comment[nl]=BlueDevil bestand verzenden ++Comment[pl]=Wysłanie pliku BlueDevil ++Comment[pt]=Envio de Ficheiro do Bluetooth ++Comment[pt_BR]=Envio de arquivo do BlueDevil ++Comment[sk]=Posielanie súborov BlueDevil ++Comment[sl]=BlueDevil – pošiljanje datotek ++Comment[sr]=Блудевилово слање фајла ++Comment[sr@ijekavian]=Блудевилово слање фајла ++Comment[sr@ijekavianlatin]=BlueDevilovo slanje fajla ++Comment[sr@latin]=BlueDevilovo slanje fajla ++Comment[sv]=Blådjävul skicka fil +Comment[tr]=BlueDevil Dosya Gönder - Comment[uk]=Надсилання файла BlueDevil - Comment[x-test]=xxBlueDevil Send Filexx - Comment[zh_CN]=BlueDevil 发送文件 ++Comment[uk]=Надсилання файла BlueDevil ++Comment[x-test]=xxBlueDevil Send Filexx ++Comment[zh_CN]=BlueDevil 发送文件 +Comment[zh_TW]=BlueDevil 傳送檔案 - Icon=preferences-system-bluetooth - Terminal=false - Categories=Qt;KDE;X-Bluetooth;Network; ++ ++Type=Application ++MimeType=application/vnd.kde.bluedevil-sendfile; ++Exec=bluedevil-sendfile -k%U ++Icon=preferences-system-bluetooth ++Terminal=false ++NoDisplay=true ++Categories=Qt;KDE;X-Bluetooth;Network; ++X-DBUS-ServiceName=org.kde.bluedevilsendfile +diff --git a/src/sendfile/pages/connecting.ui b/src/sendfile/pages/connecting.ui +index 10d9d7e..fc2bf06 100644 +--- a/src/sendfile/pages/connecting.ui ++++ b/src/sendfile/pages/connecting.ui +@@ -12,11 +12,7 @@ + + + +- +- +- Connecting to: %1 +- +- ++ + + + +diff --git a/src/sendfile/pages/connectingpage.cpp b/src/sendfile/pages/connectingpage.cpp +index 8d18c3d..1c34ed5 100644 +--- a/src/sendfile/pages/connectingpage.cpp ++++ b/src/sendfile/pages/connectingpage.cpp +@@ -29,7 +29,8 @@ + + using namespace BlueDevil; + +-ConnectingPage::ConnectingPage(QWidget* parent): QWizardPage(parent) ++ConnectingPage::ConnectingPage(QWidget *parent) ++ : QWizardPage(parent) + { + setupUi(this); + } +diff --git a/src/sendfile/pages/connectingpage.h b/src/sendfile/pages/connectingpage.h +index 935b394..2834cfa 100644 +--- a/src/sendfile/pages/connectingpage.h ++++ b/src/sendfile/pages/connectingpage.h +@@ -27,15 +27,14 @@ + + #include + +-class ConnectingPage : public QWizardPage, +-public Ui::Connecting ++class ConnectingPage : public QWizardPage, public Ui::Connecting + { +-Q_OBJECT ++ Q_OBJECT + public: +- ConnectingPage(QWidget* parent = 0); ++ explicit ConnectingPage(QWidget *parent = 0); + +- virtual void initializePage(); +- virtual bool isComplete() const; ++ void initializePage() Q_DECL_OVERRIDE; ++ bool isComplete() const Q_DECL_OVERRIDE; + }; + + #endif // CONNECTINGPAGE_H +diff --git a/src/sendfile/pages/selectdeviceandfilespage.cpp b/src/sendfile/pages/selectdeviceandfilespage.cpp +index 0c8d079..b22d907 100644 +--- a/src/sendfile/pages/selectdeviceandfilespage.cpp ++++ b/src/sendfile/pages/selectdeviceandfilespage.cpp +@@ -39,7 +39,10 @@ + #include + + using namespace BlueDevil; +-SelectDeviceAndFilesPage::SelectDeviceAndFilesPage(QWidget* parent): QWizardPage(parent), m_dialog(0) ++ ++SelectDeviceAndFilesPage::SelectDeviceAndFilesPage(QWidget *parent) ++ : QWizardPage(parent) ++ , m_dialog(0) + { + setupUi(this); + +@@ -56,24 +59,22 @@ SelectDeviceAndFilesPage::SelectDeviceAndFilesPage(QWidget* parent): QWizardPage + selectBtn->setFixedSize(buttonSize, buttonSize); + selectBtn->setIcon(QIcon::fromTheme(QStringLiteral("document-open"))); + +- connect(widget, SIGNAL(deviceSelected(Device*)), this, SLOT(deviceSelected(Device*))); +- connect(selectBtn, SIGNAL(clicked(bool)), this, SLOT(openFileDialog())); ++ connect(widget, &DiscoverWidget::deviceSelected, this, &SelectDeviceAndFilesPage::deviceSelected); ++ connect(selectBtn, &QPushButton::clicked, this, &SelectDeviceAndFilesPage::openFileDialog); + } + +- +-void SelectDeviceAndFilesPage::deviceSelected(Device* device) ++void SelectDeviceAndFilesPage::deviceSelected(Device *device) + { + if (!device->name().isEmpty()) { +- static_cast(wizard())->setDevice(device); ++ static_cast(wizard())->setDevice(device); + } else { +- static_cast(wizard())->setDevice(0); ++ static_cast(wizard())->setDevice(0); + } + emit completeChanged(); + } + + void SelectDeviceAndFilesPage::openFileDialog() + { +- //Don't worry MLaurent, I'm not going to check the pointer before delete it :) + delete m_dialog; + + m_dialog = new QFileDialog(this, i18n("Open file..."), +@@ -99,7 +100,7 @@ void SelectDeviceAndFilesPage::selectionChanged() + + bool SelectDeviceAndFilesPage::isComplete() const + { +- if (!static_cast(wizard())->device()) { ++ if (!static_cast(wizard())->device()) { + return false; + } + +diff --git a/src/sendfile/pages/selectdeviceandfilespage.h b/src/sendfile/pages/selectdeviceandfilespage.h +index 19a718b..f5b50fc 100644 +--- a/src/sendfile/pages/selectdeviceandfilespage.h ++++ b/src/sendfile/pages/selectdeviceandfilespage.h +@@ -31,22 +31,22 @@ class KUrl; + class QWizard; + class QFileDialog; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + } +-using namespace BlueDevil; + +-class SelectDeviceAndFilesPage : public QWizardPage , +- public Ui::SelectFileDiscover ++class SelectDeviceAndFilesPage : public QWizardPage, public Ui::SelectFileDiscover + { +-Q_OBJECT ++ Q_OBJECT ++ + public: +- SelectDeviceAndFilesPage(QWidget* parent = 0); ++ explicit SelectDeviceAndFilesPage(QWidget *parent = 0); + +- virtual bool isComplete() const; ++ bool isComplete() const Q_DECL_OVERRIDE; + + private Q_SLOTS: +- void deviceSelected(Device*); ++ void deviceSelected(BlueDevil::Device *device); + void openFileDialog(); + void selectionChanged(); + +diff --git a/src/sendfile/pages/selectdevicepage.cpp b/src/sendfile/pages/selectdevicepage.cpp +index 01423dd..69a2c84 100644 +--- a/src/sendfile/pages/selectdevicepage.cpp ++++ b/src/sendfile/pages/selectdevicepage.cpp +@@ -36,7 +36,10 @@ + #include + + using namespace BlueDevil; +-SelectDevicePage::SelectDevicePage(QWidget* parent): QWizardPage(parent), m_dialog(0) ++ ++SelectDevicePage::SelectDevicePage(QWidget *parent) : ++ QWizardPage(parent), ++ m_dialog(0) + { + setupUi(this); + +@@ -51,22 +54,22 @@ SelectDevicePage::SelectDevicePage(QWidget* parent): QWizardPage(parent), m_dial + + selectBtn->setHidden(true); + selectLbl->setHidden(true); +- connect(widget, SIGNAL(deviceSelected(Device*)), this, SLOT(deviceSelected(Device*))); ++ connect(widget, &DiscoverWidget::deviceSelected, this, &SelectDevicePage::deviceSelected); + } + +-void SelectDevicePage::deviceSelected(Device* device) ++void SelectDevicePage::deviceSelected(Device *device) + { + if (!device->name().isEmpty()) { +- static_cast(wizard())->setDevice(device); ++ static_cast(wizard())->setDevice(device); + } else { +- static_cast(wizard())->setDevice(0); ++ static_cast(wizard())->setDevice(0); + } + emit completeChanged(); + } + + bool SelectDevicePage::isComplete() const + { +- if (!static_cast(wizard())->device()) { ++ if (!static_cast(wizard())->device()) { + return false; + } + +diff --git a/src/sendfile/pages/selectdevicepage.h b/src/sendfile/pages/selectdevicepage.h +index 8c4b494..18d2cc7 100644 +--- a/src/sendfile/pages/selectdevicepage.h ++++ b/src/sendfile/pages/selectdevicepage.h +@@ -30,22 +30,23 @@ + class KUrl; + class QWizard; + class KFileDialog; +-namespace BlueDevil { ++ ++namespace BlueDevil ++{ + class Device; + } +-using namespace BlueDevil; + +-class SelectDevicePage : public QWizardPage , +- public Ui::SelectFileDiscover ++class SelectDevicePage : public QWizardPage, public Ui::SelectFileDiscover + { +-Q_OBJECT ++ Q_OBJECT ++ + public: +- SelectDevicePage(QWidget* parent = 0); ++ explicit SelectDevicePage(QWidget *parent = 0); + +- virtual bool isComplete() const; ++ bool isComplete() const Q_DECL_OVERRIDE; + + private Q_SLOTS: +- void deviceSelected(Device*); ++ void deviceSelected(BlueDevil::Device *device); + + private: + KFileDialog *m_dialog; +diff --git a/src/sendfile/pages/selectfilespage.cpp b/src/sendfile/pages/selectfilespage.cpp +index 7362eef..56ba9af 100644 +--- a/src/sendfile/pages/selectfilespage.cpp ++++ b/src/sendfile/pages/selectfilespage.cpp +@@ -31,14 +31,15 @@ + #include + #include + +-SelectFilesPage::SelectFilesPage(QWidget* parent): QWizardPage(parent) ++SelectFilesPage::SelectFilesPage(QWidget *parent) ++ : QWizardPage(parent) + { + m_files = new KFileWidget(QUrl(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)), this); + m_files->setMode(KFile::Files); + m_files->setContentsMargins(0, 0, 0, 0); + setContentsMargins(0, 0, 0, 0); + +- connect(m_files, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); ++ connect(m_files, &KFileWidget::selectionChanged, this, &SelectFilesPage::selectionChanged); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->addWidget(m_files); +@@ -48,10 +49,12 @@ void SelectFilesPage::selectionChanged() + { + QStringList fileList; + KFileItemList itemList = m_files->dirOperator()->selectedItems(); +- Q_FOREACH(const KFileItem &file, itemList) { ++ ++ Q_FOREACH (const KFileItem &file, itemList) { + fileList << file.localPath(); + } +- static_cast(wizard())->setFiles(fileList); ++ ++ static_cast(wizard())->setFiles(fileList); + emit completeChanged(); + } + +diff --git a/src/sendfile/pages/selectfilespage.h b/src/sendfile/pages/selectfilespage.h +index a802270..623a216 100644 +--- a/src/sendfile/pages/selectfilespage.h ++++ b/src/sendfile/pages/selectfilespage.h +@@ -30,11 +30,12 @@ class KFileWidget; + + class SelectFilesPage : public QWizardPage + { +-Q_OBJECT ++ Q_OBJECT ++ + public: +- SelectFilesPage(QWidget* parent = 0); ++ explicit SelectFilesPage(QWidget *parent = 0); + +- virtual bool isComplete() const; ++ bool isComplete() const Q_DECL_OVERRIDE; + + private Q_SLOTS: + void selectionChanged(); +diff --git a/src/sendfile/sendfilesjob.cpp b/src/sendfile/sendfilesjob.cpp +index 554616b..c943ef0 100644 +--- a/src/sendfile/sendfilesjob.cpp ++++ b/src/sendfile/sendfilesjob.cpp +@@ -31,7 +31,8 @@ + #include + + using namespace BlueDevil; +-SendFilesJob::SendFilesJob(const QStringList& files, Device* device, QObject* parent) ++ ++SendFilesJob::SendFilesJob(const QStringList &files, Device *device, QObject *parent) + : KJob(parent) + , m_progress(0) + , m_totalSize(0) +@@ -41,6 +42,7 @@ SendFilesJob::SendFilesJob(const QStringList& files, Device* device, QObject* pa + , m_currentFileProgress(0) + { + qCDebug(SENDFILE) << files; ++ + m_filesToSend = files; + + Q_FOREACH(const QString &filePath, files) { +@@ -64,14 +66,15 @@ void SendFilesJob::start() + + void SendFilesJob::doStart() + { +- qCDebug(SENDFILE); + QVariantMap map; +- map["Target"] = "opp"; ++ map[QStringLiteral("Target")] = QStringLiteral("opp"); + + setTotalAmount(Bytes, m_totalSize); + setProcessedAmount(Bytes, 0); + +- emit description(this, i18n("Sending file over Bluetooth"), QPair(i18nc("File transfer origin", "From"), m_filesToSend.first()), QPair(i18nc("File transfer destination", "To"), m_device->name())); ++ emit description(this, i18n("Sending file over Bluetooth"), ++ QPair(i18nc("File transfer origin", "From"), m_filesToSend.first()), ++ QPair(i18nc("File transfer destination", "To"), m_device->name())); + + m_client = new OrgBluezObexClient1Interface(QStringLiteral("org.bluez.obex"), + QStringLiteral("/org/bluez/obex"), +@@ -80,7 +83,7 @@ void SendFilesJob::doStart() + + QDBusPendingReply reply = m_client->CreateSession(m_device->address(), map); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply); +- connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(createSessionSlot(QDBusPendingCallWatcher*))); ++ connect(watcher, &QDBusPendingCallWatcher::finished, this, &SendFilesJob::createSessionSlot); + } + + void SendFilesJob::createSessionSlot(QDBusPendingCallWatcher *call) +@@ -102,14 +105,14 @@ void SendFilesJob::createSessionSlot(QDBusPendingCallWatcher *call) + nextJob(); + } + +-void SendFilesJob::sendFileSlot(QDBusPendingCallWatcher* watcher) ++void SendFilesJob::sendFileSlot(QDBusPendingCallWatcher *watcher) + { + const QDBusPendingReply reply = *watcher; + watcher->deleteLater(); + QString path = reply.value().path(); + + m_props = new OrgFreedesktopDBusPropertiesInterface(QStringLiteral("org.bluez.obex"), path, QDBusConnection::sessionBus(), this); +- connect(m_props, SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)), SLOT(propertiesChangedSlot(QString,QVariantMap,QStringList))); ++ connect(m_props, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, this, &SendFilesJob::propertiesChangedSlot); + } + + void SendFilesJob::propertiesChangedSlot(const QString& interface, const QVariantMap& props, const QStringList& invalidProps) +@@ -131,7 +134,8 @@ void SendFilesJob::propertiesChangedSlot(const QString& interface, const QVarian + void SendFilesJob::statusChanged(const QVariant& value) + { + qCDebug(SENDFILE) << value; +- QString status = value.toString(); ++ ++ const QString &status = value.toString(); + + if (status == QLatin1String("active")) { + m_time = QTime::currentTime(); +@@ -151,6 +155,7 @@ void SendFilesJob::statusChanged(const QVariant& value) + void SendFilesJob::transferChanged(const QVariant& value) + { + qCDebug(SENDFILE) << value; ++ + bool ok = false; + qulonglong bytes = value.toULongLong(&ok); + if (!ok) { +@@ -158,7 +163,7 @@ void SendFilesJob::transferChanged(const QVariant& value) + return; + } + +- //If a least 1 second has passed since last update ++ // If a least 1 second has passed since last update + int secondsSinceLastTime = m_time.secsTo(QTime::currentTime()); + if (secondsSinceLastTime > 0) { + float speed = (bytes - m_speedBytes) / secondsSinceLastTime; +@@ -177,17 +182,18 @@ void SendFilesJob::nextJob() + m_currentFile = m_filesToSend.takeFirst(); + m_currentFileSize = m_filesToSendSize.takeFirst(); + +- emit description(this, i18n("Sending file over Bluetooth"), QPair(i18nc("File transfer origin", "From"), m_currentFile), QPair(i18nc("File transfer destination", "To"), m_device->name())); ++ emit description(this, i18n("Sending file over Bluetooth"), ++ QPair(i18nc("File transfer origin", "From"), m_currentFile), ++ QPair(i18nc("File transfer destination", "To"), m_device->name())); + + QDBusPendingReply fileReply = m_push->SendFile(m_currentFile); + + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(fileReply); +- connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(sendFileSlot(QDBusPendingCallWatcher*))); ++ connect(watcher, &QDBusPendingCallWatcher::finished, this, &SendFilesJob::sendFileSlot); + } + + void SendFilesJob::jobDone() + { +- qCDebug(SENDFILE); + m_speedBytes = 0; + m_currentFileSize = 0; + m_currentFileProgress = 0; +@@ -202,8 +208,6 @@ void SendFilesJob::jobDone() + + void SendFilesJob::progress(quint64 transferBytes) + { +- qCDebug(SENDFILE); +- + quint64 toAdd = transferBytes - m_currentFileProgress; + m_currentFileProgress = transferBytes; + m_progress += toAdd; +@@ -213,9 +217,10 @@ void SendFilesJob::progress(quint64 transferBytes) + void SendFilesJob::error(const QDBusObjectPath& transfer, const QString& error) + { + Q_UNUSED(transfer) ++ + qCDebug(SENDFILE) << error; + +- //if this is the last file, just emit error ++ // If this is the last file, just emit error + if (m_filesToSend.isEmpty()) { + setError(KJob::UserDefinedError); + return; +@@ -225,5 +230,4 @@ void SendFilesJob::error(const QDBusObjectPath& transfer, const QString& error) + m_progress += toAdd; + setProcessedAmount(Bytes, m_progress); + nextJob(); +- + } +diff --git a/src/sendfile/sendfilesjob.h b/src/sendfile/sendfilesjob.h +index 28e8ac2..68580c0 100644 +--- a/src/sendfile/sendfilesjob.h ++++ b/src/sendfile/sendfilesjob.h +@@ -40,15 +40,14 @@ class OrgBluezObexClient1Interface; + class OrgBluezObexObjectPush1Interface; + class OrgFreedesktopDBusPropertiesInterface; + +-using namespace BlueDevil; + class SendFilesJob : public KJob + { +-Q_OBJECT ++ Q_OBJECT + public: +- SendFilesJob(const QStringList &files, BlueDevil::Device* device, QObject* parent = 0); ++ explicit SendFilesJob(const QStringList &files, BlueDevil::Device *device, QObject *parent = 0); + +- virtual void start(); +- virtual bool doKill(); ++ void start() Q_DECL_OVERRIDE; ++ bool doKill() Q_DECL_OVERRIDE; + + private Q_SLOTS: + void doStart(); +@@ -56,26 +55,25 @@ private Q_SLOTS: + void nextJob(); + void jobDone(); + void progress(quint64 transferBytes); +- void error(const QDBusObjectPath& transfer, const QString& error); +- void propertiesChangedSlot(const QString& interface, const QVariantMap &props, const QStringList &invalidProps); +- void sendFileSlot(QDBusPendingCallWatcher* watcher); ++ void error(const QDBusObjectPath &transfer, const QString &error); ++ void propertiesChangedSlot(const QString &interface, const QVariantMap &props, const QStringList &invalidProps); ++ void sendFileSlot(QDBusPendingCallWatcher *watcher); + + private: + void transferChanged(const QVariant &value); + void statusChanged(const QVariant &value); + + QTime m_time; +- QStringList m_filesToSend; ++ QStringList m_filesToSend; + QList m_filesToSendSize; +- QString m_currentFile; ++ QString m_currentFile; + QDBusObjectPath m_currentFileDBusPath; +- quint64 m_progress; +- quint64 m_totalSize; ++ quint64 m_progress; ++ quint64 m_totalSize; + qulonglong m_speedBytes; +- Device *m_device; +- quint64 m_currentFileSize; +- quint64 m_currentFileProgress; +- ++ BlueDevil::Device *m_device; ++ quint64 m_currentFileSize; ++ quint64 m_currentFileProgress; + + OrgBluezObexClient1Interface *m_client; + OrgBluezObexObjectPush1Interface *m_push; +diff --git a/src/sendfile/sendfilewizard.cpp b/src/sendfile/sendfilewizard.cpp +index 6557989..71b01ea 100644 +--- a/src/sendfile/sendfilewizard.cpp ++++ b/src/sendfile/sendfilewizard.cpp +@@ -41,7 +41,7 @@ + + using namespace BlueDevil; + +-SendFileWizard::SendFileWizard(const QString& deviceInfo, const QStringList& files) ++SendFileWizard::SendFileWizard(const QString &deviceInfo, const QStringList &files) + : QWizard() + , m_device(0) + , m_job(0) +@@ -52,7 +52,7 @@ SendFileWizard::SendFileWizard(const QString& deviceInfo, const QStringList& fil + return; + } + +- qCDebug(SENDFILE) << "DeviceUbi: " << deviceInfo; ++ qCDebug(SENDFILE) << "DeviceUbi:" << deviceInfo; + qCDebug(SENDFILE) << "Files"; + qCDebug(SENDFILE) << files; + +@@ -106,13 +106,13 @@ void SendFileWizard::done(int result) + } + } + +-void SendFileWizard::setFiles(const QStringList& files) ++void SendFileWizard::setFiles(const QStringList &files) + { + qCDebug(SENDFILE) << files; + m_files = files; + } + +-void SendFileWizard::setDevice(Device* device) ++void SendFileWizard::setDevice(Device *device) + { + qCDebug(SENDFILE) << device; + m_device = device; +@@ -136,7 +136,7 @@ void SendFileWizard::setDevice(QString deviceUrl) + m_device = device; + } + +-Device* SendFileWizard::device() ++Device *SendFileWizard::device() + { + return m_device; + } +@@ -157,11 +157,10 @@ void SendFileWizard::startTransfer() + } + + m_job = new SendFilesJob(m_files, m_device); +- connect(m_job, SIGNAL(destroyed(QObject*)), qApp, SLOT(quit())); ++ connect(m_job, &SendFilesJob::destroyed, qApp, &QCoreApplication::quit); + + KIO::getJobTracker()->registerJob(m_job); + m_job->start(); + +- QTimer::singleShot(2000, this, SLOT(wizardDone())); ++ QTimer::singleShot(2000, this, &SendFileWizard::wizardDone); + } +- +diff --git a/src/sendfile/sendfilewizard.h b/src/sendfile/sendfilewizard.h +index 9b425e2..1dae831 100644 +--- a/src/sendfile/sendfilewizard.h ++++ b/src/sendfile/sendfilewizard.h +@@ -31,26 +31,27 @@ + class WizardAgent; + class QStringList; + class SendFilesJob; +-namespace BlueDevil { ++ ++namespace BlueDevil ++{ + class Device; + } +-using namespace BlueDevil; + + class SendFileWizard : public QWizard + { +-Q_OBJECT ++ Q_OBJECT + + public: +- SendFileWizard(const QString &deviceUBI, const QStringList &files); +- virtual ~SendFileWizard(); ++ explicit SendFileWizard(const QString &deviceUBI, const QStringList &files); ++ ~SendFileWizard(); + +- virtual void done(int result); ++ void done(int result) Q_DECL_OVERRIDE; + + void setFiles(const QStringList &files); + +- void setDevice(Device *device); ++ void setDevice(BlueDevil::Device *device); + void setDevice(QString deviceUrl); +- Device* device(); ++ BlueDevil::Device *device(); + + void startTransfer(); + +@@ -58,9 +59,8 @@ private Q_SLOTS: + void wizardDone(); + + private: +- QStringList m_files; +- +- Device *m_device; ++ QStringList m_files; ++ BlueDevil::Device *m_device; + SendFilesJob *m_job; + }; + diff --git a/src/settings/filereceiver.kcfg b/src/settings/filereceiver.kcfg index 5740f9a..a2e6521 100644 --- a/src/settings/filereceiver.kcfg @@ -3403,7 +5803,7 @@ index 5740f9a..a2e6521 100644 diff --git a/src/wizard/CMakeLists.txt b/src/wizard/CMakeLists.txt -index d615f3d..491612e 100644 +index d615f3d..e096ad1 100644 --- a/src/wizard/CMakeLists.txt +++ b/src/wizard/CMakeLists.txt @@ -11,6 +11,7 @@ set(wizard_SRCS @@ -3422,115 +5822,101 @@ index d615f3d..491612e 100644 ) add_executable(bluedevil-wizard ${wizard_SRCS}) +@@ -35,5 +37,5 @@ target_link_libraries(bluedevil-wizard + ${LibBlueDevil_LIBRARIES}) + + install(TARGETS bluedevil-wizard ${INSTALL_TARGETS_DEFAULT_ARGS}) +-install(FILES bluedevil-wizard.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) ++install(FILES org.kde.bluedevilwizard.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) + install(FILES pin-code-database.xml DESTINATION ${DATA_INSTALL_DIR}/bluedevilwizard) diff --git a/src/wizard/bluedevil-wizard.desktop b/src/wizard/bluedevil-wizard.desktop -index c349f89..0779901 100644 +deleted file mode 100644 +index c349f89..0000000 --- a/src/wizard/bluedevil-wizard.desktop -+++ b/src/wizard/bluedevil-wizard.desktop -@@ -2,16 +2,25 @@ - Type=Application - Version=1.0 - Name=BlueDevil Wizard -+Name[bs]=Bludevilov čarobnjak - Name[ca]=Assistent del BlueDevil - Name[cs]=Průvodce Bluedevil - Name[de]=BlueDevil-Assistent -+Name[el]=Οδηγός BlueDevil - Name[en_GB]=BlueDevil Wizard - Name[es]=Asistente de BlueDevil - Name[fi]=Opastettu BlueDevil-toiminto - Name[fr]=Assistant pour BlueDevil - Name[it]=Procedura guidata di BlueDevil -+Name[ja]=BlueDevil ウィザード -+Name[kk]=BlueDevil шебері -+Name[km]=អ្នក​ជំនួយការ BlueDevil -+Name[ko]=BlueDevil 마법사 -+Name[lt]=BlueDevil vedlys -+Name[mr]=ब्लु-डेव्हिल विझार्ड - Name[nb]=BlueDevil veiviser - Name[nl]=BlueDevil assistent -+Name[pa]=BlueDevil ਸਹਾਇਕ - Name[pl]=Pomocnik BlueDevil - Name[pt]=Assistente BlueDevil - Name[pt_BR]=Assistente BlueDevil -@@ -22,20 +31,31 @@ Name[sr@ijekavian]=Блудевилов чаробњак - Name[sr@ijekavianlatin]=BlueDevilov čarobnjak - Name[sr@latin]=BlueDevilov čarobnjak - Name[sv]=Blådjävul guide -+Name[tr]=BlueDevil Sihirbazı - Name[uk]=Майстер BlueDevil - Name[x-test]=xxBlueDevil Wizardxx - Name[zh_CN]=BlueDevil 向导 -+Name[zh_TW]=BlueDevil 精靈 - GenericName=BlueDevil Wizard -+GenericName[bs]=Bludevilov čarobnjak - GenericName[ca]=Assistent del BlueDevil - GenericName[cs]=Průvodce Bluedevil - GenericName[de]=BlueDevil-Assistent -+GenericName[el]=Οδηγός BlueDevil - GenericName[en_GB]=BlueDevil Wizard - GenericName[es]=Asistente de BlueDevil - GenericName[fi]=Opastettu BlueDevil-toiminto - GenericName[fr]=Assistant pour BlueDevil - GenericName[it]=Procedura guidata di BlueDevil -+GenericName[ja]=BlueDevil ウィザード -+GenericName[kk]=BlueDevil шебері -+GenericName[km]=អ្នកជំនួយការ​ BlueDevil -+GenericName[ko]=BlueDevil 마법사 -+GenericName[lt]=BlueDevil vedlys -+GenericName[mr]=ब्लु-डेव्हिल विझार्ड - GenericName[nb]=BlueDevil veiviser - GenericName[nl]=BlueDevil assistent -+GenericName[pa]=BlueDevil ਸਹਾਇਕ - GenericName[pl]=Pomocnik BlueDevil - GenericName[pt]=Assistente BlueDevil - GenericName[pt_BR]=Assistente BlueDevil -@@ -46,21 +66,32 @@ GenericName[sr@ijekavian]=Блудевилов чаробњак - GenericName[sr@ijekavianlatin]=BlueDevilov čarobnjak - GenericName[sr@latin]=BlueDevilov čarobnjak - GenericName[sv]=Blådjävul guide -+GenericName[tr]=BlueDevil Sihirbazı - GenericName[uk]=Майстер BlueDevil - GenericName[x-test]=xxBlueDevil Wizardxx - GenericName[zh_CN]=BlueDevil 向导 -+GenericName[zh_TW]=BlueDevil 精靈 - Exec=bluedevil-wizard %U - Comment=BlueDevil Wizard -+Comment[bs]=Bludevilov čarobnjak - Comment[ca]=Assistent del BlueDevil - Comment[cs]=BlueDevil - Comment[de]=BlueDevil-Assistent -+Comment[el]=Οδηγός BlueDevil - Comment[en_GB]=BlueDevil Wizard - Comment[es]=Asistente de BlueDevil - Comment[fi]=Opastettu BlueDevil-toiminto - Comment[fr]=Assistant pour BlueDevil - Comment[it]=Procedura guidata di BlueDevil -+Comment[ja]=BlueDevil ウィザード -+Comment[kk]=BlueDevil шебері -+Comment[km]=អ្នក​ជំនួយការ​ BlueDevil -+Comment[ko]=BlueDevil 마법사 -+Comment[lt]=BlueDevil vedlys -+Comment[mr]=ब्लु-डेव्हिल विझार्ड - Comment[nb]=BlueDevil veiviser - Comment[nl]=BlueDevil assistent -+Comment[pa]=BlueDevil ਸਹਾਇਕ - Comment[pl]=Pomocnik BlueDevil - Comment[pt]=Assistente BlueDevil - Comment[pt_BR]=Assistente BlueDevil -@@ -71,9 +102,11 @@ Comment[sr@ijekavian]=Блудевилов чаробњак - Comment[sr@ijekavianlatin]=BlueDevilov čarobnjak - Comment[sr@latin]=BlueDevilov čarobnjak - Comment[sv]=Blådjävul guide -+Comment[tr]=BlueDevil Sihirbazı - Comment[uk]=Майстер BlueDevil - Comment[x-test]=xxBlueDevil Wizardxx - Comment[zh_CN]=BlueDevil 向导 -+Comment[zh_TW]=BlueDevil 精靈 - Icon=preferences-system-bluetooth - Terminal=false - Categories=Qt;KDE;X-Bluetooth;Network; ++++ /dev/null +@@ -1,80 +0,0 @@ +-[Desktop Entry] +-Type=Application +-Version=1.0 +-Name=BlueDevil Wizard +-Name[ca]=Assistent del BlueDevil +-Name[cs]=Průvodce Bluedevil +-Name[de]=BlueDevil-Assistent +-Name[en_GB]=BlueDevil Wizard +-Name[es]=Asistente de BlueDevil +-Name[fi]=Opastettu BlueDevil-toiminto +-Name[fr]=Assistant pour BlueDevil +-Name[it]=Procedura guidata di BlueDevil +-Name[nb]=BlueDevil veiviser +-Name[nl]=BlueDevil assistent +-Name[pl]=Pomocnik BlueDevil +-Name[pt]=Assistente BlueDevil +-Name[pt_BR]=Assistente BlueDevil +-Name[sk]=Sprievodca BlueDevil +-Name[sl]=BlueDevil – čarovnik +-Name[sr]=Блудевилов чаробњак +-Name[sr@ijekavian]=Блудевилов чаробњак +-Name[sr@ijekavianlatin]=BlueDevilov čarobnjak +-Name[sr@latin]=BlueDevilov čarobnjak +-Name[sv]=Blådjävul guide +-Name[uk]=Майстер BlueDevil +-Name[x-test]=xxBlueDevil Wizardxx +-Name[zh_CN]=BlueDevil 向导 +-GenericName=BlueDevil Wizard +-GenericName[ca]=Assistent del BlueDevil +-GenericName[cs]=Průvodce Bluedevil +-GenericName[de]=BlueDevil-Assistent +-GenericName[en_GB]=BlueDevil Wizard +-GenericName[es]=Asistente de BlueDevil +-GenericName[fi]=Opastettu BlueDevil-toiminto +-GenericName[fr]=Assistant pour BlueDevil +-GenericName[it]=Procedura guidata di BlueDevil +-GenericName[nb]=BlueDevil veiviser +-GenericName[nl]=BlueDevil assistent +-GenericName[pl]=Pomocnik BlueDevil +-GenericName[pt]=Assistente BlueDevil +-GenericName[pt_BR]=Assistente BlueDevil +-GenericName[sk]=Sprievodca BlueDevil +-GenericName[sl]=BlueDevil – čarovnik +-GenericName[sr]=Блудевилов чаробњак +-GenericName[sr@ijekavian]=Блудевилов чаробњак +-GenericName[sr@ijekavianlatin]=BlueDevilov čarobnjak +-GenericName[sr@latin]=BlueDevilov čarobnjak +-GenericName[sv]=Blådjävul guide +-GenericName[uk]=Майстер BlueDevil +-GenericName[x-test]=xxBlueDevil Wizardxx +-GenericName[zh_CN]=BlueDevil 向导 +-Exec=bluedevil-wizard %U +-Comment=BlueDevil Wizard +-Comment[ca]=Assistent del BlueDevil +-Comment[cs]=BlueDevil +-Comment[de]=BlueDevil-Assistent +-Comment[en_GB]=BlueDevil Wizard +-Comment[es]=Asistente de BlueDevil +-Comment[fi]=Opastettu BlueDevil-toiminto +-Comment[fr]=Assistant pour BlueDevil +-Comment[it]=Procedura guidata di BlueDevil +-Comment[nb]=BlueDevil veiviser +-Comment[nl]=BlueDevil assistent +-Comment[pl]=Pomocnik BlueDevil +-Comment[pt]=Assistente BlueDevil +-Comment[pt_BR]=Assistente BlueDevil +-Comment[sk]=Sprievodca BlueDevil +-Comment[sl]=BlueDevil – čarovnik +-Comment[sr]=Блудевилов чаробњак +-Comment[sr@ijekavian]=Блудевилов чаробњак +-Comment[sr@ijekavianlatin]=BlueDevilov čarobnjak +-Comment[sr@latin]=BlueDevilov čarobnjak +-Comment[sv]=Blådjävul guide +-Comment[uk]=Майстер BlueDevil +-Comment[x-test]=xxBlueDevil Wizardxx +-Comment[zh_CN]=BlueDevil 向导 +-Icon=preferences-system-bluetooth +-Terminal=false +-Categories=Qt;KDE;X-Bluetooth;Network; +-NoDisplay=true diff --git a/src/wizard/bluewizard.cpp b/src/wizard/bluewizard.cpp -index 02f54b7..cd1fe3d 100644 +index 02f54b7..2f1e62a 100644 --- a/src/wizard/bluewizard.cpp +++ b/src/wizard/bluewizard.cpp @@ -23,6 +23,7 @@ @@ -3541,6 +5927,20 @@ index 02f54b7..cd1fe3d 100644 #include "pages/fail.h" #include "debug_p.h" +@@ -47,11 +48,11 @@ BlueWizard::BlueWizard(const QUrl &url) + setOption(QWizard::IndependentPages, true); + + if (url.host().length() == 17) { +- setPreselectedAddress(url.host().replace(QLatin1Char('-'), QLatin1Char(':')).toLatin1()); ++ setPreselectedAddress(url.host().replace(QLatin1Char('-'), QLatin1Char(':'))); + } + + if (url.fileName().length() == 36) { +- setPreselectedUuid(url.fileName().toLatin1()); ++ setPreselectedUuid(url.fileName()); + } + + setPage(Discover, new DiscoverPage(this)); @@ -61,6 +62,7 @@ BlueWizard::BlueWizard(const QUrl &url) setPage(LegacyPairingDatabase, new LegacyPairingPageDatabase(this)); setPage(KeyboardPairing, new KeyboardPairingPage(this)); @@ -3549,19 +5949,341 @@ index 02f54b7..cd1fe3d 100644 setPage(Fail, new FailPage(this)); QPushButton *backButton = new QPushButton(this); +@@ -94,10 +96,6 @@ BlueWizard::BlueWizard(const QUrl &url) + m_agent = new WizardAgent(qApp); + } + +-BlueWizard::~BlueWizard() +-{ +-} +- + void BlueWizard::done(int result) + { + qCDebug(WIZARD) << "Wizard done: " << result; +@@ -111,9 +109,10 @@ Device* BlueWizard::device() const + return m_device; + } + +-void BlueWizard::setDeviceAddress(const QByteArray& address) ++void BlueWizard::setDeviceAddress(const QString &address) + { + qCDebug(WIZARD) << "Device Address: " << address; ++ + if (!Manager::self()->usableAdapter()) { + qCDebug(WIZARD) << "No usable adapter available"; + return; +@@ -123,7 +122,7 @@ void BlueWizard::setDeviceAddress(const QByteArray& address) + m_device = Manager::self()->usableAdapter()->deviceForAddress(m_deviceAddress); + } + +-QByteArray BlueWizard::deviceAddress() const ++QString BlueWizard::deviceAddress() const + { + return m_deviceAddress; + } +@@ -137,45 +136,43 @@ void BlueWizard::restartWizard() + qApp->quit(); + } + +-void BlueWizard::setPin(const QByteArray& pinNum) ++void BlueWizard::setPin(const QString &pin) + { +- qCDebug(WIZARD) << "Setting pin: :" << pinNum; +- m_pin = pinNum; +-} ++ qCDebug(WIZARD) << "Setting pin:" << pin; + +-void BlueWizard::setPin(const QString& pin) +-{ +- setPin(pin.toUtf8()); ++ m_pin = pin; + } + +-QByteArray BlueWizard::pin() const ++QString BlueWizard::pin() const + { + return m_pin; + } + +-void BlueWizard::setPreselectedUuid(const QByteArray& uuid) ++void BlueWizard::setPreselectedUuid(const QString &uuid) + { + qCDebug(WIZARD) << "Preselect UUID: " << uuid; ++ + m_preselectedUuid = uuid; + } + +-QByteArray BlueWizard::preselectedUuid() const ++QString BlueWizard::preselectedUuid() const + { + return m_preselectedUuid; + } + +-void BlueWizard::setPreselectedAddress(const QByteArray& address) ++void BlueWizard::setPreselectedAddress(const QString &address) + { + qCDebug(WIZARD) << "Preselected Address: " << address; ++ + m_preselectedAddress = address; + } + +-QByteArray BlueWizard::preselectedAddress() const ++QString BlueWizard::preselectedAddress() const + { + return m_preselectedAddress; + } + +-WizardAgent* BlueWizard::agent() const ++WizardAgent *BlueWizard::agent() const + { + return m_agent; + } diff --git a/src/wizard/bluewizard.h b/src/wizard/bluewizard.h -index ce817d1..d995fb8 100644 +index ce817d1..e930916 100644 --- a/src/wizard/bluewizard.h +++ b/src/wizard/bluewizard.h -@@ -51,7 +51,7 @@ public: +@@ -15,57 +15,66 @@ + along with this program. If not, see . + */ - WizardAgent* agent() const; +- + #ifndef BLUEWIZARD_H + #define BLUEWIZARD_H + + #include + #include + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + } + + class WizardAgent; ++ + class BlueWizard : public QWizard + { +-Q_OBJECT ++ Q_OBJECT + + public: +- BlueWizard(const QUrl& url); +- virtual ~BlueWizard(); ++ explicit BlueWizard(const QUrl &url); + +- QByteArray deviceAddress() const; +- void setDeviceAddress(const QByteArray& address); ++ QString deviceAddress() const; ++ void setDeviceAddress(const QString &address); + + BlueDevil::Device *device() const; + +- QByteArray pin() const; +- void setPin(const QByteArray& pin); ++ QString pin() const; ++ void setPin(const QString &pin); + +- QByteArray preselectedUuid() const; +- void setPreselectedUuid(const QByteArray &uuid); ++ QString preselectedUuid() const; ++ void setPreselectedUuid(const QString &uuid); + +- QByteArray preselectedAddress() const; +- void setPreselectedAddress(const QByteArray &uuid); ++ QString preselectedAddress() const; ++ void setPreselectedAddress(const QString &uuid); + +- WizardAgent* agent() const; ++ WizardAgent *agent() const; - enum {Discover, NoPairing, LegacyPairing, LegacyPairingDatabase, KeyboardPairing, SSPPairing, Fail, Connect}; -+ enum {Discover, NoPairing, LegacyPairing, LegacyPairingDatabase, KeyboardPairing, SSPPairing, Success, Fail, Connect}; ++ enum { ++ Discover, ++ NoPairing, ++ LegacyPairing, ++ LegacyPairingDatabase, ++ KeyboardPairing, ++ SSPPairing, ++ Success, ++ Fail, ++ Connect ++ }; public Q_SLOTS: void restartWizard(); +- void setPin(const QString& pin); +- virtual void done(int result); ++ void done(int result) Q_DECL_OVERRIDE; + + private: +- QByteArray m_deviceAddress; +- BlueDevil::Device * m_device; +- QByteArray m_pin; +- QByteArray m_preselectedUuid; +- QByteArray m_preselectedAddress; ++ BlueDevil::Device *m_device; + WizardAgent *m_agent; + ++ QString m_pin; ++ QString m_deviceAddress; ++ QString m_preselectedUuid; ++ QString m_preselectedAddress; + bool m_manualPin; + }; + +diff --git a/src/wizard/main.cpp b/src/wizard/main.cpp +index ee9edf8..80e260b 100644 +--- a/src/wizard/main.cpp ++++ b/src/wizard/main.cpp +@@ -28,6 +28,7 @@ + #include + + #include ++#include + #include + + int main(int argc, char *argv[]) +@@ -43,13 +44,12 @@ int main(int argc, char *argv[]) + QStringLiteral("afiestas@kde.org"), QStringLiteral("http://www.afiestas.org/")); + + QApplication app(argc, argv); +- app.setApplicationName(QStringLiteral("bluedevilwizard")); +- app.setApplicationVersion(bluedevil_version); +- app.setApplicationDisplayName(i18n("Bluetooth Wizard")); +- app.setOrganizationDomain(QStringLiteral("kde.org")); + app.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth"))); + app.setQuitOnLastWindowClosed(false); + ++ KAboutData::setApplicationData(aboutData); ++ KDBusService service(KDBusService::Unique); ++ + QCommandLineParser parser; + parser.setApplicationDescription(i18n("Bluetooth Wizard")); + parser.addVersionOption(); +@@ -59,12 +59,13 @@ int main(int argc, char *argv[]) + parser.process(app); + + const QStringList &args = parser.positionalArguments(); +- QUrl url; +- if (!args.isEmpty()) { +- url = args.first(); +- } ++ const QUrl &url = !args.isEmpty() ? args.first() : QUrl(); ++ ++ BlueWizard *wizard = new BlueWizard(url); + +- new BlueWizard(url); ++ QObject::connect(&service, &KDBusService::activateRequested, wizard, [wizard]() { ++ wizard->setWindowState((wizard->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive); ++ }); + + return app.exec(); + } +diff --git a/src/wizard/org.kde.bluedevilwizard.desktop b/src/wizard/org.kde.bluedevilwizard.desktop +new file mode 100644 +index 0000000..8e89f30 +--- /dev/null ++++ b/src/wizard/org.kde.bluedevilwizard.desktop +@@ -0,0 +1,99 @@ ++[Desktop Entry] ++Name=BlueDevil Wizard ++Name[bs]=Bludevilov čarobnjak ++Name[ca]=Assistent del BlueDevil ++Name[cs]=Průvodce Bluedevil ++Name[de]=BlueDevil-Assistent ++Name[el]=Οδηγός BlueDevil ++Name[en_GB]=BlueDevil Wizard ++Name[es]=Asistente de BlueDevil ++Name[fi]=Opastettu BlueDevil-toiminto ++Name[fr]=Assistant pour BlueDevil ++Name[it]=Procedura guidata di BlueDevil ++Name[ja]=BlueDevil ウィザード ++Name[nb]=BlueDevil veiviser ++Name[nl]=BlueDevil assistent ++Name[pl]=Pomocnik BlueDevil ++Name[pt]=Assistente BlueDevil ++Name[pt_BR]=Assistente BlueDevil ++Name[sk]=Sprievodca BlueDevil ++Name[sl]=BlueDevil – čarovnik ++Name[sr]=Блудевилов чаробњак ++Name[sr@ijekavian]=Блудевилов чаробњак ++Name[sr@ijekavianlatin]=BlueDevilov čarobnjak ++Name[sr@latin]=BlueDevilov čarobnjak ++Name[sv]=Blådjävul guide ++Name[tr]=BlueDevil Sihirbazı ++Name[uk]=Майстер BlueDevil ++Name[x-test]=xxBlueDevil Wizardxx ++Name[zh_CN]=BlueDevil 向导 ++Name[zh_TW]=BlueDevil 精靈 ++GenericName=BlueDevil Wizard ++GenericName[bs]=Bludevilov čarobnjak ++GenericName[ca]=Assistent del BlueDevil ++GenericName[cs]=Průvodce Bluedevil ++GenericName[de]=BlueDevil-Assistent ++GenericName[el]=Οδηγός BlueDevil ++GenericName[en_GB]=BlueDevil Wizard ++GenericName[es]=Asistente de BlueDevil ++GenericName[fi]=Opastettu BlueDevil-toiminto ++GenericName[fr]=Assistant pour BlueDevil ++GenericName[it]=Procedura guidata di BlueDevil ++GenericName[ja]=BlueDevil ウィザード ++GenericName[nb]=BlueDevil veiviser ++GenericName[nl]=BlueDevil assistent ++GenericName[pa]=BlueDevil ਸਹਾਇਕ ++GenericName[pl]=Pomocnik BlueDevil ++GenericName[pt]=Assistente BlueDevil ++GenericName[pt_BR]=Assistente BlueDevil ++GenericName[sk]=Sprievodca BlueDevil ++GenericName[sl]=BlueDevil – čarovnik ++GenericName[sr]=Блудевилов чаробњак ++GenericName[sr@ijekavian]=Блудевилов чаробњак ++GenericName[sr@ijekavianlatin]=BlueDevilov čarobnjak ++GenericName[sr@latin]=BlueDevilov čarobnjak ++GenericName[sv]=Blådjävul guide ++GenericName[tr]=BlueDevil Sihirbazı ++GenericName[uk]=Майстер BlueDevil ++GenericName[x-test]=xxBlueDevil Wizardxx ++GenericName[zh_CN]=BlueDevil 向导 ++GenericName[zh_TW]=BlueDevil 精靈 ++Comment=BlueDevil Wizard ++Comment[bs]=Bludevilov čarobnjak ++Comment[ca]=Assistent del BlueDevil ++Comment[cs]=BlueDevil ++Comment[de]=BlueDevil-Assistent ++Comment[el]=Οδηγός BlueDevil ++Comment[en_GB]=BlueDevil Wizard ++Comment[es]=Asistente de BlueDevil ++Comment[fi]=Opastettu BlueDevil-toiminto ++Comment[fr]=Assistant pour BlueDevil ++Comment[it]=Procedura guidata di BlueDevil ++Comment[ja]=BlueDevil ウィザード ++Comment[nb]=BlueDevil veiviser ++Comment[nl]=BlueDevil assistent ++Comment[pa]=BlueDevil ਸਹਾਇਕ ++Comment[pl]=Pomocnik BlueDevil ++Comment[pt]=Assistente BlueDevil ++Comment[pt_BR]=Assistente BlueDevil ++Comment[sk]=Sprievodca BlueDevil ++Comment[sl]=BlueDevil – čarovnik ++Comment[sr]=Блудевилов чаробњак ++Comment[sr@ijekavian]=Блудевилов чаробњак ++Comment[sr@ijekavianlatin]=BlueDevilov čarobnjak ++Comment[sr@latin]=BlueDevilov čarobnjak ++Comment[sv]=Blådjävul guide ++Comment[tr]=BlueDevil Sihirbazı ++Comment[uk]=Майстер BlueDevil ++Comment[x-test]=xxBlueDevil Wizardxx ++Comment[zh_CN]=BlueDevil 向导 ++Comment[zh_TW]=BlueDevil 精靈 ++ ++Type=Application ++Exec=bluedevil-wizard %U ++Icon=preferences-system-bluetooth ++Terminal=false ++NoDisplay=true ++Categories=Qt;KDE;X-Bluetooth;Network; ++X-DBUS-StartupType=Unique ++X-DBUS-ServiceName=org.kde.bluedevilwizard diff --git a/src/wizard/pages/discover.ui b/src/wizard/pages/discover.ui index c43f080..aec410d 100644 --- a/src/wizard/pages/discover.ui @@ -3577,7 +6299,7 @@ index c43f080..aec410d 100644 false diff --git a/src/wizard/pages/discoverpage.cpp b/src/wizard/pages/discoverpage.cpp -index de3f10e..35cc186 100644 +index de3f10e..e52c885 100644 --- a/src/wizard/pages/discoverpage.cpp +++ b/src/wizard/pages/discoverpage.cpp @@ -26,6 +26,7 @@ @@ -3588,18 +6310,53 @@ index de3f10e..35cc186 100644 #include #include -@@ -64,6 +65,10 @@ void DiscoverPage::initializePage() +@@ -36,7 +37,9 @@ + + using namespace BlueDevil; + +-DiscoverPage::DiscoverPage(BlueWizard* parent): QWizardPage(parent), m_wizard(parent) ++DiscoverPage::DiscoverPage(BlueWizard *parent) ++ : QWizardPage(parent) ++ , m_wizard(parent) + { + setTitle(i18n("Select a device")); + setupUi(this); +@@ -46,12 +49,7 @@ DiscoverPage::DiscoverPage(BlueWizard* parent): QWizardPage(parent), m_wizard(pa + workingPainter->setWidget(working); + workingPainter->start(); + +- connect(deviceList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, +- SLOT(itemSelected(QListWidgetItem*))); +-} +- +-DiscoverPage::~DiscoverPage() +-{ ++ connect(deviceList, &QListWidget::currentItemChanged, this, &DiscoverPage::itemSelected); + } + + void DiscoverPage::initializePage() +@@ -64,19 +62,22 @@ void DiscoverPage::initializePage() list << QWizard::CancelButton; m_wizard->setButtonLayout(list); -+ QRegExp rx("[0-9]{0,9}"); +- connect(Manager::self()->usableAdapter(), SIGNAL(unpairedDeviceFound(Device*)), this, +- SLOT(deviceFound(Device*))); +- connect(manualPin, SIGNAL(toggled(bool)), pinText, SLOT(setEnabled(bool))); +- connect(manualPin, SIGNAL(toggled(bool)), this, SIGNAL(completeChanged())); +- connect(pinText, SIGNAL(textChanged(QString)), m_wizard, SLOT(setPin(QString))); +- connect(pinText, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); ++ QRegExp rx(QStringLiteral("[0-9]{0,9}")); + QRegExpValidator *validator = new QRegExpValidator(rx); + pinText->setValidator(validator); + - connect(Manager::self()->usableAdapter(), SIGNAL(unpairedDeviceFound(Device*)), this, - SLOT(deviceFound(Device*))); - connect(manualPin, SIGNAL(toggled(bool)), pinText, SLOT(setEnabled(bool))); -@@ -76,7 +81,7 @@ void DiscoverPage::initializePage() ++ connect(Manager::self()->usableAdapter(), &Adapter::unpairedDeviceFound, this, &DiscoverPage::deviceFound); ++ connect(manualPin, &QCheckBox::toggled, pinText, &QLineEdit::setEnabled); ++ connect(manualPin, &QCheckBox::toggled, this, &DiscoverPage::completeChanged); ++ connect(pinText, &QLineEdit::textChanged, m_wizard, &BlueWizard::setPin); ++ connect(pinText, &QLineEdit::textChanged, this, &DiscoverPage::completeChanged); + + QMetaObject::invokeMethod(this, "startScan", Qt::QueuedConnection); + } bool DiscoverPage::isComplete() const { @@ -3608,7 +6365,66 @@ index de3f10e..35cc186 100644 return false; } if (manualPin->isChecked() && pinText->text().isEmpty()) { -@@ -193,7 +198,7 @@ int DiscoverPage::nextId() const +@@ -106,7 +107,7 @@ void DiscoverPage::stopScan() + } + } + +-void DiscoverPage::deviceFound(Device* device) ++void DiscoverPage::deviceFound(Device *device) + { + QString address = device->address(); + QString name = device->name(); +@@ -136,14 +137,14 @@ void DiscoverPage::deviceFound(Device* device) + m_itemRelation[address]->setIcon(QIcon::fromTheme(icon)); + m_itemRelation[address]->setData(Qt::UserRole + 1, origName); + +- //If the device was selected but it didn't had a name, select it again ++ // If the device was selected but it didn't had a name, select it again + if (deviceList->currentItem() == m_itemRelation[address]) { + itemSelected(m_itemRelation[address]); + } + return; + } + +- connect(device, SIGNAL(propertyChanged(QString,QVariant)), SLOT(devicePropertyChanged())); ++ connect(device, &Device::propertyChanged, this, &DiscoverPage::devicePropertyChanged); + + QListWidgetItem *item = new QListWidgetItem(QIcon::fromTheme(icon), name, deviceList); + +@@ -156,20 +157,20 @@ void DiscoverPage::deviceFound(Device* device) + deviceList->setCurrentItem(m_itemRelation[address]); + } + +- //If the device has been preselected via arguments, select it ++ // If the device has been preselected via arguments, select it + if (m_wizard->preselectedAddress() == address.toLower()) { + deviceList->setCurrentItem(m_itemRelation[address]); + } + } + +-void DiscoverPage::itemSelected(QListWidgetItem* item) ++void DiscoverPage::itemSelected(QListWidgetItem *item) + { + bool origName = item->data(Qt::UserRole+1).toBool(); + if (origName) { + QString address = item->data(Qt::UserRole).toString(); +- m_wizard->setDeviceAddress(address.toUtf8()); ++ m_wizard->setDeviceAddress(address); + } else { +- m_wizard->setDeviceAddress(QByteArray()); ++ m_wizard->setDeviceAddress(QString()); + } + emit completeChanged(); + } +@@ -184,7 +185,6 @@ void DiscoverPage::devicePropertyChanged() + + int DiscoverPage::nextId() const + { +- qCDebug(WIZARD); + if (!isComplete()) { + return BlueWizard::Discover; + } +@@ -193,7 +193,7 @@ int DiscoverPage::nextId() const return BlueWizard::Discover; } @@ -3617,11 +6433,91 @@ index de3f10e..35cc186 100644 return BlueWizard::Discover; } +@@ -223,20 +223,20 @@ int DiscoverPage::nextId() const + qCDebug(WIZARD) << "From DB: " << m_wizard->agent()->isFromDatabase(); + qCDebug(WIZARD) << "PIN: " << m_wizard->agent()->pin(); + +- //If keyboard no matter what, we go to the keyboard page. ++ // If keyboard no matter what, we go to the keyboard page. + if (classToType(device->deviceClass()) == BLUETOOTH_TYPE_KEYBOARD) { + qCDebug(WIZARD) << "Keyboard Pairing"; + return BlueWizard::KeyboardPairing; + } + +- //If pin == NULL means that not pairing is required ++ // If pin == NULL means that not pairing is required + if (!device->hasLegacyPairing() && !m_wizard->agent()->isFromDatabase()) { + qCDebug(WIZARD) << "Secure Pairing"; + return BlueWizard::SSPPairing; + } + + if (pin == QLatin1String("NULL")) { +- qCDebug(WIZARD) << "NO Pairing"; ++ qCDebug(WIZARD) << "No Pairing"; + return BlueWizard::NoPairing; + } + +diff --git a/src/wizard/pages/discoverpage.h b/src/wizard/pages/discoverpage.h +index 86afbea..5d310e7 100644 +--- a/src/wizard/pages/discoverpage.h ++++ b/src/wizard/pages/discoverpage.h +@@ -23,33 +23,34 @@ + + class BlueWizard; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + } +-using namespace BlueDevil; + + class DiscoverPage : public QWizardPage, public Ui::Discover + { +-Q_OBJECT ++ Q_OBJECT + + public: +- DiscoverPage(BlueWizard* parent = 0); +- virtual ~DiscoverPage(); ++ explicit DiscoverPage(BlueWizard *parent = 0); ++ ++ void initializePage() Q_DECL_OVERRIDE; ++ bool isComplete() const Q_DECL_OVERRIDE; ++ int nextId() const Q_DECL_OVERRIDE; + +- virtual void initializePage(); +- virtual bool isComplete() const; +- virtual int nextId() const; + private Q_SLOTS: + void startScan(); +- void deviceFound(Device * device); +- void itemSelected(QListWidgetItem* item); ++ void deviceFound(BlueDevil::Device *device); ++ void itemSelected(QListWidgetItem *item); + void devicePropertyChanged(); ++ + private: + void stopScan(); + + private: + QMap m_itemRelation; +- Device *m_selectedDevice; ++ BlueDevil::Device *m_selectedDevice; + BlueWizard *m_wizard; + }; + diff --git a/src/wizard/pages/fail.cpp b/src/wizard/pages/fail.cpp -index 422920f..b9a6119 100644 +index 422920f..6abbeeb 100644 --- a/src/wizard/pages/fail.cpp +++ b/src/wizard/pages/fail.cpp -@@ -40,6 +40,8 @@ FailPage::FailPage(BlueWizard* parent) +@@ -35,20 +35,21 @@ + + using namespace BlueDevil; + +-FailPage::FailPage(BlueWizard* parent) ++FailPage::FailPage(BlueWizard *parent) + : QWizardPage(parent) , m_wizard(parent) { setupUi(this); @@ -3630,6 +6526,59 @@ index 422920f..b9a6119 100644 } void FailPage::initializePage() + { +- qCDebug(WIZARD); + QPushButton *reset = new QPushButton(this); + KGuiItem::assign(reset, KStandardGuiItem::reset()); + reset->setText(i18nc("Button offered when the wizard fail. This button will restart the wizard", "Restart the wizard")); +- connect(reset, SIGNAL(clicked(bool)), m_wizard, SLOT(restartWizard())); ++ connect(reset, &QPushButton::clicked, m_wizard, &BlueWizard::restartWizard); + + m_wizard->setButton(QWizard::CustomButton3, reset); + m_wizard->setButtonText(QWizard::CancelButton, i18nc("Button that closes the wizard", "Close")); +@@ -60,11 +61,10 @@ void FailPage::initializePage() + + m_wizard->setButtonLayout(list); + +- QString deviceName = m_wizard->device()->name(); ++ const QString &deviceName = m_wizard->device()->name(); + if (deviceName.isEmpty()) { + failLbl->setText(i18nc("This string is shown when the wizard fail","The setup of the device has failed")); + } else { + failLbl->setText(i18n("The setup of %1 has failed", deviceName)); + } +- + } +diff --git a/src/wizard/pages/fail.h b/src/wizard/pages/fail.h +index 4b734c4..fa6378f 100644 +--- a/src/wizard/pages/fail.h ++++ b/src/wizard/pages/fail.h +@@ -29,7 +29,8 @@ + class BlueWizard; + class KPixmapSequenceOverlayPainter; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + class Adapter; + } +@@ -38,12 +39,12 @@ using namespace BlueDevil; + + class FailPage : public QWizardPage, Ui::Fail + { +-Q_OBJECT ++ Q_OBJECT + + public: +- FailPage(BlueWizard* parent = 0); ++ explicit FailPage(BlueWizard *parent = 0); + +- virtual void initializePage(); ++ void initializePage() Q_DECL_OVERRIDE; + + private: + BlueWizard *m_wizard; diff --git a/src/wizard/pages/fail.ui b/src/wizard/pages/fail.ui index 0470e8f..375a4fb 100644 --- a/src/wizard/pages/fail.ui @@ -3651,11 +6600,291 @@ index 0470e8f..375a4fb 100644 +diff --git a/src/wizard/pages/keyboardpairing.cpp b/src/wizard/pages/keyboardpairing.cpp +index 67c7f27..4b552ba 100644 +--- a/src/wizard/pages/keyboardpairing.cpp ++++ b/src/wizard/pages/keyboardpairing.cpp +@@ -35,11 +35,12 @@ + + using namespace BlueDevil; + +-KeyboardPairingPage::KeyboardPairingPage(BlueWizard* parent) ++KeyboardPairingPage::KeyboardPairingPage(BlueWizard *parent) + : QWizardPage(parent) + , m_wizard(parent) + { + setupUi(this); ++ + m_working = new KPixmapSequenceOverlayPainter(this); + m_working->setSequence(KIconLoader::global()->loadPixmapSequence(QStringLiteral("process-working"), 22)); + m_working->setWidget(pinNumber); +@@ -53,13 +54,12 @@ KeyboardPairingPage::KeyboardPairingPage(BlueWizard* parent) + + void KeyboardPairingPage::initializePage() + { +- qCDebug(WIZARD); + m_wizard->setButtonLayout(wizardButtonsLayout()); + +- connect(m_wizard->agent(), SIGNAL(pinRequested(QString)), this, SLOT(pinRequested(QString))); ++ connect(m_wizard->agent(), &WizardAgent::pinRequested, this, &KeyboardPairingPage::pinRequested); + + Device *device = m_wizard->device(); +- connect(device, SIGNAL(pairedChanged(bool)), this, SLOT(pairedChanged(bool))); ++ connect(device, &Device::pairedChanged, this, &KeyboardPairingPage::pairedChanged); + device->pair(); + } + +@@ -72,6 +72,7 @@ void KeyboardPairingPage::pinRequested(const QString& pin) + void KeyboardPairingPage::pairedChanged(bool paired) + { + qCDebug(WIZARD) << paired; ++ + m_wizard->next(); + } + +@@ -90,6 +91,5 @@ QList KeyboardPairingPage::wizardButtonsLayout() const + QList list; + list << QWizard::Stretch; + list << QWizard::CancelButton; +- + return list; + } +diff --git a/src/wizard/pages/keyboardpairing.h b/src/wizard/pages/keyboardpairing.h +index 14818f6..871295b 100644 +--- a/src/wizard/pages/keyboardpairing.h ++++ b/src/wizard/pages/keyboardpairing.h +@@ -29,7 +29,8 @@ + class BlueWizard; + class KPixmapSequenceOverlayPainter; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + class Adapter; + } +@@ -38,24 +39,24 @@ using namespace BlueDevil; + + class KeyboardPairingPage : public QWizardPage, Ui::KeyboardPairing + { +-Q_OBJECT ++ Q_OBJECT + + public: +- KeyboardPairingPage(BlueWizard* parent = 0); ++ explicit KeyboardPairingPage(BlueWizard *parent = 0); + +- virtual void initializePage(); +- virtual bool validatePage(); +- virtual int nextId() const; ++ void initializePage() Q_DECL_OVERRIDE; ++ bool validatePage() Q_DECL_OVERRIDE; ++ int nextId() const Q_DECL_OVERRIDE; + + public Q_SLOTS: + void pinRequested(const QString &pin); + void pairedChanged(bool paired); + + protected: +- QList wizardButtonsLayout() const; ++ QList wizardButtonsLayout() const; + + private: +- BlueWizard *m_wizard; ++ BlueWizard *m_wizard; + KPixmapSequenceOverlayPainter *m_working; + }; + +diff --git a/src/wizard/pages/legacypairing.cpp b/src/wizard/pages/legacypairing.cpp +index 898c699..943a107 100644 +--- a/src/wizard/pages/legacypairing.cpp ++++ b/src/wizard/pages/legacypairing.cpp +@@ -35,11 +35,12 @@ + + using namespace BlueDevil; + +-LegacyPairingPage::LegacyPairingPage(BlueWizard* parent) ++LegacyPairingPage::LegacyPairingPage(BlueWizard *parent) + : QWizardPage(parent) + , m_wizard(parent) + { + setupUi(this); ++ + m_working = new KPixmapSequenceOverlayPainter(this); + m_working->setSequence(KIconLoader::global()->loadPixmapSequence(QStringLiteral("process-working"), 22)); + m_working->setWidget(pinNumber); +@@ -53,17 +54,16 @@ LegacyPairingPage::LegacyPairingPage(BlueWizard* parent) + + void LegacyPairingPage::initializePage() + { +- qCDebug(WIZARD); + m_wizard->setButtonLayout(wizardButtonsLayout()); + + Device *device = m_wizard->device(); +- connect(m_wizard->agent(), SIGNAL(pinRequested(QString)), this, SLOT(pinRequested(QString))); +- connect(device, SIGNAL(pairedChanged(bool)), this, SLOT(pairedChanged(bool))); ++ connect(m_wizard->agent(), &WizardAgent::pinRequested, this, &LegacyPairingPage::pinRequested); ++ connect(device, &Device::pairedChanged, this, &LegacyPairingPage::pairedChanged); + + device->pair(); + } + +-void LegacyPairingPage::pinRequested(const QString& pin) ++void LegacyPairingPage::pinRequested(const QString &pin) + { + m_working->stop(); + pinNumber->setText(pin); +@@ -72,6 +72,7 @@ void LegacyPairingPage::pinRequested(const QString& pin) + void LegacyPairingPage::pairedChanged(bool paired) + { + qCDebug(WIZARD) << paired; ++ + m_wizard->next(); + } + +@@ -90,6 +91,5 @@ QList LegacyPairingPage::wizardButtonsLayout() const + QList list; + list << QWizard::Stretch; + list << QWizard::CancelButton; +- + return list; + } +diff --git a/src/wizard/pages/legacypairing.h b/src/wizard/pages/legacypairing.h +index f9ec3d4..671743b 100644 +--- a/src/wizard/pages/legacypairing.h ++++ b/src/wizard/pages/legacypairing.h +@@ -29,23 +29,22 @@ + class BlueWizard; + class KPixmapSequenceOverlayPainter; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + class Adapter; + } + +-using namespace BlueDevil; +- + class LegacyPairingPage : public QWizardPage, Ui::LegacyPairing + { +-Q_OBJECT ++ Q_OBJECT + + public: +- LegacyPairingPage(BlueWizard* parent = 0); ++ explicit LegacyPairingPage(BlueWizard *parent = 0); + +- virtual void initializePage(); +- virtual bool validatePage(); +- virtual int nextId() const; ++ void initializePage() Q_DECL_OVERRIDE; ++ bool validatePage() Q_DECL_OVERRIDE; ++ int nextId() const Q_DECL_OVERRIDE; + + public Q_SLOTS: + void pinRequested(const QString &pin); +@@ -55,7 +54,7 @@ protected: + QList wizardButtonsLayout() const; + + private: +- BlueWizard *m_wizard; ++ BlueWizard *m_wizard; + KPixmapSequenceOverlayPainter *m_working; + }; + +diff --git a/src/wizard/pages/legacypairingdatabase.cpp b/src/wizard/pages/legacypairingdatabase.cpp +index a31657c..61dcde0 100644 +--- a/src/wizard/pages/legacypairingdatabase.cpp ++++ b/src/wizard/pages/legacypairingdatabase.cpp +@@ -36,11 +36,12 @@ + + using namespace BlueDevil; + +-LegacyPairingPageDatabase::LegacyPairingPageDatabase(BlueWizard* parent) ++LegacyPairingPageDatabase::LegacyPairingPageDatabase(BlueWizard *parent) + : QWizardPage(parent) + , m_wizard(parent) + { + setupUi(this); ++ + m_working = new KPixmapSequenceOverlayPainter(this); + m_working->setSequence(KIconLoader::global()->loadPixmapSequence(QStringLiteral("process-working"), 22)); + m_working->setWidget(working); +@@ -54,13 +55,14 @@ void LegacyPairingPageDatabase::initializePage() + Device *device = m_wizard->device(); + connecting->setText(i18n("Connecting to %1...", device->name())); + +- connect(device, SIGNAL(pairedChanged(bool)), this, SLOT(pairedChanged(bool))); ++ connect(device, &Device::pairedChanged, this, &LegacyPairingPageDatabase::pairedChanged); + device->pair(); + } + + void LegacyPairingPageDatabase::pairedChanged(bool paired) + { + qCDebug(WIZARD) << paired; ++ + m_wizard->next(); + } + +@@ -79,6 +81,5 @@ QList< QWizard::WizardButton > LegacyPairingPageDatabase::wizardButtonsLayout() + QList list; + list << QWizard::Stretch; + list << QWizard::CancelButton; +- + return list; + } +diff --git a/src/wizard/pages/legacypairingdatabase.h b/src/wizard/pages/legacypairingdatabase.h +index 00c9d16..637c82e 100644 +--- a/src/wizard/pages/legacypairingdatabase.h ++++ b/src/wizard/pages/legacypairingdatabase.h +@@ -29,32 +29,31 @@ + class BlueWizard; + class KPixmapSequenceOverlayPainter; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + class Adapter; + } + +-using namespace BlueDevil; +- + class LegacyPairingPageDatabase : public QWizardPage, Ui::NoPairing + { +-Q_OBJECT ++ Q_OBJECT + + public: +- LegacyPairingPageDatabase(BlueWizard* parent = 0); ++ explicit LegacyPairingPageDatabase(BlueWizard *parent = 0); + +- virtual void initializePage(); +- virtual bool validatePage(); +- virtual int nextId() const; ++ void initializePage() Q_DECL_OVERRIDE; ++ bool validatePage() Q_DECL_OVERRIDE; ++ int nextId() const Q_DECL_OVERRIDE; + + public Q_SLOTS: + void pairedChanged(bool paired); + + protected: +- QList wizardButtonsLayout() const; ++ QList wizardButtonsLayout() const; + + private: +- BlueWizard *m_wizard; ++ BlueWizard *m_wizard; + KPixmapSequenceOverlayPainter *m_working; + }; + diff --git a/src/wizard/pages/nopairing.cpp b/src/wizard/pages/nopairing.cpp -index c0410e1..522cae9 100644 +index c0410e1..d4f1e45 100644 --- a/src/wizard/pages/nopairing.cpp +++ b/src/wizard/pages/nopairing.cpp -@@ -35,9 +35,10 @@ +@@ -35,59 +35,52 @@ using namespace BlueDevil; @@ -3668,8 +6897,10 @@ index c0410e1..522cae9 100644 + , m_wizard(parent) { setupUi(this); ++ m_working = new KPixmapSequenceOverlayPainter(this); -@@ -46,6 +47,14 @@ NoPairingPage::NoPairingPage(BlueWizard* parent) : QWizardPage(parent) + m_working->setSequence(KIconLoader::global()->loadPixmapSequence(QStringLiteral("process-working"), 22)); + m_working->setWidget(working); m_working->start(); } @@ -3683,8 +6914,8 @@ index c0410e1..522cae9 100644 + void NoPairingPage::initializePage() { - qCDebug(WIZARD); -@@ -53,10 +62,6 @@ void NoPairingPage::initializePage() +- qCDebug(WIZARD); + m_wizard->setButtonLayout(wizardButtonsLayout()); connecting->setText(connecting->text().append(m_wizard->device()->name())); @@ -3692,22 +6923,28 @@ index c0410e1..522cae9 100644 - //to the profile. We have no way to know if the profile was activated or not so we have to relay - //on a timeout (10s) - QTimer::singleShot(10000, this, SLOT(timeout())); - connect(m_wizard->device(), SIGNAL(connectedChanged(bool)), SLOT(connectedChanged(bool))); - connect(m_wizard->device(), SIGNAL(trustedChanged(bool)), SLOT(connectedChanged(bool))); +- connect(m_wizard->device(), SIGNAL(connectedChanged(bool)), SLOT(connectedChanged(bool))); +- connect(m_wizard->device(), SIGNAL(trustedChanged(bool)), SLOT(connectedChanged(bool))); ++ connect(m_wizard->device(), &Device::connectedChanged, this, &NoPairingPage::connectedChanged); ++ connect(m_wizard->device(), &Device::trustedChanged, this, &NoPairingPage::connectedChanged); -@@ -64,30 +69,14 @@ void NoPairingPage::initializePage() + m_wizard->device()->connectDevice(); m_wizard->device()->setTrusted(true); - } +-} -void NoPairingPage::timeout() -{ - connectedChanged(true); --} -- ++ QTimer::singleShot(10 * 1000, this, [this]() { ++ connectedChanged(true); ++ }); + } + void NoPairingPage::connectedChanged(bool connected) { - qCDebug(WIZARD); -- ++ qCDebug(WIZARD) << "Connect finished" << connected; + - m_validPage = connected; - if (m_validPage) { - qCDebug(WIZARD) << "Done"; @@ -3719,19 +6956,18 @@ index c0410e1..522cae9 100644 -{ - return m_validPage; -} -+ qCDebug(WIZARD) << "Connect finished" << connected; - +- -int NoPairingPage::nextId() const -{ - return -1; + // Connect may fail but that doesn't really mean the device was setup incorrectly + // Device::connectDevice will fail eg. when A2DP profile could not be connected due to missing pulseaudio plugin + m_success = true; -+ QTimer::singleShot(500, m_wizard, SLOT(next())); ++ QTimer::singleShot(500, m_wizard, &BlueWizard::next); } QList NoPairingPage::wizardButtonsLayout() const -@@ -95,6 +84,5 @@ QList NoPairingPage::wizardButtonsLayout() const +@@ -95,6 +88,5 @@ QList NoPairingPage::wizardButtonsLayout() const QList list; list << QWizard::Stretch; list << QWizard::CancelButton; @@ -3739,20 +6975,40 @@ index c0410e1..522cae9 100644 return list; } diff --git a/src/wizard/pages/nopairing.h b/src/wizard/pages/nopairing.h -index 26f1441..9fd167d 100644 +index 26f1441..1f0a8ab 100644 --- a/src/wizard/pages/nopairing.h +++ b/src/wizard/pages/nopairing.h -@@ -44,20 +44,18 @@ Q_OBJECT +@@ -30,34 +30,31 @@ + class BlueWizard; + class KPixmapSequenceOverlayPainter; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + class Adapter; + } + +-using namespace BlueDevil; +- + class NoPairingPage : public QWizardPage, Ui::NoPairing + { +-Q_OBJECT ++ Q_OBJECT + public: - NoPairingPage(BlueWizard* parent = 0); +- NoPairingPage(BlueWizard* parent = 0); ++ explicit NoPairingPage(BlueWizard *parent = 0); - virtual void initializePage(); - virtual bool validatePage(); - virtual int nextId() const; -+ virtual void initializePage(); +- virtual int nextId() const; ++ int nextId() const Q_DECL_OVERRIDE; ++ void initializePage() Q_DECL_OVERRIDE; protected: - QList wizardButtonsLayout() const; +- QList wizardButtonsLayout() const; ++ QList wizardButtonsLayout() const; private Q_SLOTS: - void timeout(); @@ -3767,25 +7023,142 @@ index 26f1441..9fd167d 100644 }; diff --git a/src/wizard/pages/ssppairing.cpp b/src/wizard/pages/ssppairing.cpp -index 963bdaa..14f5e09 100644 +index 963bdaa..d9e2b0a 100644 --- a/src/wizard/pages/ssppairing.cpp +++ b/src/wizard/pages/ssppairing.cpp -@@ -77,6 +77,7 @@ void SSPPairingPage::initializePage() - void SSPPairingPage::confirmationRequested(quint32 passkey, const QDBusMessage& msg) +@@ -38,12 +38,13 @@ + + using namespace BlueDevil; + +-SSPPairingPage::SSPPairingPage(BlueWizard* parent) ++SSPPairingPage::SSPPairingPage(BlueWizard *parent) + : QWizardPage(parent) + , m_buttonClicked(QWizard::NoButton) + , m_wizard(parent) + { + setupUi(this); ++ + m_working = new KPixmapSequenceOverlayPainter(this); + m_working->setSequence(KIconLoader::global()->loadPixmapSequence(QStringLiteral("process-working"), 22)); + m_working->setWidget(pinNumber); +@@ -57,7 +58,6 @@ SSPPairingPage::SSPPairingPage(BlueWizard* parent) + + void SSPPairingPage::initializePage() + { +- qCDebug(WIZARD); + QList list; + list << QWizard::Stretch; + list << QWizard::CancelButton; +@@ -66,17 +66,17 @@ void SSPPairingPage::initializePage() + Device *device = m_wizard->device(); + confirmLbl->setText(i18n("Connecting to %1...", device->name())); + +- connect(device, SIGNAL(pairedChanged(bool)), this, SLOT(pairedChanged(bool))); +- connect(m_wizard->agent(), SIGNAL(confirmationRequested(quint32,QDBusMessage)), +- this, SLOT(confirmationRequested(quint32,QDBusMessage))); +- connect(m_wizard->agent(), SIGNAL(pinRequested(QString)), SLOT(pinRequested(QString))); ++ connect(device, &Device::pairedChanged, this, &SSPPairingPage::pairedChanged); ++ connect(m_wizard->agent(), &WizardAgent::confirmationRequested, this, &SSPPairingPage::confirmationRequested); ++ connect(m_wizard->agent(), &WizardAgent::pinRequested, this, &SSPPairingPage::pinRequested); + + device->pair(); + } + +-void SSPPairingPage::confirmationRequested(quint32 passkey, const QDBusMessage& msg) ++void SSPPairingPage::confirmationRequested(quint32 passkey, const QDBusMessage &msg) { m_msg = msg; + m_msg.setDelayedReply(true); QPushButton *matches = new QPushButton(this); KGuiItem::assign(matches, KStandardGuiItem::apply()); -@@ -129,6 +130,7 @@ void SSPPairingPage::matchesClicked() +@@ -86,8 +86,8 @@ void SSPPairingPage::confirmationRequested(quint32 passkey, const QDBusMessage& + KGuiItem::assign(notMatch, KStandardGuiItem::cancel()); + notMatch->setText(i18n("Does not match")); + +- connect(matches, SIGNAL(clicked(bool)), this, SLOT(matchesClicked())); +- connect(notMatch, SIGNAL(clicked(bool)), this, SLOT(notMatchClicked())); ++ connect(matches, &QPushButton::clicked, this, &SSPPairingPage::matchesClicked); ++ connect(notMatch, &QPushButton::clicked, this, &SSPPairingPage::notMatchClicked); + + wizard()->setButton(QWizard::CustomButton1, matches); + wizard()->setButton(QWizard::CustomButton2, notMatch); +@@ -101,7 +101,7 @@ void SSPPairingPage::confirmationRequested(quint32 passkey, const QDBusMessage& + + } + +-void SSPPairingPage::pinRequested(const QString& pin) ++void SSPPairingPage::pinRequested(const QString &pin) + { + m_working->stop(); + pinNumber->setText(pin); +@@ -129,6 +129,7 @@ void SSPPairingPage::matchesClicked() void SSPPairingPage::notMatchClicked() { m_buttonClicked = QWizard::CustomButton2; -+ QDBusConnection::systemBus().send(m_msg.createErrorReply("org.bluez.Rejected", "Rejected")); ++ QDBusConnection::systemBus().send(m_msg.createErrorReply(QStringLiteral("org.bluez.Rejected"), QStringLiteral("Rejected"))); wizard()->next(); } +@@ -163,6 +164,5 @@ QList SSPPairingPage::wizardButtonsLayout() const + list << QWizard::Stretch; + list << QWizard::CustomButton2; + list << QWizard::CustomButton1; +- + return list; + } +diff --git a/src/wizard/pages/ssppairing.h b/src/wizard/pages/ssppairing.h +index 9b7066d..1cd2aa8 100644 +--- a/src/wizard/pages/ssppairing.h ++++ b/src/wizard/pages/ssppairing.h +@@ -30,23 +30,22 @@ + class BlueWizard; + class KPixmapSequenceOverlayPainter; + +-namespace BlueDevil { ++namespace BlueDevil ++{ + class Device; + class Adapter; + } + +-using namespace BlueDevil; +- + class SSPPairingPage : public QWizardPage, Ui::SSPPairing + { +-Q_OBJECT ++ Q_OBJECT + + public: +- SSPPairingPage(BlueWizard* parent = 0); ++ explicit SSPPairingPage(BlueWizard *parent = 0); + +- virtual void initializePage(); +- virtual int nextId() const; +- virtual bool validatePage(); ++ void initializePage() Q_DECL_OVERRIDE; ++ int nextId() const Q_DECL_OVERRIDE; ++ bool validatePage() Q_DECL_OVERRIDE; + + public Q_SLOTS: + void confirmationRequested(quint32 passkey, const QDBusMessage &msg); +@@ -56,12 +55,12 @@ public Q_SLOTS: + void pinRequested(const QString &pin); + + protected: +- QList wizardButtonsLayout() const; ++ QList wizardButtonsLayout() const; + + private: +- QDBusMessage m_msg; +- QWizard::WizardButton m_buttonClicked; +- BlueWizard *m_wizard; ++ QDBusMessage m_msg; ++ QWizard::WizardButton m_buttonClicked; ++ BlueWizard *m_wizard; + KPixmapSequenceOverlayPainter *m_working; + }; + diff --git a/src/wizard/pages/success.cpp b/src/wizard/pages/success.cpp new file mode 100644 index 0000000..f49bb7f @@ -3860,7 +7233,7 @@ index 0000000..f49bb7f +} diff --git a/src/wizard/pages/success.h b/src/wizard/pages/success.h new file mode 100644 -index 0000000..a41f73e +index 0000000..ba0d73c --- /dev/null +++ b/src/wizard/pages/success.h @@ -0,0 +1,46 @@ @@ -3900,10 +7273,10 @@ index 0000000..a41f73e + Q_OBJECT + +public: -+ SuccessPage(BlueWizard *parent = 0); ++ explicit SuccessPage(BlueWizard *parent = 0); + -+ virtual void initializePage(); -+ virtual int nextId() const; ++ void initializePage() Q_DECL_OVERRIDE; ++ int nextId() const Q_DECL_OVERRIDE; + +private: + BlueWizard *m_wizard; @@ -4001,3 +7374,17 @@ index 8239aa9..5e99392 100644