On Tue, 2010-03-09 at 11:46 +0100, Jiri Moskovcak wrote:
This one works on top of my previous gui patch and allows user to directly report last crash by clicking on the button in notification bubble.
Please review,
+void CApplet::CrashNotify(const char* crash_id, const char *format, ...) +{ + m_pLastCrashID = crash_id; + va_list args; + va_start(args, format); + char *buf = xvasprintf(format, args); + va_end(args); + + NotifyNotification *notification = new_warn_notification(); + notify_notification_add_action(notification, "REPORT", _("Report"), + NOTIFY_ACTION_CALLBACK(CApplet::action_report), + this, NULL); + notify_notification_add_action(notification, "OPEN_MAIN_WINDOW", "Open ABRT", + NOTIFY_ACTION_CALLBACK(CApplet::action_open_gui), + this, NULL); + + notify_notification_update(notification, _("Warning"), buf, NULL); + + GError *err = NULL; + notify_notification_show(notification, &err); + if (err != NULL) + { + error_msg("%s", err->message); + g_error_free(err); + } +}
buf is leaked. (There are more similar leaks elsewhere).
- g_pCommLayer->Crash(get_crash_data_item_content(crashinfo, FILENAME_PACKAGE).c_str(), uid_str); + g_pCommLayer->Crash(get_crash_data_item_content(crashinfo, FILENAME_PACKAGE).c_str(), + get_crash_data_item_content(crashinfo, CD_UUID).c_str(), uid_str);
Crash id is "UID:UUID", not just "UUID". In the "UID:UUID" form, it identifies crash uniquely.
-- vda