diff --git a/3rdparty/ext_frameworks/kservice.diff b/3rdparty/ext_frameworks/kservice.diff index d2099abfc..a08e471cc 100644 --- a/3rdparty/ext_frameworks/kservice.diff +++ b/3rdparty/ext_frameworks/kservice.diff @@ -1,16 +1,72 @@ +diff -Npru kservice-5.51.0.orig/src/sycoca/kbuildservicefactory.cpp kservice-5.51.0/src/sycoca/kbuildservicefactory.cpp +--- kservice-5.51.0.orig/src/sycoca/kbuildservicefactory.cpp 2018-10-08 10:21:25.000000000 +0200 ++++ kservice-5.51.0/src/sycoca/kbuildservicefactory.cpp 2018-11-03 09:57:18.192402267 +0100 +@@ -93,11 +93,18 @@ KSycocaEntry *KBuildServiceFactory::crea + if (QDir::isAbsolutePath(file)) { // vfolder sends us full paths for applications + serv = new KService(file); + } else { // we get relative paths for services ++ const QString appImageDesktopFile = QCoreApplication::applicationDirPath() + QLatin1String("/../share/") + QStringLiteral("kservices5/") + file; ++ if (qAppName() == QLatin1String("AppRun") && QFile::exists(appImageDesktopFile)) { ++ KDesktopFile desktopFile(appImageDesktopFile); ++ qDebug() << "filename w KBuildServiceFactory::createEntry" << desktopFile.fileName(); ++ serv = new KService(&desktopFile, appImageDesktopFile); ++ } else { + KDesktopFile desktopFile(QStandardPaths::GenericDataLocation, QStringLiteral("kservices5/") + file); + // Note that the second arg below MUST be 'file', unchanged. + // If the entry path doesn't match the 'file' parameter to createEntry, reusing old entries + // (via time dict, which uses the entry path as key) cannot work. + serv = new KService(&desktopFile, file); ++ } + } + + //qCDebug(SYCOCA) << "Creating KService from" << file << "entryPath=" << serv->entryPath(); +diff -Npru kservice-5.51.0.orig/src/sycoca/kbuildsycoca.cpp kservice-5.51.0/src/sycoca/kbuildsycoca.cpp +--- kservice-5.51.0.orig/src/sycoca/kbuildsycoca.cpp 2018-10-08 10:21:25.000000000 +0200 ++++ kservice-5.51.0/src/sycoca/kbuildsycoca.cpp 2018-11-03 09:58:38.961596599 +0100 +@@ -201,7 +201,12 @@ bool KBuildSycoca::build() + m_resource = it1.value(); + + QSet relFiles; +- const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, m_resourceSubdir, QStandardPaths::LocateDirectory); ++ QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, m_resourceSubdir, QStandardPaths::LocateDirectory); ++ const QString appImageDir = QCoreApplication::applicationDirPath() + QLatin1String("/../share/") + m_resourceSubdir; ++ if (qAppName() == QLatin1String("AppRun")) { ++ if (QFile::exists(appImageDir)) ++ dirs.append(appImageDir); ++ } + qCDebug(SYCOCA) << "Looking for subdir" << m_resourceSubdir << "=>" << dirs; + Q_FOREACH (const QString &dir, dirs) { + QDirIterator it(dir, QDirIterator::Subdirectories); +@@ -626,7 +631,12 @@ quint32 KBuildSycoca::calcResourceHash(c + if (!QDir::isRelativePath(filename)) { + return updateHash(filename, hash); + } +- const QStringList files = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, resourceSubDir + QLatin1Char('/') + filename); ++ QStringList files = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, resourceSubDir + QLatin1Char('/') + filename); ++ if (qAppName() == QLatin1String("AppRun")) { ++ const QString appImageFile = QCoreApplication::applicationDirPath() + QLatin1String("/../share/") + resourceSubDir + QLatin1Char('/') + filename; ++ if (QFile::exists(appImageFile)) ++ files.append(appImageFile); ++ } + Q_FOREACH (const QString &file, files) { + hash = updateHash(file, hash); + } diff -Npru kservice-5.51.0.orig/src/sycoca/ksycoca.cpp kservice-5.51.0/src/sycoca/ksycoca.cpp --- kservice-5.51.0.orig/src/sycoca/ksycoca.cpp 2018-10-08 10:21:25.000000000 +0200 -+++ kservice-5.51.0/src/sycoca/ksycoca.cpp 2018-10-23 18:48:47.403851239 +0200 -@@ -602,6 +602,12 @@ KSycocaHeader KSycocaPrivate::readSycoca - language = header.language; - updateSig = header.updateSignature; ++++ kservice-5.51.0/src/sycoca/ksycoca.cpp 2018-11-03 09:56:30.893459677 +0100 +@@ -596,6 +596,15 @@ KSycocaHeader KSycocaPrivate::readSycoca -+ const QString appImageShare = QCoreApplication::applicationDirPath() + QLatin1String("/../share"); -+ addLocalResourceDir(appImageShare + QLatin1String("/kservices5")); -+ addLocalResourceDir(appImageShare + QLatin1String("/kservicetypes5")); -+ addLocalResourceDir(appImageShare + QLatin1String("/mime")); -+ addLocalResourceDir(appImageShare + QLatin1String("/applications")); + str->device()->seek(oldPos); + ++ // this clause must be before timeStamp = header.timeStamp ++ if (qAppName() == QLatin1String("AppRun")) { ++ const QString appImageShare = QCoreApplication::applicationDirPath() + QLatin1String("/../share"); ++ addLocalResourceDir(appImageShare + QLatin1String("/kservices5")); ++ addLocalResourceDir(appImageShare + QLatin1String("/kservicetypes5")); ++ addLocalResourceDir(appImageShare + QLatin1String("/mime")); ++ addLocalResourceDir(appImageShare + QLatin1String("/applications")); ++ } + - if (m_globalDatabase) { - // The global database doesn't point to the user's local dirs, but we need to check them too - // to react on something being created there + timeStamp = header.timeStamp; + + // for the useless public accessors. KF6: remove these two lines, the accessors and the vars.