Commit graph

75 commits

Author SHA1 Message Date
Kai Uwe Broulik
daa6f7fc14 Clean up FileTransferJob description
* Set magic `destUrl` property to let it know the job destination in case of
  multiple files being transferred
* Set a normal "Receiving File(s)" title like we do with "Copying" title
* Set device name and destination path as details
2021-01-31 22:22:36 +01:00
Nicolas Fella
400c800deb [app] Add plugin settings page
Include a page that allows (de)selecting and configuring plugins

This is one of the last missing pieces for feature parity with the KCM.
2020-09-08 20:33:20 +02:00
Nicolas Fella
87db95b22f Convert license headers to SPDX expressions 2020-08-17 09:48:10 +00:00
Nicolas Fella
dda590186e Port away from KMimeTypeTrader
It is about to be deprecated

See https://phabricator.kde.org/T12177
2020-08-12 01:34:18 +02: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
Aniket Kumar
ec7519c1ef Update shareplugin.cpp: added code snippet to check the open condition of the received network package and to act accordingly. 2020-02-16 16:31:14 +00:00
Peter Mello
bc3c7567a7 Port away from deprecated KIO/KCM functions
Updated plugins/share/shareplugin.cpp:
 - KFileUtils::suggestName() is a drop-in replacement as of 5.64,
   just moved to another library
Updated plugins/findthisdevice/findthisdevice_config.cpp:
 - KCModule::markAsChanged() is likewise as of 5.64

Signed-off-by: Peter J. Mello <admin@petermello.net>
2019-12-20 00:23:49 +00:00
Richard Liebscher
ba34672cbd Make build for SailfishConnect possible 2019-12-09 22:14:19 +00:00
Nicolas Fella
9afa6b6d91 Revert "Port deprecated method"
This requires a newer KF5 version than the current minimum.

This reverts commit e933ae5450.
2019-12-06 23:14:19 +01:00
Laurent Montel
e933ae5450 Port deprecated method 2019-12-06 13:33:13 +01:00
Nicolas Fella
4c95bbdc21 Show error if user tries to share a nonexistant file 2019-07-17 21:06:58 +00:00
Nicolas Fella
8406e0de99 Merge internal openUrl with internal openFile 2019-06-17 21:35:53 +00:00
Nicolas Fella
5c16bfda5d Use K_PLUGIN_CLASS_WITH_JSON 2019-06-12 22:16:54 +02:00
Nicolas Fella
e601755644 Force usage of QStringLiteral and port remaining offenders 2019-06-10 14:40:28 +00:00
Nicolas Fella
283d014059 Use a compositejob for receiving files 2019-06-02 14:02:21 +00:00
Nicolas Fella
3ad3e3e788 Simplify code in setDateModified 2019-05-19 17:13:07 +00:00
Piyush Aggarwal
98bd91bf1c set last modified time for files received in Android-> PC transfers 2019-05-11 19:52:00 +00:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Nicolas Fella
491e38aa91 Use ref 2019-02-28 14:21:29 +01:00
Nicolas Fella
47749792f3 Respect users prefered text editor for shared text
Summary:
A user may have Kate installed but another editor set as default for text/plain. Respect that.

Also add .txt extension to the temp file name to make mime-type detection easier.

BUG: 399174

Test Plan:
Set default text editor to Kate -> Text opens in Kate
Set default text editor to Atom -> Text opens in Atom

Reviewers: #kde_connect, broulik, apol

Reviewed By: #kde_connect, broulik, apol

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15813
2019-02-09 00:00:01 +01: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
Erik Duisters
538872ddc8 Handle receiving empty file from Android
Summary: When a file share is received the share plugin  does not detect that an empty file is being shared

Test Plan:
Send an empty file from android
The empty file should be created

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17175
2018-11-28 15:50:06 +01:00
Nicolas Fella
ccd476c150 Add open on remote device (Desktop)
Summary:
Add openFile to Share Plugin and extend handler to open local file urls

Future extension: Modify the desktop file to allow Open with > Open on connected device

Depends on D16605

Test Plan: Apply Android patch. Use kdeconnect-handler file:///somefile. Check phone for reaction

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: sredman, kdeconnect

Tags: #kde_connect

Maniphest Tasks: T8637

Differential Revision: https://phabricator.kde.org/D15294
2018-11-04 19:55:30 +01:00
Billy Laws
0b72150ed8 Add support for sharing text via qml
Summary: This allows you to send a text string from qml, this can be used in the plasmoid and qml app.

Reviewers: nicolasfella

Reviewed By: nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16640
2018-11-03 22:23:03 +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
Aleix Pol
214950b3bb Make sure there's not a path within the filename
Reviewers: #kde_connect, aacid, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka

