Commit graph

103 commits

Author SHA1 Message Date
Albert Vaca Cintora
144a60b58a Allow disabling clipboard auto-share and add option to share manually
Continues the work started in !396 by rebasing it onto latest master and
making the "send clipboard" button from the plasmoid invisible when
automatic syncing is enabled.
    
I didn't find a way to do the same in kdeconnect-indicator and
kdeconnect-app (why do we have 3 UIs???), so in those we always show the
option for now.
2023-06-07 19:48:25 +00:00
Albert Vaca Cintora
064ddfa3fe Refactor PairingHandler
We now have a single PairingHandler for all types of links.

The implementation now is more aligned with the one for Android.
2023-06-02 16:38:52 +00:00
Simon Redman
8cfa308140 Fix some Qt and KF5 deprecation warnings
## Summary

Fixes a few warnings about deprecated fields and methods.

## Test Plan

Things still seem to be basically working 🤷
2022-10-17 21:17:49 +00:00
Nicolas Fella
a918ffc0cb Add and make use of ECM's clang-format integration 2022-09-11 23:21:58 +00:00
Kareem Abduljaleel
186526c0bb [Photo Plugin] Make photo plugin use QUrl instead of a local path
This is a companion merge request for !476,

this way it can be accessed directly from QML's FileDialog
2022-09-02 17:32:01 +00:00
Adam Fontenot
e703b8b6b5 Only show paired, reachable devices in CLI with -a
The help text indicates that the -a flag for
kdeconnect-cli is supposed to list available devices,
i.e. devices that are both paired and reachable.

Prior to this change, devices are only filtered on
reachability when the flag is passed.

BUG: 442571
2022-07-06 03:50:31 -07:00
Weixuan Xiao
f1843cb492 Improve D-Bus implementation on macOS
Better patch to replace !218.

- Auto and quick detection of previous D-Bus instance;
- Remove private D-Bus compile definition, only use it on macOS without an existing D-Bus instance;
- Safe reboot after crashes because the indicator is not relating on the kdeconnectd to run a D-Bus session;
- Safe exit after clicking on `Quit` in the systray.


More details in commit logs:

Only enable private D-Bus on macOS because the other platforms do not
need them.
The app should be able to easily detect the session bus from the env
DBUS_LAUNCHD_SESSION_BUS_SOCKET from launchd through launchctl.
Because https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/dbus/dbus-sysdeps-unix.c#L4392
shows that it is the only probing method on macOS with launchd.

The D-Bus session bus can be easily found from launchd/launchctl
with DBUS_LAUNCHD_SESSION_BUS_SOCKET env. It can be an external one
(installed from HomeBrew) or an internal one (launched by a previous
instance followed by a crash).

The indicator helper on macOS can now automatically detect whether we can use a potentially
(with launchd/launchctl env set, or KDE Connect macOS
private_bus_address set) existed and usable session bus.
If previous bus is usable, just try to launch the kdeconnectd with us.
Otherwise, launch a private D-Bus daemon, export the launchd/launchctl
env, and run a kdeconnectd instance.

