Skip to content

Commit 6e53478

Browse files
committed
fix: database maybe corrup
Move updating database of Applet from caller thread to Manager's thread.
1 parent 381b797 commit 6e53478

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

panels/notification/server/notificationmanager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class NotificationManager : public QObject, public QDBusContext
3030
bool registerDbusService();
3131

3232
uint recordCount() const;
33-
void actionInvoked(qint64 id, uint bubbleId, const QString &actionKey);
34-
void notificationClosed(qint64 id, uint bubbleId, uint reason);
35-
void notificationReplaced(qint64 id);
33+
Q_INVOKABLE void actionInvoked(qint64 id, uint bubbleId, const QString &actionKey);
34+
Q_INVOKABLE void notificationClosed(qint64 id, uint bubbleId, uint reason);
35+
Q_INVOKABLE void notificationReplaced(qint64 id);
3636

3737
void removeNotification(qint64 id);
3838
void removeNotifications(const QString &appName);

panels/notification/server/notifyserverapplet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ bool NotifyServerApplet::init()
6161

6262
void NotifyServerApplet::actionInvoked(qint64 id, uint bubbleId, const QString &actionKey)
6363
{
64-
m_manager->actionInvoked(id, bubbleId, actionKey);
64+
QMetaObject::invokeMethod(m_manager, "actionInvoked", Qt::AutoConnection, Q_ARG(qint64, id), Q_ARG(uint, bubbleId), Q_ARG(QString, actionKey));
6565
}
6666

6767
void NotifyServerApplet::notificationClosed(qint64 id, uint bubbleId, uint reason)
6868
{
69-
m_manager->notificationClosed(id, bubbleId, reason);
69+
QMetaObject::invokeMethod(m_manager, "notificationClosed", Qt::AutoConnection, Q_ARG(qint64, id), Q_ARG(uint, bubbleId), Q_ARG(uint, reason));
7070
}
7171

7272
void NotifyServerApplet::notificationReplaced(qint64 id)
7373
{
74-
m_manager->notificationReplaced(id);
74+
QMetaObject::invokeMethod(m_manager, "notificationReplaced", Qt::AutoConnection, Q_ARG(qint64, id));
7575
}
7676

7777
QVariant NotifyServerApplet::appValue(const QString &appId, int configItem)

0 commit comments

Comments
 (0)