Commit graph

25 commits

Author SHA1 Message Date
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
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
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Matthijs Tijink
33c2a100b1 Support file url album art - Desktop
Summary: If the android code sees a file url, and album art is needed, it will start a request to transfer the album art. This code does some sanity checks to prevent abuse and then transfers the album art.

Test Plan: Art is transferred succesfully.

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: nicolasfella, albertvaka

Differential Revision: https://phabricator.kde.org/D11017
2018-03-25 13:45:01 +02:00
Friedrich W. H. Kossebau
72fc67ee05 MPRIS control: do not accumulate interface objects
Summary:
If MPRIS players were appearing and disappearing multiple times, the
OrgFreedesktopDBusPropertiesInterface & OrgMprisMediaPlayer2PlayerInterface
instances created for listening to the signals had been accumulating and
thus resulting in X signals per X restarted player, because the instances
were not deleted when a player disappeared.
Additionally were instances of them created on the fly on the stack in
some of the methods, instead of reusing the existing ones.

This patch changes that by introducing a class MprisPlayer which holds all
data & instances per player. This allows to look up the respective
interfaces instances to reuse them as well as properly controlling their
lifetime.

Test Plan:
Starting and restarting multiple MPRIS players (incl. multiple instances of
the same player app) works as expected as befire. They are listed on the
Android Media control as well as have proper states there when selected.
Additionally no longer multiple change signals are emitted if restarting a
player.

Reviewers: #kde_connect, mtijink

Reviewed By: #kde_connect, mtijink

Subscribers: mtijink

Differential Revision: https://phabricator.kde.org/D11389
2018-03-16 23:53:40 +01: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
Matthijs Tijink
71d8eb07c3 Add title, artist and album to MPRIS network packets
Summary: This diff adds the title, artist and album to the MPRIS network packets. That's useful when you need more detail than just "artist - title", for example in the future media control notification. It also fixes weird song descriptions for empty artist strings (e.g. Spotify uses an empty (but present) artist when playing ads)

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: nicolasfella, apol

Differential Revision: https://phabricator.kde.org/D8957
2017-12-30 12:21:57 +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
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
Aleix Pol
8805fed666 mpriscontrol doesn't send requests 2016-06-01 01:14:20 +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 Kahles
337dd191e4 Fix mpris player discovery
The previous used QDbusServiceWatcher doesn't work as it does only watch out
for specific services, but the players use different, unpredictable names, so
we need to check all service registrations for mpris players.

BUG: 361367
REVIEW: 127611
2016-04-08 01:22:22 +02:00
David Edmundson
d621000621 Watch all serivies with the watcher
media player services are not registered as org.mpris.MediaPlayer2 just
use a service name that starts with that. We need to watch all services
and then filter.

BUG: 352529
Reviewed-by: Albert Vaca
2015-09-11 11:27:35 +02:00
Aleix Pol
d58f6314fe run Clang Modernize
Minus the auto change
2015-09-08 10:47:37 +02:00
Aleix Pol
d7e06c5fb2 Fix warning, don't use discouraged API
We used to have the following warning: "Connecting to deprecated signal
QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)"

Port away from it as recommended in Qt documentation.

REVIEW: 123637
2015-05-05 01:40:34 +02: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
Tomáš Zelina
0782682f7b Implemented current/total time and progress slider in MPRIS plugin
CCMAIL: zelitomas@gmail.com.
2014-12-13 14:43:09 -08:00
Àlex Fiestas
1e9df65d50 Port mpris from kDebug to qCDebug 2014-09-22 00:44:47 +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/mpriscontrol/mpriscontrolplugin.h (Browse further)