Commit graph

39 commits

Author SHA1 Message Date
Alexander Lohnau
c5e7fdb5e4 plugins: Prefer using statements with baseclass over empty constructor
Those plugins re really simple and don't need any initialization logic.
With the using statement, we do not need to add a constructor and pass the parent/args to the baseclass
2023-08-07 19:28:37 +02:00
Alexander Lohnau
46feeda0cb Remove unused default destructors
Overriding and defaulting them in the header doesn't make sense

For the dbus interfaces, we don't have any reasources to clean up or memory to be released. Meaning we can drop those lines too
2023-08-05 20:22:18 +00:00
Alexander Lohnau
1631ada5b3 Simplify KDEConnectPlugin::recievePacket
- We do not need the return type. If a plugin declares it can handle the
  packet it should do so. We don't have any fallback logic in place and
  the packet types are namespaced with the plugin IDs anyway.

- Provide a default implementation with a warning, not all plugins need
  to overwrite this
2023-08-03 20:49:44 +02:00
Alexander Lohnau
75a8db1ec5 Use pragma once in plugins
For non-library code, this is simpler and more concise
2023-07-22 20:51:19 +00:00
Alexander Lohnau
e97af9dc15 Provide default implementation for KdeConnectPlugin::connected
In most plugins, we just provided a dummy implementation
2023-07-22 16:06:21 +02:00
Nicolas Fella
a918ffc0cb Add and make use of ECM's clang-format integration 2022-09-11 23:21:58 +00:00
Laurent Montel
6957b6aa39 GIT_SILENT: add missing override 2021-10-27 06:53:06 +02:00
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Antonio Larrosa
1d36164230 Use ecm_qt_declare_logging_category to declare the logging categories
This automatizes the generation of logging categories so a
kdeconnect-kde.categories is generated and installed to
/usr/share/qlogging-categories5/ so kdebugsettings can use it.

Also, sets the default logging level to Warning. So now the logs
of users won't be filled with debug messages but they can
modify the configuration easily with kdebugsettings.
2020-05-26 18:55:47 +02:00
Nicolas Fella
2725de9170 Improve call notification handling
Simplify the code, close the notification when talking.
2020-03-21 22:18:34 +01:00
Abdel-Rahman Abdel-Rahman
0240c43bb5 Make incoming call notification persistent
Accomplishes task T11851
2020-03-15 23:34:52 +02:00
Nicolas Fella
6025f7cc48 Remove usused includes 2020-01-20 22:35:37 +01:00
Nicolas Fella
b44c97bb79 Use default destructor 2019-06-13 15:24:13 +02:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Nicolas Fella
a4509d9640 Emit DBus signal when receiving a call 2019-02-17 02:41:42 +01:00
Simon Redman
64062b3cc9 [Desktop] SMS plugin no longer creates desktop notifications -- Old functionality still supported by notifications plugin
Summary:
Drop support for creating notifications from the SMS plugin. The old usecase is better handled by the notifications plugin reply box anyway

Rename packets defined in SMS plugin from PACKET_TYPE_TELEPHONY_* to PACKET_TYPE_SMS_*

Update TELEPHONY plugin packet description to point to SMS plugin

Define TELEPHONY_REQUEST_MUTE packet to replace old TELEPHONY_REQUEST with mute event field

Please see Android-side patch here: D15544

Test Plan:
I see four test cases, based on the version of the app being used, where "old" means any version built with sources not containing this revision and "new" means any version built with sources using this revision:
 - New Android vs. New Desktop
   - Supported and works for me
 - New Android vs. Old Desktop
   - Supported and works for me
 - Old Android vs. New Desktop
   - Not supported - Download a new app from the Play store or F-Droid
 - Old Android vs. Old Desktop
   - If this is broken, it is not my fault :)

In the supported use cases:
 - Test SMS reply
   - Receive SMS (or MMS!) message
   - Verify that the //notification// plugin forwards a replyable notification and that replying works
 - Test incoming call ringer mute
   - Enable ringer volume (not vibrate)
   - Receive phone call
   - Verify a desktop notification with a Mute button appears
   - Verify that clicking the mute button causes the phone to stop making the ringer noise (vibration not affected)