Differential Revision: https://phabricator.kde.org/D8106
2017-10-07 13:52:26 +02:00
Aleix Pol
28f11bd5c9 Fix receiving files with invalid URL characters
Summary:
QUrl constructor assumes the string passed is already encoded so we need
to pass it through setPath and QUrl::DecodedMode.

Test Plan: sent a file with a weird character

Reviewers: #kde_connect, jeanv

Reviewed By: jeanv

Differential Revision: https://phabricator.kde.org/D7224
2017-08-11 02:31:09 +02:00
Albert Vaca
36c2e15fc7 Check if there was an error before emitting shareReceived.
And change shareReceived arg from QUrl to QString so it works on DBus
2017-08-01 23:59:38 +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
Aleix Pol
e8303af92d Don't expose too many things on dbus for the share plugin 2016-11-30 16:02:06 +01:00
Albert Vaca
d71d3090d2 Removed unused file. 2016-11-26 16:21:30 +01:00
Albert Vaca
60331ccbf1 Clazy says all this QStringLiteral and QLatin1String were missing/wrong 2016-11-26 16:21:29 +01:00
Albert Vaca
a1340c8042 Fixed old style connects with clazy 2016-11-26 15:14:19 +01:00
Albert Vaca
5933c6810c More unused includes cleanup 2016-07-05 14:27:53 +02:00
Albert Vaca
73f5996f14 Consistent naming of _REQUEST package type macros 2016-06-03 00:47:03 +02:00
Aleix Pol
42110549f4 Improve SharePlugin share notification method
Make the share received notification explicitly internal.
Fix runtime warning about how QUrl cannot be exported.
Notify about all shares, not exclusively transferred files.
2015-12-07 03:27:40 +01:00
Aleix Pol
0bca50af93 Merge branch '0.9' 2015-10-19 17:48:13 +02:00
Albert Vaca
4574aa3639 Make the origin also contain the file name, not only the device name 2015-10-17 13:32:57 -07:00
Aleix Pol
d835d01a09 Add a test for file sending, using the loopback device
Extends unit testing by making sure that file sharing works locally.

REVIEW: 125086
2015-09-07 15:03:04 +02:00
Albert Vaca
2f7e6f7de2 Fixed compilation warnings in clang (one of them is actually an issue!) 2015-04-19 22:50:12 -07:00
Lukáš Tinkl
e553d97732 fix possibly localized destination dir
construct the whole QUrl from a local file, not just the default;
entries returned from QStandardPaths are translated on systems with a non
US locale, and this turned the string such as "~/Stažené" into its decoded
form, preventing the transfer from happening
2015-04-15 17:45:54 +02:00
Albert Vaca
2e58f34e1d Ops. 2015-04-11 23:26:52 -07:00
Albert Vaca
890e54cd4b Removed notification because KIO already provides one. 2015-04-04 17:20:51 -07:00
Aleix Pol
9379cc34f7 Check if file exists or not, and then call suggestName.
KIO::suggestName does not checks if file with passed name exists or not. So, we need to check it

REVIEW: 123225
2015-04-02 14:48:50 +02:00
Aleix Pol
15f87cc46d Port to KIO::suggestName
Removes the duplicated code.

REVIEW: 123215
2015-04-01 23:32:35 +02:00
Aleix Pol
491b1ed25b Don't treat local paths as Url's
It could have been fixed by changing QUrl(dir) into QUrl::fromLocalFile(dir)
but this way we get to have a non-local destinationDir.

CCMAIL: bansal.ashish096@gmail.com
2015-04-01 16:16:03 +02:00
Ashish Bansal
5322bf45cb Show Transfer failed instead of Transfer finished when it fails.
REVIEW: 123199
2015-03-31 20:05:58 -07:00
Aleix Pol
ccf03f16d1 Merge branch 'frameworks' to master
The last version using qt/kde4 was moved into the kde4 branch.

CCMAIL: kdeconnect@kde.org
2015-03-19 17:23:27 +01:00
Aleix Pol
c7cee37330 Port away from KServiceTrader
Uses KPluginLoader+KPluginMetadata instead.
Describes plugins in json instead of desktop files. These desktop files are
then embedded into the .so file. All the plugins will be in a kdeconnect/
directory, and those will be the ones to look for.

Note it doesn't drop the KService dependency as KIOCore is a KDE Connect
dependency as well.

REVIEW: 123042
2015-03-19 16:36:53 +01:00
Albert Vaca
02a2990720 Added a baseclass for the plugins' KCMs and a class for the plugins' config
Centralizing the plugins' config will ensure that all the plugins store it
the same way (ie: not in random files scattered around, like until now).
The base KCM class, together with the already existing base plugin class,
will give easy access to all the plugins to this centralized config. Also,
now the settings are not shared across devices (that is: every device can
have different config for a same plugin).

Note: This commit requires KCMUtils 5.9

REVIEW: 122927
2015-03-13 21:22:21 -07:00