Fix missing icon on snap (#2616)

* defined FLAMESHOT_ICON variable

* print statements

* remove print statements

* adding FLAMESHOT_ICON to snap yaml file

* code format; comment
This commit is contained in:
vozdeckyl
2022-05-23 16:06:24 +01:00
committed by GitHub
parent 0ecb4eefa4
commit 14100659b9
3 changed files with 17 additions and 4 deletions

View File

@@ -46,9 +46,10 @@ parts:
- kde-frameworks-5-qt-5-15-core20
source: https://github.com/flameshot-org/flameshot.git
plugin: cmake
# This cannot be enabled until the KF5 toolkit in the snap is updated
#cmake-parameters:
# - -DUSE_WAYLAND_CLIPBOARD=1
cmake-parameters:
- -DFLAMESHOT_ICON=/snap/flameshot/current/usr/local/share/icons/hicolor/scalable/apps/flameshot.svg
# This cannot be enabled until the KF5 toolkit in the snap is updated
#- -DUSE_WAYLAND_CLIPBOARD=1
source-type: git
override-pull: |
snapcraftctl pull

View File

@@ -65,6 +65,10 @@ endif ()
add_executable(Flameshot::flameshot ALIAS flameshot)
if(FLAMESHOT_ICON)
target_compile_definitions(flameshot PUBLIC FLAMESHOT_ICON="${FLAMESHOT_ICON}")
endif()
if (WIN32)
set_property(TARGET flameshot PROPERTY WIN32_EXECUTABLE true)
if (MSVC)

View File

@@ -12,6 +12,13 @@
#include "src/core/flameshotdaemon.h"
#endif
// work-around for snap, which cannot install icons into
// the system folder, so instead the absolute path to the
// icon (saved somwhere in /snap/flameshot/...) is passed
#ifndef FLAMESHOT_ICON
#define FLAMESHOT_ICON "flameshot"
#endif
SystemNotification::SystemNotification(QObject* parent)
: QObject(parent)
, m_interface(nullptr)
@@ -61,9 +68,10 @@ void SystemNotification::sendMessage(const QString& text,
hintsMap[QStringLiteral("x-kde-urls")] =
QStringList({ fullPath.toString() });
}
args << (qAppName()) // appname
<< static_cast<unsigned int>(0) // id
<< "flameshot" // icon
<< FLAMESHOT_ICON // icon
<< title // summary
<< text // body
<< QStringList() // actions