Reviewers: #kde_connect, albertvaka, nicolasfella

Reviewed By: #kde_connect, albertvaka, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15543
2018-09-16 16:06:53 -06:00
Simon Redman
bcc9fb06db Split SMS and Telephony plugin on desktop
Summary:
Telephony and SMS handling are quite distinct so they should be in separate plugins for better maintainability, given that @sredman has big plans with SMS.
This diff should be fully backwards compatible, but whether we really want to do that is up to discussion

Test Plan: Only supeficially tested. Receive an SMS (old way), Notification is shown

Reviewers: #kde_connect, sredman

Reviewed By: sredman

Subscribers: albertvaka, apol, sredman, kdeconnect, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D13594
2018-09-10 11:31:05 +02:00
Aleix Pol
31e93ef7bf (WIP) Upgrade Telephony plugin to read SMS history (KDE side)
Summary:
For real usecases of SMS support, we will almost always need access to the message history in some way

Specifically resolve T8338

Incidentally resolve T6651 since Telephony shall no longer create a notification

Test Plan:
Setup:
- Build corresponding Android-side diff (D11698)
- Build this diff

Step 1: Does anything at all work?
- Put a breakpoint in the handleBatchMessages method of the telephony plugin, ideally after constructing a Message object
- Use DBus to poke /modules/kdeconnect/devices/<deviceID>/telephony.requestAllConversations()
- Verify that the constructed Message is one you sent or received and that it is the most recent in the corresponding conversation

Step 2: DBus
- Open the Interface org.kde.kdeconnect.device.conversations of /modules/kdeconnect/devices/<deviceId>
- Poke activeConversations and verify an empty array is returned
- Poke requestAllConversationThreads
- Poke activeConversations and verify that a list of numbers has been returned. These are conversationIds
- Use a conversationId to call getFirstFromConversation
  - Verify that the returned Message object is one which you recognize
  - Note that if the message is an MMS it will be blank and meaningless. Try a different conversationId. MMS support "coming soon!"

Step 3: SMS App
- Use ccmake (or similar) to set SMSAPP_ENABLE to ON
- Build the project
- Run ./bin/kdeconnect-sms
- Verify that the app shows a list of everyone you have an SMS conversation with (MMS messages are stripped out)
  - If you have the Contacts plugin working, verify that most contacts have their name and photo instead of their phone number

Reviewers: #kde_connect, nicolasfella, apol

Reviewed By: #kde_connect, nicolasfella, apol

Subscribers: andyholmes, apol, nicolasfella, #kde_connect

Tags: #kde_connect

Maniphest Tasks: T8338, T6651

Differential Revision: https://phabricator.kde.org/D11854
2018-06-09 13:35:26 -06:00
Albert Vaca
f47f517827 Rename NetworkPackage -> NetworkPacket
Summary: KDE Connect, now with correct naming!

Test Plan: It still builds.

Reviewers: #kde_connect, apol, nicolasfella

Reviewed By: #kde_connect, apol, nicolasfella

Subscribers: nicolasfella

