Changeset View
Changeset View
Standalone View
Standalone View
kioslave/desktop/kio_desktop.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 85 | if (desktopIsEmpty) { | |||
---|---|---|---|---|---|
92 | const auto dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kio_desktop/DesktopLinks"), QStandardPaths::LocateDirectory); | 92 | const auto dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kio_desktop/DesktopLinks"), QStandardPaths::LocateDirectory); | ||
93 | for (const auto &dir : dirs) { | 93 | for (const auto &dir : dirs) { | ||
94 | const auto fileNames = QDir(dir).entryList({QStringLiteral("*.desktop")}); | 94 | const auto fileNames = QDir(dir).entryList({QStringLiteral("*.desktop")}); | ||
95 | for (const auto &file : fileNames) { | 95 | for (const auto &file : fileNames) { | ||
96 | links += file; | 96 | links += file; | ||
97 | } | 97 | } | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | foreach (const QString &link, links) { | 100 | for (const QString &link : qAsConst(links)) { | ||
101 | const auto fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kio_desktop/DesktopLinks/%1").arg(link)); | 101 | const auto fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kio_desktop/DesktopLinks/%1").arg(link)); | ||
102 | KDesktopFile file(fullPath); | 102 | KDesktopFile file(fullPath); | ||
103 | if (!file.desktopGroup().readEntry("Hidden", false)) | 103 | if (!file.desktopGroup().readEntry("Hidden", false)) | ||
104 | QFile::copy(fullPath, QStringLiteral("%1/%2").arg(desktopPath, link)); | 104 | QFile::copy(fullPath, QStringLiteral("%1/%2").arg(desktopPath, link)); | ||
105 | } | 105 | } | ||
106 | } | 106 | } | ||
107 | #endif | 107 | #endif | ||
108 | } | 108 | } | ||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |