Set window icons for GUI executables

Otherwise the task bar entry on Gnome won't have an icon.
This commit is contained in:
Nicolas Fella 2020-10-24 22:21:23 +02:00
parent 9d94c25d83
commit a600c27490
4 changed files with 5 additions and 0 deletions

View file

@ -5,6 +5,7 @@
*/ */
#include <QApplication> #include <QApplication>
#include <QIcon>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QQmlContext> #include <QQmlContext>
@ -16,6 +17,7 @@
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kdeconnect")));
KAboutData aboutData(QStringLiteral("kdeconnect.app"), i18n("KDE Connect"), QStringLiteral("1.0"), i18n("KDE Connect"), KAboutLicense::GPL, i18n("(c) 2015, Aleix Pol Gonzalez")); KAboutData aboutData(QStringLiteral("kdeconnect.app"), i18n("KDE Connect"), QStringLiteral("1.0"), i18n("KDE Connect"), KAboutLicense::GPL, i18n("(c) 2015, Aleix Pol Gonzalez"));
aboutData.addAuthor(i18n("Aleix Pol Gonzalez"), i18n("Maintainer"), QStringLiteral("aleixpol@kde.org")); aboutData.addAuthor(i18n("Aleix Pol Gonzalez"), i18n("Maintainer"), QStringLiteral("aleixpol@kde.org"));
KAboutData::setApplicationData(aboutData); KAboutData::setApplicationData(aboutData);

View file

@ -17,6 +17,7 @@
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kdeconnect")));
KAboutData about(QStringLiteral("kdeconnect-settings"), KAboutData about(QStringLiteral("kdeconnect-settings"),
i18n("KDE Connect Settings"), i18n("KDE Connect Settings"),
QStringLiteral(KDECONNECT_VERSION_STRING), QStringLiteral(KDECONNECT_VERSION_STRING),

View file

@ -26,6 +26,7 @@ int main(int argc, char *argv[])
{ {
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication app(argc, argv); QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kdeconnect")));
KAboutData aboutData(QStringLiteral("kdeconnect.sms"), KAboutData aboutData(QStringLiteral("kdeconnect.sms"),
i18n("KDE Connect SMS"), i18n("KDE Connect SMS"),
QStringLiteral(KDECONNECT_VERSION_STRING), QStringLiteral(KDECONNECT_VERSION_STRING),

View file

@ -31,6 +31,7 @@
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kdeconnect")));
const QString description = i18n("KDE Connect URL handler"); const QString description = i18n("KDE Connect URL handler");
KAboutData about(QStringLiteral("kdeconnect-urlhandler"), KAboutData about(QStringLiteral("kdeconnect-urlhandler"),
description, description,