Differential Revision: https://phabricator.kde.org/D11036
2018-03-05 20:03:23 +01:00
Jean Vincent
72535ecf48 Make member variable names, & placement and * placement more coherent
Summary:
Change all member variables to the form m_fooBar because it is the preferred form in Qt (it was half and half between this and mFooBar, and a minority didn't have anything).
Place all references and pointers on the side of the type since it is the majority.

Basically:
 - mFoo -> m_foo
 - foo -> m_foo (if it is a member variable)
 - Type &ref -> Type& ref
 - Type *ptr -> Type* ptr

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, nicolasfella, albertvaka

Subscribers: albertvaka, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D7312
2017-09-03 21:45:08 +02:00
Aleix Pol
3734d6ce4d Reduce API exposed through dbus
Summary:
Don't use QDBusConnection::ExportAllContents
No need to make connect and receivedPackage public slots (they're are the
parent's already)

Fixes T4975

Test Plan: Rough manual test

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Maniphest Tasks: T4975

Differential Revision: https://phabricator.kde.org/D3871
2017-01-10 18:15:01 +01:00
Albert Vaca
60331ccbf1 Clazy says all this QStringLiteral and QLatin1String were missing/wrong 2016-11-26 16:21:29 +01:00
Aleix Pol
7d88340da7 Makes it possible to send sms from kdeconnect-cli
Summary: Introduces --send-sms and --destination

Test Plan: Sent an sms to Albert Vaca

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Differential Revision: https://phabricator.kde.org/D3252
2016-11-04 12:27:52 +01:00
Albert Vaca
9939b58df0 Merge telephonyplugin and telepathy plugin
We now use the telepathy interface when it's available, and fall back to
our custom dialog when it's not. This also makes the kdeconnect telepathy
connection manager be completely decoupled from the kdeconnect code.

CCMAIL: david@davidedmundson.co.uk
2016-06-22 14:27:09 +02:00
Aleix Pol
596e4484f4 Clean up use of virtual and override keywords
Only use virtual when actually virtual, to override just use override.
2016-06-20 19:22:29 +02:00
David Edmundson
d859495b1c Remove stray include 2016-06-19 01:04:39 +02:00
Aleix Pol
e6349524bc Move all Telepathy bits into a Telepathy plugin 2016-06-18 13:23:41 +02:00
Aleix Pol Gonzalez
a465577005 Move the Telepathy infrastructure at the plugin level
At the moment, telepathy integration needs to be compiled within the
daemon. This creates a rather aggressive dependency with Telepathy.

This plugin proposes to move into a plugin, so that if the plugin isn't
present, telepathy becomes out of the picture.

REVIEW: 128149
2016-06-18 11:54:38 +02:00
Albert Vaca
73f5996f14 Consistent naming of _REQUEST package type macros 2016-06-03 00:47:03 +02:00
Aleix Pol
e7578cc129 Refactor capabilities together with Albert
He is committing a similar patch to kdeconnect-android
2016-05-31 17:16:01 +02:00
David Edmundson
e4cbf22519 Telepathy integration
This sends recieved text messages to any Telepathy client and allows the
user to respond from there.
This should work with both our clients and Empathy.

An account on telepathy is created on activation.

As Telepathy clients expect backends to be always running, this is
started by the daemon to
suppress client errors. The plugin system then talks to the same CM via
use of a singleton accessor.

Based on work by Alexandr Akulich then tidied up and rebased.
2015-09-10 20:36:46 +02:00
Aleix Pol
817fcbc9d6 Merge branch 'stable' 2015-09-08 10:51:41 +02:00
Aleix Pol
d58f6314fe run Clang Modernize
Minus the auto change
2015-09-08 10:47:37 +02:00
Gaël Le Baccon
866fdfb33f Added a simple way to answer SMS messages from the notification 2015-09-08 01:12:01 -07:00
Albert Vaca
a3decd542c Includes cleanup 2015-03-13 21:20:58 -07:00
Albert Vaca
c7c1974ea9 Merge branch 'master' into frameworks
Conflicts:
	core/backends/lan/lanlinkprovider.cpp
	plugins/ping/pingplugin.h
	plugins/telephony/telephonyplugin.cpp
2015-01-10 20:14:01 -08:00
Mikhail Ivchenko
f6e7b04514 Added a button to incoming call notifications to mute the phone ringing.
REVIEW: 121854
2015-01-05 21:58:23 -08:00
Àlex Fiestas
3b5ab5e83f Port Telephony plugin from kDebug to qCDebug 2014-09-22 00:46:41 +02:00
Aleix Pol
741abafaf7 Move the plugins into a different top-ĺevel directory
Reviewed by Albert Vaca
2014-06-14 16:34:11 +02:00
Renamed from core/plugins/telephony/telephonyplugin.h (Browse further)