Fix application name on Wayland in flatpak

fixes #903
This commit is contained in:
Nicolas Werner 2022-02-09 23:46:49 +01:00
parent 19e2527b4b
commit dfb8f9a160
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
3 changed files with 10 additions and 4 deletions

View file

@ -10,6 +10,7 @@ if(UNIX AND NOT APPLE)
else()
option(MAN "Build man page" OFF)
endif()
option(FLATPAK "Set this only if Nheko is built as a flatpak" OFF)
set(
CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/toolchain.cmake"
@ -637,6 +638,9 @@ elseif(WIN32)
endif()
else()
target_link_libraries (nheko PRIVATE Qt5::DBus)
if (FLATPAK)
target_compile_definitions(nheko PRIVATE NHEKO_FLATPAK)
endif()
endif()
target_include_directories(nheko PRIVATE src includes third_party/blurhash third_party/cpp-httplib-0.5.12)

View file

@ -200,6 +200,7 @@ modules:
- -DLMDBXX_INCLUDE_DIR=.deps/lmdbxx
- -DCOMPILE_QML=ON
- -DMAN=OFF
- -DFLATPAK=ON
buildsystem: cmake-ninja
name: nheko
sources:

View file

@ -231,10 +231,11 @@ main(int argc, char *argv[])
#if !defined(Q_OS_MAC)
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("nheko"), QIcon{":/logos/nheko.png"}));
#endif
if (userdata.isEmpty() || userdata == QLatin1String("default"))
#ifdef NHEKO_FLATPAK
app.setDesktopFileName(QStringLiteral("io.github.NhekoReborn.Nheko"));
#else
app.setDesktopFileName(QStringLiteral("nheko"));
else
app.setDesktopFileName("nheko[" + userdata + "]");
#endif
http::init();