Everything works better and quicker now :)
2022-04-12 05:40:03 +00:00
Marco Rubin
ea661f7d44 Added missing endline 2021-02-05 18:09:56 +00:00
Florian Bruhin
469e18596f cli: Make it clearer that --share can share URLs 2020-12-02 15:43:09 +01:00
Piyush Aggarwal
b272ab86b3 lockdeviceplugin: make plugin useful through CLI by --lock and --unlock 2020-11-23 21:22:46 +00:00
Matthijs Tijink
9d503bc893 Fix passing multiple attachments to the CLI
Also updated the related zsh autocompletion.
2020-10-31 14:02:58 +00:00
Simon Redman
a1ebbdfc09 [CLI] Use ConversationsDbusInterface to avoid problems with using raw dbus 2020-10-10 22:11:05 +00:00
Aniket Kumar
706fc314fb Adding support to send attachments to the remote device. 2020-08-31 15:35:25 +05:30
Aniket Kumar
f778fc932c Updated kdeconnect-cli send-sms message to adapt sendSms interfce changes. This patch fixes the BUG: 425731 2020-08-28 11:53:50 +00:00
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Matthijs Tijink
c6f83e5c16 CLI improvements for Qt 5.14+
Qt 5.14 adds a "--help-all" option, so include it in the autocompletion.
Qt 5.14 also warns on multiple additions of the same option, which we
accidently did (KAboutData and we ourselves called it), so don't do
that.
Also fixes device autocompletion, which I accidently broke.
2020-01-07 20:49:03 +00:00
Jaidev Shriram
2abeb42a70 CLI Text Improvements 2019-12-21 23:37:29 +00:00
Matthijs Tijink
656dab4a3f Show a message when no device id's can be autocompleted in zsh 2019-09-13 21:43:15 +02:00
Matthijs Tijink
fb174b23e3 Make the cli's --photo option take arguments
Also update the related zsh autocompletion.
2019-09-13 16:11:16 +00:00
Nicolas Fella
c8c82e01a7 [cli] Warn user if specified device id doesn't exist 2019-09-10 16:09:06 +00:00
Nicolas Fella
01fa989786 Fix photo plugin cli 2019-09-10 16:08:53 +00:00
Nicolas Fella
0d7c504cf0 Rename DbusHelper => DBusHelper 2019-08-14 17:36:19 +02:00
Matthijs Tijink
d9b5a4ce91 Hide the "shell-device-autocompletion" option without deprecation 2019-07-19 20:11:49 +00:00
Nicolas Fella
e601755644 Force usage of QStringLiteral and port remaining offenders 2019-06-10 14:40:28 +00:00
Weixuan Xiao
5431073844 Add wrapper for macos dbus connection 2019-06-09 15:28:49 +00:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Albert Vaca Cintora
d72e4a1131 Fix build on CI for Windows 2019-03-14 12:37:16 +01:00
Matthijs Tijink
f5724f7e7c Add zsh device autocompletion helper 2019-03-13 19:58:28 +00:00
Nicolas Fella
399bed641f Fix sending keys via CLI 2019-03-10 12:59:31 +00:00
Nicolas Fella
dbccc641ed Add plugin for taking photos on remote device
Summary: This plugin sends a request for a photo to the connected device. The device then sends the photo back, currently via the SharePlugin.

Test Plan:
kdeconnect-cli --photo
Check for photo in Downlaods folder

Reviewers: #kde_connect, broulik, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: sredman, albertvaka, apol, ngraham, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D18140
2019-03-04 23:57:08 +01:00
Nicolas Fella
b7768ca29f Add context object 2019-02-28 14:18:47 +01:00
Nicolas Fella
6262c09de8 [cli] Show all reachable devices
Summary:
Devices that were reachable but not paired were not shown. This makes it impossible to initiate paring

BUG: 402088

Test Plan:
Have a unpaired device reachable. Without the patch kdeconnect-cli -l does not show it. With the patch it is shown

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17788
2018-12-25 01:38:17 +01:00
Billy Laws
86e5cd48a0 Suppoer sharing text from kdeconnect-cli
Summary:
Can be used with the share-text argument like
kdeconnect-cli -d adsjsakldsjsa --share-text "hello"

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17242
2018-12-07 18:06:44 +00:00
Erik Duisters
b6c15289f5 Combine multiple upload jobs into a single KCompositeJob so only 1 notification will be shown
Summary:
Combine multiple upload jobs for files into a single KCompositeJob so only 1 notification will be shown
Includes changes introduced in D16279

Test Plan:
1. Share of multiple files is performed using 1 composite job

   Setup:
	- Select multiple (big) files in dolphin and share with an Android device
   Result:
	- The files will be transferred using 1 CompositeUploadJob and showing only 1 notification

2. Share of file while another share is already running adds job to existing composite job

   Setup:
	- Select multiple (big) files in dolphin and share with an Android device
	- Share an additional file with the same Android device
   Result:
	- The files are all transferred using 1 CompositeUploadJob and showing only 1 notification
	- The notification is updated after adding the last file

3. Other packets are transmitted as usual

   Setup:
        - Setup sharing desktop notification with device
	- Share a big file with an Android device
	- Generate a desktop notification (eg. sending or receiving an email)

   Result:
	- Notification packet is send immediately

