Show progress when sending a file from the desktop
BUG: 355044
nicolasfella |
KDE Connect |
Show progress when sending a file from the desktop
BUG: 355044
Complete transfer:
-Right click on a big file in dolphin
-Select Send to xx via KDE Connect
-Open the Notifications widget and verify progress is shown correctly
Stop transfer:
-Right click on a big file in dolphin
-Select Send to xx via KDE Connect
-Open The Notifications widget and press the stop/kill button
-Observe that the file upload is stopped
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Great work!
I have a few cosmetic suggestions: Instead of saying "Sending file over KDE Connect" I'd say "Sending file to <devicename>". Then the second line should be the filename. The Jobtracker seems to pick that automatically from the info. If you remove the "To" line from the info the filename is shown as secon line. Don't ask me how exactly this works. The end result is:
A few code nitpicks:
You should remove the commented code and debug output.
Please follow the coding style from the rest of the file. Opening { for methods go on the next line, for everything inside methods on the same line. I'll leave a few more comments as inline comments
core/backends/lan/uploadjob.cpp | ||
---|---|---|
61 | Use Daemon::instance()->getDevice(this->m_deviceId)->name() directly and remove m_deviceName | |
118 | Looks like too much indentation to me |
Don't ask me how exactly this works.
Magic.
text: { var label = labelFileName1 || labelFileName0; var lastSlashIdx = label.lastIndexOf("/"); return label.slice(lastSlashIdx + 1); }
"To" being label 1 taking precedence over "From being label 0 :)
core/backends/lan/uploadjob.cpp | ||
---|---|---|
42 | If this is a workaround, explain it here for the day when someone has the idea to remove it. | |
59 | Use emit description(.... It helps when reading the code, to see it's actually a signal. | |
91 | Why are you checking for validity? Are you trying to do isActive? | |
113 | Is it really necessary to disconnect? the socket shouldn't be working anymore. | |
122 | Wrong indentation. | |
182 | Emit after everything is wrapped up. Otherwise things could happen right there. |
core/backends/lan/uploadjob.cpp | ||
---|---|---|
59 | I'm added Q_EMIT because the project has QT_NO_KEYWORDS defined see CMakeLists.txt line 34 | |
91 | That's the way it's done in filetranferjob.cpp | |
113 | After stopping a transfer on desktop notification encryptedBytesWritten() is still called 1x. |
Weird. When I transfer a large file (1.8Gb) the the progress bar in the notification applet progress is way too slow and stalls at ~90 Mb. When I kill kuiserver then a window with a progress bar appears that works just fine.