Changeset View
Changeset View
Standalone View
Standalone View
src/knotification.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 40 | struct Q_DECL_HIDDEN KNotification::Private { | |||
---|---|---|---|---|---|
47 | QString text; | 47 | QString text; | ||
48 | QString iconName; | 48 | QString iconName; | ||
49 | QString defaultAction; | 49 | QString defaultAction; | ||
50 | QStringList actions; | 50 | QStringList actions; | ||
51 | QPixmap pixmap; | 51 | QPixmap pixmap; | ||
52 | ContextList contexts; | 52 | ContextList contexts; | ||
53 | NotificationFlags flags; | 53 | NotificationFlags flags; | ||
54 | QString componentName; | 54 | QString componentName; | ||
55 | QList<QUrl> urls; | | |||
56 | KNotification::Urgency urgency; | 55 | KNotification::Urgency urgency; | ||
57 | QVariantMap hints; | 56 | QVariantMap hints; | ||
58 | 57 | | |||
59 | QTimer updateTimer; | 58 | QTimer updateTimer; | ||
60 | bool needUpdate; | 59 | bool needUpdate; | ||
61 | 60 | | |||
62 | Private() : id(-1), ref(0), widget(nullptr), urgency(KNotification::DefaultUrgency), needUpdate(false) {} | 61 | Private() : id(-1), ref(0), widget(nullptr), urgency(KNotification::DefaultUrgency), needUpdate(false) {} | ||
63 | #if KNOTIFICATIONS_BUILD_DEPRECATED_SINCE(5, 67) | 62 | #if KNOTIFICATIONS_BUILD_DEPRECATED_SINCE(5, 67) | ||
▲ Show 20 Lines • Show All 203 Lines • ▼ Show 20 Line(s) | |||||
267 | 266 | | |||
268 | void KNotification::setComponentName(const QString &c) | 267 | void KNotification::setComponentName(const QString &c) | ||
269 | { | 268 | { | ||
270 | d->componentName = c; | 269 | d->componentName = c; | ||
271 | } | 270 | } | ||
272 | 271 | | |||
273 | QList<QUrl> KNotification::urls() const | 272 | QList<QUrl> KNotification::urls() const | ||
274 | { | 273 | { | ||
275 | return d->urls; | 274 | return QUrl::fromStringList(d->hints[QStringLiteral("x-kde-urls")].toStringList()); | ||
276 | } | 275 | } | ||
277 | 276 | | |||
278 | void KNotification::setUrls(const QList<QUrl> &urls) | 277 | void KNotification::setUrls(const QList<QUrl> &urls) | ||
279 | { | 278 | { | ||
280 | if (d->urls == urls) { | 279 | setHint(QStringLiteral("x-kde-urls"), QUrl::toStringList(urls)); | ||
281 | return; | | |||
282 | } | | |||
283 | | ||||
284 | d->needUpdate = true; | | |||
285 | d->urls = urls; | | |||
286 | if (d->id >= 0) { | | |||
287 | d->updateTimer.start(); | | |||
288 | } | | |||
289 | } | 280 | } | ||
290 | 281 | | |||
291 | KNotification::Urgency KNotification::urgency() const | 282 | KNotification::Urgency KNotification::urgency() const | ||
292 | { | 283 | { | ||
293 | return d->urgency; | 284 | return d->urgency; | ||
294 | } | 285 | } | ||
295 | 286 | | |||
296 | void KNotification::setUrgency(Urgency urgency) | 287 | void KNotification::setUrgency(Urgency urgency) | ||
▲ Show 20 Lines • Show All 281 Lines • Show Last 20 Lines |