Reviewers: #kde_connect, nicolasfella, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, apol, nicolasfella, broulik, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17081
2018-11-30 08:26:00 +01:00
Nicolas Fella
bd17dc2041 Fix container detach warnings from clazy
Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17164
2018-11-26 13:21:39 +01:00
Nicolas Fella
7a4bdcc62d [cli] Allow sharing files and URLs together
Summary:
Depends on D15787

Restricting sharing multiple urls to files seems unnecessary to me.

Test Plan: kdeconnect-cli --share foo.txt google.com

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15788
2018-09-28 15:13:05 +02:00
Nicolas Fella
518251342c [cli] Always take working dir into account when parsing url
Summary:
Bug: 399115

When using kdeconnect-cli --share the first argument was not recognised as a file when a relative path was specified.

Test Plan:
kdeconnect-cli --share File1.txt File2.txt : Check that both files are sent
kdeconnect-cli --sahre phabricator.kde.org : Check that web page is opend

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15787
2018-09-28 15:12:29 +02:00
Thomas Surrel
5ae67e0feb [CLI] Unpair unreachable devices
Summary: You should be ableto unpair unreachable devices with the CLI

Reviewers: kdeconnect, albertvaka

Reviewed By: albertvaka

Subscribers: albertvaka

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15677
2018-09-24 15:59:08 +02: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
95dd01b818 Fix comment 2018-06-08 20:23:18 +02:00
Matthijs Tijink
cc072e4a2c Add more scripting helpers to cli command
Summary:
Adds "--name-only" and "--id-name-only", in addition to the already existing "--id-only".

This is useful for the zsh autocompletion which I've written.

Test Plan: The output is identical without the new flags.

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Differential Revision: https://phabricator.kde.org/D10875
2018-02-27 17:46:55 +01:00
Albert Vaca
3a955f0ced Allow sharing more than one file
Eg: --share *.mp3
2018-02-17 15:14:11 +01:00
Matthijs Tijink
6a6b97e7c9 Fix kdeconnect-cli device list
Summary:
Previously, the .devices() call passed the parameters in the wrong order. I checked the order in the interface and the daemon, and this was the only place it went wrong.

Now running `kdeconnect-cli -l` correctly lists all paired devices, even if unreachable.

Test Plan: Tested with both a reachable and unreachable device.

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol

Differential Revision: https://phabricator.kde.org/D9060
2017-12-03 19:29:05 +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
Jean Vincent
c864267f04 Replace Q_FOREACH with C++11 range-for
Summary:
The use of Q_FOREACH is advised against (https://doc.qt.io/qt-5/qtglobal.html#Q_FOREACH) since Qt 5.7 and will eventually be removed from Qt.

I replaced all occurrences with the range-for loop introduced in C++11 (except for the one in daemon.cpp in deviceIdByName which might have a bug / typo in it).

I added const to the container or casted it with qAsConst when appropriate to avoid unnecessary copies.

(This is my first submission. I did all the unit tests, and they all passed but I don't know how to show it here.)

Reviewers: #kde_connect, nicolasfella, apol

Reviewed By: #kde_connect, nicolasfella, apol

Subscribers: albertvaka, apol, nicolasfella

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D6724
2017-07-21 09:57:19 +02:00
Aleix Pol
077bed106f Introduce a URL handler and offer handling tel:/// urls
Summary: Makes it possible to handle tel urls with any KDE Connect device

Test Plan: Manual testing

Reviewers: #kde_connect, albertvaka, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella

Differential Revision: https://phabricator.kde.org/D6120
2017-06-09 13:42:16 +02:00
Albert Vaca
7cc39aada8 Added an option to the cli to return your own device id 2017-02-24 22:37:22 +01:00
Aleix Pol
339ce7beea Improve how we deal with dbus errors from the cli
Summary: Always use pending calls and centralize dbus error management

Reviewers: #kde_connect, albertvaka

Differential Revision: https://phabricator.kde.org/D4206
2017-01-24 20:08:33 +01:00
Holger Kaelberer
30cffbd96e Add remotekeyboard plugin
BUG: 370919
REVIEW: 129727
2017-01-23 09:08:27 +01:00
Aleix Pol
a164983b6f Revert "kdeconnect-kde: Add remotekeyboard plugin"
This reverts commit 040ad7357b.

Sorry, didn't mean to push that myself ^^'
2017-01-11 17:20:22 +01:00