mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Move icon name getter to cross-platform header
This commit is contained in:
@@ -26,6 +26,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <KUrlMimeData>
|
||||
#endif
|
||||
|
||||
#if __has_include(<KSandbox>)
|
||||
#include <KSandbox>
|
||||
#endif
|
||||
|
||||
#define qsl(s) QStringLiteral(s)
|
||||
|
||||
namespace base {
|
||||
@@ -45,6 +49,27 @@ inline auto GetMimeUrls(const QMimeData *data) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if __has_include(<KSandbox>) && defined DeclareReadSetting
|
||||
inline QString FlatpakID() {
|
||||
static const auto Result = [] {
|
||||
if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) {
|
||||
return qEnvironmentVariable("FLATPAK_ID");
|
||||
} else {
|
||||
return cExeName();
|
||||
}
|
||||
}();
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
inline QString IconName() {
|
||||
static const auto Result = KSandbox::isFlatpak()
|
||||
? FlatpakID()
|
||||
: qsl("telegram");
|
||||
return Result;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace base
|
||||
|
||||
static const int32 ScrollMax = INT_MAX;
|
||||
|
Reference in New Issue
Block a user