mirror of https://github.com/procxx/kepka.git
Make .desktop file search respect TDESKTOP_LAUNCHER_FILENAME
This commit is contained in:
parent
325989ed47
commit
b831766375
|
@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
|
#include <vector>
|
||||||
#include <QtDBus>
|
#include <QtDBus>
|
||||||
|
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
@ -549,15 +550,25 @@ void MainWindow::psFirstShow() {
|
||||||
if (QDBusInterface("com.canonical.Unity", "/").isValid()) {
|
if (QDBusInterface("com.canonical.Unity", "/").isValid()) {
|
||||||
auto snapName = QString::fromLatin1(qgetenv("SNAP_NAME"));
|
auto snapName = QString::fromLatin1(qgetenv("SNAP_NAME"));
|
||||||
if(snapName.isEmpty()) {
|
if(snapName.isEmpty()) {
|
||||||
if(!QStandardPaths::locate(QStandardPaths::ApplicationsLocation, "telegramdesktop.desktop").isEmpty()) {
|
std::vector<QString> possibleDesktopFiles = {
|
||||||
_desktopFile = "telegramdesktop.desktop";
|
#ifdef TDESKTOP_LAUNCHER_FILENAME
|
||||||
LOG(("Found Unity Launcher entry telegramdesktop.desktop!"));
|
#define TDESKTOP_LAUNCHER_FILENAME_TO_STRING_HELPER(V) #V
|
||||||
|
#define TDESKTOP_LAUNCHER_FILENAME_TO_STRING(V) TDESKTOP_LAUNCHER_FILENAME_TO_STRING_HELPER(V)
|
||||||
|
TDESKTOP_LAUNCHER_FILENAME_TO_STRING(TDESKTOP_LAUNCHER_FILENAME),
|
||||||
|
#endif // TDESKTOP_LAUNCHER_FILENAME
|
||||||
|
"telegramdesktop.desktop",
|
||||||
|
"Telegram.desktop"
|
||||||
|
};
|
||||||
|
|
||||||
|
for (auto it = possibleDesktopFiles.begin(); it != possibleDesktopFiles.end(); it++) {
|
||||||
|
if (!QStandardPaths::locate(QStandardPaths::ApplicationsLocation, *it).isEmpty()) {
|
||||||
|
_desktopFile = *it;
|
||||||
|
LOG(("Found Unity Launcher entry %1!").arg(_desktopFile));
|
||||||
useUnityCount = true;
|
useUnityCount = true;
|
||||||
} else if(!QStandardPaths::locate(QStandardPaths::ApplicationsLocation, "Telegram.desktop").isEmpty()) {
|
break;
|
||||||
_desktopFile = "Telegram.desktop";
|
}
|
||||||
LOG(("Found Unity Launcher entry Telegram.desktop!"));
|
}
|
||||||
useUnityCount=true;
|
if (!useUnityCount) {
|
||||||
} else {
|
|
||||||
LOG(("Could not get Unity Launcher entry!"));
|
LOG(("Could not get Unity Launcher entry!"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue