File indexing completed on 2024-11-10 04:40:43
0001 /* 0002 SPDX-FileCopyrightText: 2014 Daniel Vrátil <dvratil@redhat.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "notificationsource_p.h" 0008 #include "notificationsourceinterface.h" 0009 0010 using namespace Akonadi; 0011 0012 NotificationSource::NotificationSource(QObject *source) 0013 : QObject(source) 0014 { 0015 Q_ASSERT(source); 0016 } 0017 0018 NotificationSource::~NotificationSource() 0019 { 0020 } 0021 0022 QString NotificationSource::identifier() const 0023 { 0024 auto source = qobject_cast<org::freedesktop::Akonadi::NotificationSource *>(parent()); 0025 return source->path(); 0026 } 0027 0028 void NotificationSource::setAllMonitored(bool allMonitored) 0029 { 0030 const bool ok = QMetaObject::invokeMethod(parent(), "setAllMonitored", Q_ARG(bool, allMonitored)); 0031 Q_ASSERT(ok); 0032 Q_UNUSED(ok) 0033 } 0034 0035 void NotificationSource::setExclusive(bool exclusive) 0036 { 0037 const bool ok = QMetaObject::invokeMethod(parent(), "setExclusive", Q_ARG(bool, exclusive)); 0038 Q_ASSERT(ok); 0039 Q_UNUSED(ok) 0040 } 0041 0042 void NotificationSource::setMonitoredCollection(Collection::Id id, bool monitored) 0043 { 0044 const bool ok = QMetaObject::invokeMethod(parent(), "setMonitoredCollection", Q_ARG(qlonglong, id), Q_ARG(bool, monitored)); 0045 Q_ASSERT(ok); 0046 Q_UNUSED(ok) 0047 } 0048 0049 void NotificationSource::setMonitoredItem(Item::Id id, bool monitored) 0050 { 0051 const bool ok = QMetaObject::invokeMethod(parent(), "setMonitoredItem", Q_ARG(qlonglong, id), Q_ARG(bool, monitored)); 0052 Q_ASSERT(ok); 0053 Q_UNUSED(ok) 0054 } 0055 0056 void NotificationSource::setMonitoredResource(const QByteArray &resource, bool monitored) 0057 { 0058 const bool ok = QMetaObject::invokeMethod(parent(), "setMonitoredResource", Q_ARG(QByteArray, resource), Q_ARG(bool, monitored)); 0059 Q_ASSERT(ok); 0060 Q_UNUSED(ok) 0061 } 0062 0063 void NotificationSource::setMonitoredMimeType(const QString &mimeType, bool monitored) 0064 { 0065 const bool ok = QMetaObject::invokeMethod(parent(), "setMonitoredMimeType", Q_ARG(QString, mimeType), Q_ARG(bool, monitored)); 0066 Q_ASSERT(ok); 0067 Q_UNUSED(ok) 0068 } 0069 0070 void NotificationSource::setIgnoredSession(const QByteArray &session, bool ignored) 0071 { 0072 const bool ok = QMetaObject::invokeMethod(parent(), "setIgnoredSession", Q_ARG(QByteArray, session), Q_ARG(bool, ignored)); 0073 Q_ASSERT(ok); 0074 Q_UNUSED(ok) 0075 } 0076 0077 void NotificationSource::setMonitoredTag(Tag::Id id, bool monitored) 0078 { 0079 const bool ok = QMetaObject::invokeMethod(parent(), "setMonitoredTag", Q_ARG(qlonglong, id), Q_ARG(bool, monitored)); 0080 Q_ASSERT(ok); 0081 Q_UNUSED(ok) 0082 } 0083 0084 void NotificationSource::setMonitoredType(Protocol::ChangeNotification::Type type, bool monitored) 0085 { 0086 const bool ok = QMetaObject::invokeMethod(parent(), "setMonitoredType", Q_ARG(Akonadi::Protocol::ChangeNotification::Type, type), Q_ARG(bool, monitored)); 0087 Q_ASSERT(ok); 0088 Q_UNUSED(ok) 0089 } 0090 0091 void NotificationSource::setSession(const QByteArray &session) 0092 { 0093 const bool ok = QMetaObject::invokeMethod(parent(), "setSession", Q_ARG(QByteArray, session)); 0094 Q_ASSERT(ok); 0095 Q_UNUSED(ok) 0096 } 0097 0098 QObject *NotificationSource::source() const 0099 { 0100 return parent(); 0101 } 0102 0103 #include "moc_notificationsource_p.cpp"