Bug 381566 - kio_desktop uses deprecated QDesktopServices method and fails to build
Summary: kio_desktop uses deprecated QDesktopServices method and fails to build
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.10.2
Platform: Compiled Sources Linux
: NOR major
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 09:49 UTC by RJVB
Modified: 2017-07-03 14:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
possible fix (1.25 KB, text/plain)
2017-06-23 09:49 UTC, RJVB
Details
simpler fix (1.21 KB, patch)
2017-06-27 13:21 UTC, RJVB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2017-06-23 09:49:29 UTC
Created attachment 106258 [details]
possible fix

kio_desktop from the plasma-workspace project uses QDesktopServices::storageLocation() which is long deprecated. Using it under Qt 5.8.0 with GCC 7.1.0 raises an error for me.
Comment 1 David Edmundson 2017-06-26 22:09:11 UTC
Read the comment in the code next to where you edited it.
Comment 2 David Edmundson 2017-06-26 22:18:27 UTC
Oh, sorry. I left the tab open and on second glance realise you did address that.

The problem with your approach is it's perfectly valid to set the xdg-user-dirs desktop to /home/me   the patch will always append "/desktop".
Comment 3 David Edmundson 2017-06-26 22:41:37 UTC
3rd time lucky.

QDesktopServices::storageLocationImpl
just returns writableLocation(QStandardPaths::DesktopLocation) with no changes, so worst case it's exactly the same as before.

Also from my reading of qstandardpaths_unix it doesn't check the directory exists at all; so we don't need the if (path ==home()) check.
Comment 4 RJVB 2017-06-27 13:21:28 UTC
Created attachment 106340 [details]
simpler fix

You mean like this?
Comment 5 David Edmundson 2017-07-02 17:15:40 UTC
Ship it.
Comment 6 RJVB 2017-07-03 14:23:28 UTC
Git commit a5a18f5ac709d03c63902b0e3c1d6b362b1551fa by René J.V. Bertin.
Committed on 03/07/2017 at 14:23.
Pushed by rjvbb into branch 'master'.

kio_desktop: don't use QDesktopServices::storageLocation

The method is deprecated and using it can generate build failures (e.g.
with Qt 5.8+ and GCC 7.1+).

M  +3    -6    kioslave/desktop/kio_desktop.cpp

https://commits.kde.org/plasma-workspace/a5a18f5ac709d03c63902b0e3c1d6b362b1551fa