Changeset 3014
- Timestamp:
- 09/25/08 18:46:40
- Files:
-
- trunk/libnotify/ChangeLog (modified) (1 diff)
- trunk/libnotify/libnotify/notification.c (modified) (7 diffs)
- trunk/libnotify/libnotify/notification.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libnotify/ChangeLog
r3010 r3014 1 Thu Sep 25 18:45:41 PDT 2008 Christian Hammond <chipx86@chipx86.com> 2 3 * libnotify/notification.c: 4 * libnotify/notification.h: 5 - Prevent a backwards-compatibility breakage introduced where the 6 "reason" code was added to the "closed" signal. This meant that 7 existing signal handlers that passed extra data would break. We now 8 require that you call notify_notification_get_closed_reason() to get 9 this data. 10 1 11 Thu Sep 25 18:05:38 PDT 2008 Christian Hammond <chipx86@chipx86.com> 2 12 trunk/libnotify/libnotify/notification.c
r3011 r3014 91 91 gboolean updates_pending; 92 92 gboolean signals_registered; 93 94 gint closed_reason; 93 95 }; 94 96 … … 107 109 PROP_ICON_NAME, 108 110 PROP_ATTACH_WIDGET, 109 PROP_STATUS_ICON 111 PROP_STATUS_ICON, 112 PROP_CLOSED_REASON 110 113 }; 111 114 … … 225 228 G_PARAM_STATIC_BLURB)); 226 229 #endif /* HAVE_STATUS_ICON */ 230 231 g_object_class_install_property(object_class, PROP_CLOSED_REASON, 232 g_param_spec_int("closed-reason", "Closed Reason", 233 "The reason code for why the notification was closed", 234 -1, 235 G_MAXINT32, 236 -1, 237 G_PARAM_READABLE | 238 G_PARAM_STATIC_NAME | 239 G_PARAM_STATIC_NICK | 240 G_PARAM_STATIC_BLURB)); 227 241 } 228 242 … … 313 327 #endif 314 328 329 case PROP_CLOSED_REASON: 330 g_value_set_int(value, priv->closed_reason); 331 break; 332 315 333 default: 316 334 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); … … 340 358 obj->priv = g_new0(NotifyNotificationPrivate, 1); 341 359 obj->priv->timeout = NOTIFY_EXPIRES_DEFAULT; 360 obj->priv->closed_reason = -1; 342 361 obj->priv->hints = g_hash_table_new_full(g_str_hash, g_str_equal, 343 362 g_free, … … 718 737 { 719 738 g_object_ref(G_OBJECT(notification)); 720 g_signal_emit(notification, signals[SIGNAL_CLOSED], 0, reason); 739 notification->priv->closed_reason = reason; 740 g_signal_emit(notification, signals[SIGNAL_CLOSED], 0); 721 741 notification->priv->id = 0; 722 742 g_object_unref(G_OBJECT(notification)); … … 1300 1320 return TRUE; 1301 1321 } 1322 1323 /** 1324 * notify_notification_get_closed_reason: 1325 * @notification: The notification. 1326 * 1327 * Returns the closed reason code for the notification. This is valid only 1328 * after the "closed" signal is emitted. 1329 * 1330 * Returns: The closed reason code. 1331 */ 1332 gint 1333 notify_notification_get_closed_reason(const NotifyNotification *notification) 1334 { 1335 g_return_val_if_fail(notification != NULL, -1); 1336 g_return_val_if_fail(NOTIFY_IS_NOTIFICATION(notification), -1); 1337 1338 return notification->priv->closed_reason; 1339 } trunk/libnotify/libnotify/notification.h
r3011 r3014 63 63 64 64 /* Signals */ 65 void (*closed)(NotifyNotification *notification , gint reason);65 void (*closed)(NotifyNotification *notification); 66 66 }; 67 67 … … 156 156 GError **error); 157 157 158 gint notify_notification_get_closed_reason( 159 const NotifyNotification *notification); 160 158 161 G_END_DECLS 159 162
