Changeset View
Changeset View
Standalone View
Standalone View
src/core/krecentdocument.cpp
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 66 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { | |||
---|---|---|---|---|---|
81 | } | 81 | } | ||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | return fullList; | 84 | return fullList; | ||
85 | } | 85 | } | ||
86 | 86 | | |||
87 | void KRecentDocument::add(const QUrl &url) | 87 | void KRecentDocument::add(const QUrl &url) | ||
88 | { | 88 | { | ||
89 | KRecentDocument::add(url, QCoreApplication::applicationName()); | 89 | // desktopFileName is in QGuiApplication but we're in KIO Core here | ||
90 | QString desktopEntryName = QCoreApplication::instance()->property("desktopFileName").toString(); | ||||
91 | if (desktopEntryName.isEmpty()) { | ||||
92 | desktopEntryName = QCoreApplication::applicationName(); | ||||
93 | } | ||||
94 | KRecentDocument::add(url, desktopEntryName); | ||||
90 | // ### componentName might not match the service filename... | 95 | // ### componentName might not match the service filename... | ||
91 | } | 96 | } | ||
92 | 97 | | |||
93 | void KRecentDocument::add(const QUrl &url, const QString &desktopEntryName) | 98 | void KRecentDocument::add(const QUrl &url, const QString &desktopEntryName) | ||
94 | { | 99 | { | ||
95 | if (url.isLocalFile() && url.toLocalFile().startsWith(QDir::tempPath())) { | 100 | if (url.isLocalFile() && url.toLocalFile().startsWith(QDir::tempPath())) { | ||
96 | return; // inside tmp resource, do not save | 101 | return; // inside tmp resource, do not save | ||
97 | } | 102 | } | ||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |