Commit graph

49 commits

Author SHA1 Message Date
Nicolas Fella
283d014059 Use a compositejob for receiving files 2019-06-02 14:02:21 +00:00
Nicolas Fella
a787b692f6 [FileTransferJob] Set file amount
Summary: This tells the new notification system that we're copying a file and lets it show a better summary.

Test Plan:
{F6821356}
Is the composite job stuff already merged? That probably needs adjusting too

Reviewers: #plasma, nicolasfella

Reviewed By: nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D21182
2019-05-13 12:50:07 +02:00
Nicolas Fella
0692295ae7 s/Q_NULLPTR/nullptr/ 2019-05-05 15:45:50 +02:00
Erik Duisters
6fb67d0261 Delete partially downloaded file when transfer is canceled locally 2019-05-03 17:34:17 +02:00
Nicolas Fella
3b8fedea1a Replace http GNU urls with https 2019-03-23 17:29:26 +01:00
Albert Vaca Cintora
10c370cc51 More useful error text
This helped me figure out the error in the test
2019-02-13 00:11:03 +01:00
Nicolas Fella
ded463eb49 [clazy] Properly emit signals
Test Plan: Receive a file

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17166
2018-11-26 13:25:16 +01:00
Erik Duisters
7cb4de20c1 Test if file was received completely if not delete the partial file
Summary: If the number of bytes received != m_size report failure and delete the partial file

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16778
2018-11-10 11:41:39 +01:00
Matthijs Tijink
7cab490cc5 Fix receiving payloads using a bluetooth connection
Summary:
This fixes receiving payloads using the bluetooth backend.

This looks like some bug in Qt, but I couldn't figure out what happens exactly (will report a bug though).

Test Plan: Receiving files now works!

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: kdeconnect, nicolasfella, apol, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12153
2018-10-04 19:05:34 +02:00
Albert Vaca
84bba9429f Merge branch 'master' into 1.x
# Conflicts:
#	core/backends/lan/downloadjob.cpp
#	core/backends/lan/downloadjob.h
#	core/filetransferjob.cpp
#	core/filetransferjob.h
#	plugins/notifications/sendreplydialog.cpp
#	plugins/notifications/sendreplydialog.h
#	plugins/telephony/sendsmsdialog.cpp
#	plugins/telephony/sendsmsdialog.h
2017-09-03 22:05:54 +02: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
364ab02aad set total amount later
Otherwise the kwidgetjobtracker wouldn't notice it and it wouldn't be
reported properly.
2017-08-02 01:48:37 +02:00
Albert Astals Cid
d1d84bc464 Fix DownloadJob not finishing
We stop using a buffer so it's less memory intensive and allows for larger files to be sent.

With current KIO has CPU usage issues, there's a patch in review that fixes them.

BUGS: 378488
2017-08-02 00:39:19 +02:00
Albert Vaca
88e43ada1e Fix rounding 2017-08-01 23:18:15 +02:00
Aleix Pol
2b17d89fc1 Revert "No need to use a QBuffer in DownloadJob"
We need to wait for KF5 release, I didn't mean to commit it

This reverts commit af778b71b1.
2017-08-01 22:46:38 +02:00
Aleix Pol
d61d52ac1f Fix reported file transfer speed
Don't mix milliseconds and seconds
Start calculating in the beginning
Output the requested file size
2017-08-01 22:45:28 +02:00
Albert Astals Cid
af778b71b1 No need to use a QBuffer in DownloadJob
Summary:
QSslSocket is already a QIODevice so just use that.

Should fix the issue of transfering *big* files.

Unfortunately this seems to trigger a bug in KIO and CPU usage goes through the roof, so haven't really been able to test it does actually fix things.

Please don't merge/approve yet

Reviewers: apol, albertvaka, kdeconnect

Subscribers: #kde_connect

Differential Revision: https://phabricator.kde.org/D6039
2017-08-01 21:03:55 +02:00
Albert Vaca
60331ccbf1 Clazy says all this QStringLiteral and QLatin1String were missing/wrong 2016-11-26 16:21:29 +01:00
Kai Uwe Broulik
77ad9336b6 [FileTransferJob] Fix division by null and use elapsed timer
When sending multiple files from my phone to my PC, kdeconnectd usually received a SIGFPE.
To get the transfer speed it divides the number of bytes received by the elapsed time which can be zero.

Also, since we're only interested in the time that has elapsed, use QElapsedTimer,
which is exactly for this. QTime::elapsed() also needs to take into account potentially
ocurred timezone or DST changes.

REVIEW: 128861
2016-09-10 22:52:03 +02:00
Aleix Pol
5a265a55de Start consuming right away, if there's data available from the start
Fixes sendfiletest
2016-07-05 13:14:47 +02:00
Aleix Pol
ef98fb4587 Fix file transfer under SSL
Introduces a big fat buffer :(
Actually test the trasfers :)
Takes QSslSocket causistic into account, for some reason QNAM refuses to
mark as finished when the QSslSocket (through QIODevice) closes.
It would be good to look into dropping the QBuffer, doing so with the test
in place will help.
2016-06-22 17:49:45 +02:00
Aleix Pol
f011191eca Fix few issues in FileTransferJob
Handle errors from different endpoints
Don't ::startTransfer when we find a colliding file
2016-06-22 12:42:51 +02: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
b62349cae6 Merge branch 'stable' 2015-09-11 17:03:57 +02:00
Aleix Pol
9fedfcdb3d Notify QNAM about the file received size 2015-09-11 17:03:11 +02:00
Aleix Pol
ca4a81b8e8 Merge branch 'stable' 2015-09-11 12:24:15 +02:00
Aleix Pol
2b8a54357e Remove redundant copy constructor 2015-09-11 12:22:59 +02:00
Aleix Pol
f65a1f206f Turn core qWarnings into qCWarning 2015-09-07 19:35:07 +02: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
Aleix Pol
11996f56ca Drop dependency of KIO from kdeconnectcore
Use QNetworkAccessManager for storing the files we receive instead of
directly KIO, then provide the KIO-based QNetworkAccessManager from the
daemon. This way we'll still get the KIO network-transparency, but the
library only depenends on QtNetwork, which will be easier to get in some
platforms.

After this change, we only depend on KConfig, KI18n and KCoreAddons, which
are tier1 and really easy to work with on any platform.

REVIEW: 123325
2015-05-05 01:07:29 +02:00
Albert Vaca
07773b8141 disconnected is specific to Sockets, abouTtoClose is generic to IODevice 2015-04-04 19:04:11 -07:00
Albert Vaca
6c6f2b1a03 Fixed uninitialized members 2015-04-04 10:17:08 -07:00
Aleix Pol
ede7dd0e84 Drop KIOWidgets dependency from KDEConnectCore
Removes the usage of RenameDialog by moving the functionality away. In
fact, what it does is make the share dialog try to come up with a different
name rather than asking the user. It's a quite common procedure as makes
the interaction simpler (for example, Chromium and Kamoso work like that).

REVIEW: 122813
2015-03-09 13:22:10 +01:00
Aleix Pol
b06038e60e Prefer the usage of QUrl::toLocalFile to QUrl::path
QUrl::toLocalFile is portable.
2015-03-04 22:33:54 +01:00
Lamarque V. Souza
00ef52227e Fixes file transfer for Samsung Galaxy S2 with Jelly Bean 4.1.2
by setting destination QUrl's scheme if it lacks one.

REVIEW: 122221
2015-01-23 14:11:48 -02:00
Albert Vaca
6cc6d287fc Merge branch 'master' into frameworks
Conflicts:
	cli/kdeconnect-cli.cpp
	core/filetransferjob.cpp
	core/filetransferjob.h
	interfaces/notificationsmodel.cpp
	plasmoid/declarativeplugin/kdeconnectdeclarativeplugin.h
	plugins/sftp/sftpplugin.cpp
2015-01-20 22:44:31 -08:00
Albert Vaca
da1cb4c354 Coding style 2015-01-20 22:22:14 -08:00
Albert Vaca
a58fab4fb3 Merge branch 'master' into frameworks
Conflicts:
	cli/kdeconnect-cli.cpp
	core/device.cpp
	core/filetransferjob.cpp
	core/filetransferjob.h
	core/networkpackage.h
	kded/CMakeLists.txt
	plugins/share/shareplugin.cpp
	plugins/telephony/telephonyplugin.cpp
2014-11-11 21:40:54 -08:00
Jens Dagerbo
53a33096ad Changed int to qint64 for tracking payload size
No longer keeping the entire file in RAM while uploading
2014-11-09 12:57:09 -08:00
Aleix Pol
21ab5a4f81 Merge branch 'master' into frameworks
Mostly kDebug -> qCDebug
Also some KCmdLineArgs -> QCommandLineParser

Conflicts:
	cli/kdeconnect-cli.cpp
	core/CMakeLists.txt
	core/backends/lan/lanlinkprovider.cpp
	core/daemon.cpp
	core/pluginloader.cpp
	interfaces/CMakeLists.txt
	kio/kiokdeconnect.cpp
	plugins/mousepad/CMakeLists.txt
	plugins/mousepad/mousepadplugin.h
	plugins/mpriscontrol/mpriscontrolplugin.cpp
	plugins/sftp/sftpplugin.cpp
2014-11-04 19:12:29 +01:00
Albert Vaca
279dbe5598 Minor changes 2014-10-10 11:47:35 -07:00
Àlex Fiestas
d971269bd5 Remove kdebugnamespace completely and replace by core_debug
In those places that belong to "core" we use core_debug, in any other
place we have added custom logging categories so we use those instead.
2014-09-22 00:59:34 +02:00
Àlex Fiestas
df0c262998 Port core to qCDebug
I had to keep the old kDebug code in kdebugnamespace because other parts
of the code are using it. Will be removed as soon as all code using it
is ported as well.
2014-09-21 23:54:27 +02:00
Àlex Fiestas
473a34b76f Por filetranasferjob to QUrl
Pretty much a straight forward port from KUrl to QUrl, since we are only
forwarding arguments there was not much to port but a simple /kurl/qurl/
2014-09-21 22:22:06 +02:00
Albert Vaca
a303b73238 Merge branch 'master' into frameworks
Conflicts:
	cli/kdeconnect-cli.cpp
	core/CMakeLists.txt
	plasmoid/package/contents/ui/FullRepresentation.qml
	plugins/ping/pingplugin.cpp
2014-07-01 23:59:38 +02:00
Albert Vaca
cabb0f2f7b Simplified debug areas so we only have one, called "kdeconnect" 2014-07-01 01:26:08 +02:00
Aleix Pol
a1a560c469 First approach to a KF5 port of KDE Connect
Ported using KDELibs4Support, for a smaller delta, so we can keep
developing on master until we decide not to.

At the moment, it builds and installs but tests don't pass because
of a QCA2 initialization problem I didn't manage to debug yet.

CCMAIL: kdeconnect@kde.org
2014-06-16 20:02:07 +02:00
Aleix Pol
b88897847b Reorganize sources
We broke kded into core and kded, core contains the library with the backends
and plugins.
Also we renamed libkdeconnect to interfaces.
2014-06-14 15:22:40 +02:00
Renamed from kded/filetransferjob.cpp (Browse further)