Changeset View
Changeset View
Standalone View
Standalone View
applets/icon/iconapplet.cpp
Show All 32 Lines | |||||
33 | #include <QMimeData> | 33 | #include <QMimeData> | ||
34 | #include <QMimeDatabase> | 34 | #include <QMimeDatabase> | ||
35 | #include <QProcess> | 35 | #include <QProcess> | ||
36 | 36 | | |||
37 | #include <KAuthorized> | 37 | #include <KAuthorized> | ||
38 | #include <KDesktopFile> | 38 | #include <KDesktopFile> | ||
39 | #include <KFileItemActions> | 39 | #include <KFileItemActions> | ||
40 | #include <KFileItemListProperties> | 40 | #include <KFileItemListProperties> | ||
41 | #include <KFileUtils> | ||||
41 | #include <KJobWidgets> | 42 | #include <KJobWidgets> | ||
42 | #include <KLocalizedString> | 43 | #include <KLocalizedString> | ||
43 | #include <KProtocolManager> | 44 | #include <KProtocolManager> | ||
44 | #include <KRun> | 45 | #include <KRun> | ||
45 | 46 | | |||
46 | #include <KIO/DropJob> | 47 | #include <KIO/DropJob> | ||
47 | #include <KIO/FavIconRequestJob> | 48 | #include <KIO/FavIconRequestJob> | ||
48 | #include <KIO/OpenFileManagerWindowJob> | 49 | #include <KIO/OpenFileManagerWindowJob> | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 111 | connect(statJob, &KIO::StatJob::finished, this, [=] { | |||
116 | } | 117 | } | ||
117 | 118 | | |||
118 | // We always want it to be a .desktop file (e.g. also for the "Type=Link" at the end) | 119 | // We always want it to be a .desktop file (e.g. also for the "Type=Link" at the end) | ||
119 | if (!desiredDesktopFileName.endsWith(QLatin1String(".desktop"))) { | 120 | if (!desiredDesktopFileName.endsWith(QLatin1String(".desktop"))) { | ||
120 | desiredDesktopFileName.append(QLatin1String(".desktop")); | 121 | desiredDesktopFileName.append(QLatin1String(".desktop")); | ||
121 | } | 122 | } | ||
122 | 123 | | |||
123 | QString backingDesktopFile = plasmaIconsFolderPath + QLatin1Char('/'); | 124 | QString backingDesktopFile = plasmaIconsFolderPath + QLatin1Char('/'); | ||
124 | // KIO::suggestName always appends a suffix, i.e. it expects that we already know the file already exists | 125 | // KFileUtils::suggestName always appends a suffix, i.e. it expects that we already know the file already exists | ||
125 | if (QFileInfo::exists(backingDesktopFile + desiredDesktopFileName)) { | 126 | if (QFileInfo::exists(backingDesktopFile + desiredDesktopFileName)) { | ||
126 | desiredDesktopFileName = KIO::suggestName(QUrl::fromLocalFile(plasmaIconsFolderPath), desiredDesktopFileName); | 127 | desiredDesktopFileName = KFileUtils::suggestName(QUrl::fromLocalFile(plasmaIconsFolderPath), desiredDesktopFileName); | ||
127 | } | 128 | } | ||
128 | backingDesktopFile.append(desiredDesktopFileName); | 129 | backingDesktopFile.append(desiredDesktopFileName); | ||
129 | 130 | | |||
130 | QString name; // ends up as "Name" in the .desktop file for "Link" files below | 131 | QString name; // ends up as "Name" in the .desktop file for "Link" files below | ||
131 | 132 | | |||
132 | const QUrl url = statJob->mostLocalUrl(); | 133 | const QUrl url = statJob->mostLocalUrl(); | ||
133 | if (url.isLocalFile()) { | 134 | if (url.isLocalFile()) { | ||
134 | const QString localUrlString = url.toLocalFile(); | 135 | const QString localUrlString = url.toLocalFile(); | ||
▲ Show 20 Lines • Show All 444 Lines • Show Last 20 Lines |