From 01c4d0411b9958e1f336ca1e6bd47be5f943b85d Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sun, 22 Dec 2019 09:49:55 +0200 Subject: [PATCH] Fix minor EBN issues --- .../bluetooth/connectionmultiplexer.h | 2 +- declarativeplugin/responsewaiter.cpp | 20 +++++++++ declarativeplugin/responsewaiter.h | 41 ++++++++++++++----- indicator/indicatorhelper.cpp | 4 +- indicator/indicatorhelper.h | 5 +++ indicator/main.cpp | 2 +- interfaces/interfaces_debug.h | 6 +-- interfaces/modeltest.cpp | 6 +-- interfaces/modeltest.h | 6 +-- plugins/mousepad/macosremoteinput.mm | 2 +- plugins/mousepad/windowsremoteinput.cpp | 2 +- plugins/mpriscontrol/CMakeLists.txt | 2 +- .../mpriscontrol/mpriscontrolplugin-win.cpp | 20 +++++++++ plugins/mpriscontrol/mpriscontrolplugin-win.h | 22 +++++++++- plugins/notifications/notification.cpp | 4 +- plugins/pausemusic/pausemusicplugin-win.h | 2 +- .../sendnotifications/notificationslistener.h | 6 +-- plugins/sftp/mounter.h | 4 +- smsapp/qml/ConversationDisplay.qml | 4 +- tests/testdevice.h | 5 +++ 20 files changed, 127 insertions(+), 38 deletions(-) diff --git a/core/backends/bluetooth/connectionmultiplexer.h b/core/backends/bluetooth/connectionmultiplexer.h index e750d0489..2f79ed878 100644 --- a/core/backends/bluetooth/connectionmultiplexer.h +++ b/core/backends/bluetooth/connectionmultiplexer.h @@ -117,7 +117,7 @@ private: /** * Tries to parse a single connection message. * - * @return True if a message was parsed succesfully. + * @return True if a message was parsed successfully. */ bool tryParseMessage(); /** diff --git a/declarativeplugin/responsewaiter.cpp b/declarativeplugin/responsewaiter.cpp index b575d6485..c0e0231f2 100644 --- a/declarativeplugin/responsewaiter.cpp +++ b/declarativeplugin/responsewaiter.cpp @@ -1,3 +1,23 @@ +/** + * Copyright 2013 Albert Vaca + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "responsewaiter.h" #include diff --git a/declarativeplugin/responsewaiter.h b/declarativeplugin/responsewaiter.h index 92c9873eb..433df4d99 100644 --- a/declarativeplugin/responsewaiter.h +++ b/declarativeplugin/responsewaiter.h @@ -1,3 +1,22 @@ +/** + * Copyright 2013 Albert Vaca + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #ifndef RESPONSE_WAITER_H #define RESPONSE_WAITER_H @@ -12,19 +31,19 @@ class QDBusPendingCallWatcher; class DBusResponseWaiter : public QObject { Q_OBJECT - + public: - + static DBusResponseWaiter* instance(); - + ///extract QDbusPendingCall from \p variant and blocks until completed Q_INVOKABLE QVariant waitForReply(QVariant variant) const; - + const QDBusPendingCall* extractPendingCall(QVariant& variant) const; - + private: DBusResponseWaiter(); - + static DBusResponseWaiter* m_instance; QList m_registered; }; @@ -34,24 +53,24 @@ class DBusAsyncResponse : public QObject { Q_OBJECT Q_PROPERTY(bool autoDelete READ autodelete WRITE setAutodelete) - + public: explicit DBusAsyncResponse(QObject* parent = nullptr); ~DBusAsyncResponse() override = default; Q_INVOKABLE void setPendingCall(QVariant e); - + void setAutodelete(bool b) {m_autodelete = b;}; bool autodelete() const {return m_autodelete;} - + Q_SIGNALS: void success(const QVariant& result); void error(const QString& message); - + private Q_SLOTS: void onCallFinished(QDBusPendingCallWatcher* watcher); void onTimeout(); - + private: QTimer m_timeout; bool m_autodelete; diff --git a/indicator/indicatorhelper.cpp b/indicator/indicatorhelper.cpp index 6f14f68d6..47caf5afd 100644 --- a/indicator/indicatorhelper.cpp +++ b/indicator/indicatorhelper.cpp @@ -18,11 +18,11 @@ * along with this program. If not, see . */ +#include "indicatorhelper.h" + #include #include -#include "indicatorhelper.h" - IndicatorHelper::IndicatorHelper() {} IndicatorHelper::~IndicatorHelper() {} diff --git a/indicator/indicatorhelper.h b/indicator/indicatorhelper.h index c80fe8c9a..66894b564 100644 --- a/indicator/indicatorhelper.h +++ b/indicator/indicatorhelper.h @@ -18,6 +18,9 @@ * along with this program. If not, see . */ +#ifndef INDICATORHELPER_H +#define INDICATORHELPER_H + #include #include @@ -51,3 +54,5 @@ private: QSplashScreen *m_splashScreen; #endif }; + +#endif diff --git a/indicator/main.cpp b/indicator/main.cpp index 3aef22c32..6f444a1d0 100644 --- a/indicator/main.cpp +++ b/indicator/main.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) helper.preInit(); - // Run Daemon initilization step + // Run Daemon initialization step QProcess kdeconnectd; if (helper.daemonHook(kdeconnectd)) { return -1; diff --git a/interfaces/interfaces_debug.h b/interfaces/interfaces_debug.h index 2cdb99e69..cfd1b6484 100644 --- a/interfaces/interfaces_debug.h +++ b/interfaces/interfaces_debug.h @@ -18,11 +18,11 @@ * along with this program. If not, see . */ -#ifndef KDECONNECT_INTERFACE_DEBUG_H -#define KDECONNECT_INTERFACE_DEBUG_H +#ifndef KDECONNECT_INTERFACES_DEBUG_H +#define KDECONNECT_INTERFACES_DEBUG_H #include Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_INTERFACES) -#endif //KDECONNECT_INTERFACE_DEBUG_H +#endif //KDECONNECT_INTERFACES_DEBUG_H diff --git a/interfaces/modeltest.cpp b/interfaces/modeltest.cpp index 1494349c3..db0dc4a4e 100644 --- a/interfaces/modeltest.cpp +++ b/interfaces/modeltest.cpp @@ -9,12 +9,12 @@ ** and appearing in the file LICENSE.GPL included in the packaging of ** this file. Please review the following information to ensure GNU ** General Public Licensing requirements will be met: -** http://www.trolltech.com/products/qt/opensource.html +** https://www.qt.io/download-open-source ** ** If you are unsure which license is appropriate for your use, please ** review the following information: -** http://www.trolltech.com/products/qt/licensing.html or contact the -** sales department at sales@trolltech.com. +** https://www.qt.io/licensing/ or contact the +** sales department at https://www.qt.io/contact-us ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. diff --git a/interfaces/modeltest.h b/interfaces/modeltest.h index 30e39b439..3af0d2e6f 100644 --- a/interfaces/modeltest.h +++ b/interfaces/modeltest.h @@ -9,12 +9,12 @@ ** and appearing in the file LICENSE.GPL included in the packaging of ** this file. Please review the following information to ensure GNU ** General Public Licensing requirements will be met: -** http://www.trolltech.com/products/qt/opensource.html +** https://www.qt.io/download-open-source ** ** If you are unsure which license is appropriate for your use, please ** review the following information: -** http://www.trolltech.com/products/qt/licensing.html or contact the -** sales department at sales@trolltech.com. +** https://www.qt.io/licensing/ or contact the +** sales department at https://www.qt.io/contact-us ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. diff --git a/plugins/mousepad/macosremoteinput.mm b/plugins/mousepad/macosremoteinput.mm index 9059d300d..c79c13a98 100644 --- a/plugins/mousepad/macosremoteinput.mm +++ b/plugins/mousepad/macosremoteinput.mm @@ -238,4 +238,4 @@ bool MacOSRemoteInput::handlePacket(const NetworkPacket& np) bool MacOSRemoteInput::hasKeyboardSupport() { return true; -} \ No newline at end of file +} diff --git a/plugins/mousepad/windowsremoteinput.cpp b/plugins/mousepad/windowsremoteinput.cpp index 2dad3e38b..36e35f57d 100644 --- a/plugins/mousepad/windowsremoteinput.cpp +++ b/plugins/mousepad/windowsremoteinput.cpp @@ -258,4 +258,4 @@ bool WindowsRemoteInput::handlePacket(const NetworkPacket& np) bool WindowsRemoteInput::hasKeyboardSupport() { return true; -} \ No newline at end of file +} diff --git a/plugins/mpriscontrol/CMakeLists.txt b/plugins/mpriscontrol/CMakeLists.txt index aa4dcc195..a4c831733 100644 --- a/plugins/mpriscontrol/CMakeLists.txt +++ b/plugins/mpriscontrol/CMakeLists.txt @@ -26,4 +26,4 @@ if(WIN32) target_link_libraries(kdeconnect_mpriscontrol kdeconnectcore) else() target_link_libraries(kdeconnect_mpriscontrol Qt5::DBus kdeconnectcore) -endif() \ No newline at end of file +endif() diff --git a/plugins/mpriscontrol/mpriscontrolplugin-win.cpp b/plugins/mpriscontrol/mpriscontrolplugin-win.cpp index 10348e40d..4ccefa21d 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin-win.cpp +++ b/plugins/mpriscontrol/mpriscontrolplugin-win.cpp @@ -1,3 +1,23 @@ +/** + * Copyright 2018 Jun Bo Bi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "mpriscontrolplugin-win.h" #include diff --git a/plugins/mpriscontrol/mpriscontrolplugin-win.h b/plugins/mpriscontrol/mpriscontrolplugin-win.h index 600f531cb..0e1affaf0 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin-win.h +++ b/plugins/mpriscontrol/mpriscontrolplugin-win.h @@ -1,3 +1,23 @@ +/** + * Copyright 2018 Jun Bo Bi + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef MPRISCONTROLPLUGINWIN_H #define MPRISCONTROLPLUGINWIN_H @@ -26,4 +46,4 @@ class MprisControlPlugin private: const QString playername = PLAYERNAME; }; -#endif //MPRISCONTROLPLUGINWIN_H \ No newline at end of file +#endif //MPRISCONTROLPLUGINWIN_H diff --git a/plugins/notifications/notification.cpp b/plugins/notifications/notification.cpp index 39b812bdf..5442d8a44 100644 --- a/plugins/notifications/notification.cpp +++ b/plugins/notifications/notification.cpp @@ -42,7 +42,7 @@ Notification::Notification(const NetworkPacket& np, const Device* device, QObjec , m_imagesDir() , m_device(device) { - //Make a own directory for each user so noone can see each others icons + //Make a own directory for each user so no one can see each others icons QString username; #ifdef Q_OS_WIN username = QString::fromLatin1(qgetenv("USERNAME")); @@ -63,7 +63,7 @@ Notification::Notification(const NetworkPacket& np, const Device* device, QObjec if(!m_requestReplyId.isEmpty() && actionIndex == 1) { return; } - // Notification action idices start at 1 + // Notification action indices start at 1 Q_EMIT actionTriggered(m_internalId, m_actions[actionIndex - 1]); }); } diff --git a/plugins/pausemusic/pausemusicplugin-win.h b/plugins/pausemusic/pausemusicplugin-win.h index cf9e26825..51b647239 100644 --- a/plugins/pausemusic/pausemusicplugin-win.h +++ b/plugins/pausemusic/pausemusicplugin-win.h @@ -55,4 +55,4 @@ private: }; -#endif // PAUSEMUSICPLUGINWIN_H \ No newline at end of file +#endif // PAUSEMUSICPLUGINWIN_H diff --git a/plugins/sendnotifications/notificationslistener.h b/plugins/sendnotifications/notificationslistener.h index 405e27948..abacabe80 100644 --- a/plugins/sendnotifications/notificationslistener.h +++ b/plugins/sendnotifications/notificationslistener.h @@ -18,8 +18,8 @@ * along with this program. If not, see . */ -#ifndef NOTIFICATIONLISTENER_H -#define NOTIFICATIONLISTENER_H +#ifndef NOTIFICATIONSLISTENER_H +#define NOTIFICATIONSLISTENER_H #include #include @@ -66,4 +66,4 @@ private: QString m_translatedAppName; }; -#endif // NOTIFICATIONLISTENER_H +#endif // NOTIFICATIONSLISTENER_H diff --git a/plugins/sftp/mounter.h b/plugins/sftp/mounter.h index a58ae7827..d2c4bacb3 100644 --- a/plugins/sftp/mounter.h +++ b/plugins/sftp/mounter.h @@ -18,8 +18,8 @@ * along with this program. If not, see . */ -#ifndef SFTPPLUGIN_MOUNTJOB_H -#define SFTPPLUGIN_MOUNTJOB_H +#ifndef SFTPPLUGIN_MOUNTER_H +#define SFTPPLUGIN_MOUNTER_H #include #include diff --git a/smsapp/qml/ConversationDisplay.qml b/smsapp/qml/ConversationDisplay.qml index 618cce33e..157caee3d 100644 --- a/smsapp/qml/ConversationDisplay.qml +++ b/smsapp/qml/ConversationDisplay.qml @@ -96,13 +96,13 @@ Kirigami.ScrollablePage } if (!isInitalized) { - // If we aren't initalized, we need to request enough messages to fill the view + // If we aren't initialized, we need to request enough messages to fill the view // In order to do that, request one more message until we have enough if (viewport.contentHeight < viewport.height) { console.debug("Requesting another message to fill the screen") conversationModel.requestMoreMessages(1) } else { - // Finish intializing: Scroll to the bottom of the view + // Finish initializing: Scroll to the bottom of the view // View the most-recent message viewport.forceLayout() diff --git a/tests/testdevice.h b/tests/testdevice.h index ebdd525d3..c75235cdb 100644 --- a/tests/testdevice.h +++ b/tests/testdevice.h @@ -19,6 +19,9 @@ * along with this program. If not, see . */ +#ifndef TESTDEVICE_H +#define TESTDEVICE_H + #include #include "core/device.h" @@ -58,3 +61,5 @@ public Q_SLOTS: bool sendPacket(NetworkPacket& np) override; }; + +#endif