test taskbar numbers

This commit is contained in:
Martin Rotter 2021-06-21 13:08:22 +02:00
parent 1cecd1c324
commit 5e3d5297c1
2 changed files with 42 additions and 1 deletions

View file

@ -10,7 +10,11 @@ VERSION = $$APP_VERSION
QT *= core gui widgets sql network xml qml multimedia QT *= core gui widgets sql network xml qml multimedia
greaterThan(QT_MAJOR_VERSION, 5) { greaterThan(QT_MAJOR_VERSION, 5) {
QT*= core5compat QT *= core5compat
}
unix:!mac:!android {
QT *= dbus
} }
equals(USE_WEBENGINE, true) { equals(USE_WEBENGINE, true) {

View file

@ -31,6 +31,11 @@
#include <QtConcurrent/QtConcurrentRun> #include <QtConcurrent/QtConcurrentRun>
#include <QTimer> #include <QTimer>
#if defined(Q_OS_LINUX)
#include <QDBusConnection>
#include <QDBusMessage>
#endif
#if defined(USE_WEBENGINE) #if defined(USE_WEBENGINE)
#include "network-web/adblock/adblockicon.h" #include "network-web/adblock/adblockicon.h"
#include "network-web/adblock/adblockmanager.h" #include "network-web/adblock/adblockmanager.h"
@ -101,6 +106,38 @@ Application::Application(const QString& id, int& argc, char** argv)
m_notifications->load(settings()); m_notifications->load(settings());
} }
#if defined(Q_OS_LINUX)
connect(m_feedReader->feedsModel(), &FeedsModel::messageCountsChanged, this,
[=](int unread_messages, bool any_feed_has_unread_messages) {
QDBusMessage signal = QDBusMessage::createSignal(
"/",
"com.canonical.Unity.LauncherEntry",
"Update");
signal << QSL("application://%1").arg(APP_DESKTOP_ENTRY_FILE);
QVariantMap setProperty;
setProperty.insert("count", qint64(unread_messages));
setProperty.insert("count-visible", unread_messages > 0);
/*
/* progre
* ss bar count must be float between 0 and 1 (mean from 0.00 to 0.100)*/
setProperty.insert("progress", double(0.80));
/* show progress bar */
setProperty.insert("progress-visible", true);
/* Tells the launcher to get the users attention */
setProperty.insert("urgent", true);
* /
signal << setProperty;
QDBusConnection::sessionBus().send(signal);
});
#endif
QTimer::singleShot(1000, system(), &SystemFactory::checkForUpdatesOnStartup); QTimer::singleShot(1000, system(), &SystemFactory::checkForUpdatesOnStartup);
qDebugNN << LOGSEC_CORE qDebugNN << LOGSEC_CORE