From cb66d5b60dfef96523a90cfec42ff679b2c60065 Mon Sep 17 00:00:00 2001 From: Chris Coulson Date: Thu, 21 Jul 2011 21:03:22 +0100 Subject: Honour the default mail client rather than hardcoding the Mail entry to point to Evolution --- src/default-applications.c | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/default-applications.c b/src/default-applications.c index afb5025..3a8df60 100644 --- a/src/default-applications.c +++ b/src/default-applications.c @@ -21,20 +21,22 @@ with this program. If not, see . #include #include +#include +#include #include "default-applications.h" struct default_db_t { const gchar * desktop_file; + const gchar * uri_scheme; const gchar * name; const gchar * setupname; const gchar * icon; }; struct default_db_t default_db[] = { - {"evolution.desktop", N_("Mail"), N_("Set Up Mail..."), "applications-email-panel"}, - {"empathy.desktop", N_("Chat"), N_("Set Up Chat..."), "applications-chat-panel"}, - {"gwibber.desktop", N_("Broadcast"), N_("Set Up Broadcast Account..."), "applications-microblogging-panel"}, - {NULL, NULL} + {NULL, "mailto", N_("Mail"), N_("Set Up Mail..."), "applications-email-panel"}, + {"empathy.desktop", NULL, N_("Chat"), N_("Set Up Chat..."), "applications-chat-panel"}, + {"gwibber.desktop", NULL, N_("Broadcast"), N_("Set Up Broadcast Account..."), "applications-microblogging-panel"}, }; static struct default_db_t * @@ -44,16 +46,42 @@ get_default_helper (const gchar * desktop_path) gchar * basename = g_path_get_basename(desktop_path); g_return_val_if_fail(basename != NULL, NULL); + gboolean found = FALSE; gint i; - for (i = 0; default_db[i].desktop_file != NULL; i++) { - if (g_strcmp0(default_db[i].desktop_file, basename) == 0) { - break; + gint length = sizeof(default_db)/sizeof(default_db[0]); + for (i = 0; i < length; i++) { + if (default_db[i].desktop_file) { + if (g_strcmp0(default_db[i].desktop_file, basename) == 0) { + found = TRUE; + break; + } + } else if (default_db[i].uri_scheme) { + GAppInfo *info = g_app_info_get_default_for_uri_scheme(default_db[i].uri_scheme); + if (!info) { + continue; + } + + const gchar * filename = g_desktop_app_info_get_filename(G_DESKTOP_APP_INFO(info)); + if (!filename) { + g_object_unref(info); + continue; + } + + gchar * default_basename = g_path_get_basename(filename); + g_object_unref(info); + if (g_strcmp0(default_basename, basename) == 0) { + found = TRUE; + g_free(default_basename); + break; + } + + g_free(default_basename); } } g_free(basename); - if (default_db[i].desktop_file != NULL) { + if (found) { return &default_db[i]; } -- cgit v1.2.3 From 6dcb30531043cb812ebc4d80d43658bf336b4050 Mon Sep 17 00:00:00 2001 From: Chris Coulson Date: Fri, 22 Jul 2011 10:32:23 +0100 Subject: Make all indicator entries appear after an applications shortcuts Currently, indicator_added and resort_menu have different ideas of where they should go. indicator_added puts them before shortcuts, whereas resort_menu will move the shortcuts before them. This leads to a situation where shortcut entries end up inbetween an applications indicator entries (and this happens a lot with Thunderbird) --- src/messages-service.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/messages-service.c b/src/messages-service.c index 63549e3..c891f88 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -799,6 +799,8 @@ menushell_foreach_cb (DbusmenuMenuitem * data_mi, gpointer data_ms) { AppMenuItem * appmenu = APP_MENU_ITEM(data_mi); if (!g_strcmp0(INDICATE_LISTENER_SERVER_DBUS_NAME((IndicateListenerServer*)msl->server), INDICATE_LISTENER_SERVER_DBUS_NAME(app_menu_item_get_server(appmenu)))) { msl->found = TRUE; + /* Return a position at the end of our shortcuts */ + msl->position += g_list_length(app_menu_item_get_items(appmenu)); } else { msl->position++; } -- cgit v1.2.3 From 68ed5c051d18321bcc3504167e8c57b56840e186 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 22 Jul 2011 11:48:24 -0500 Subject: Reworking found slightly to make clean up code nicer --- src/default-applications.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/default-applications.c b/src/default-applications.c index 3a8df60..339183d 100644 --- a/src/default-applications.c +++ b/src/default-applications.c @@ -49,11 +49,10 @@ get_default_helper (const gchar * desktop_path) gboolean found = FALSE; gint i; gint length = sizeof(default_db)/sizeof(default_db[0]); - for (i = 0; i < length; i++) { + for (i = 0; i < length && !found; i++) { if (default_db[i].desktop_file) { if (g_strcmp0(default_db[i].desktop_file, basename) == 0) { found = TRUE; - break; } } else if (default_db[i].uri_scheme) { GAppInfo *info = g_app_info_get_default_for_uri_scheme(default_db[i].uri_scheme); @@ -71,8 +70,6 @@ get_default_helper (const gchar * desktop_path) g_object_unref(info); if (g_strcmp0(default_basename, basename) == 0) { found = TRUE; - g_free(default_basename); - break; } g_free(default_basename); @@ -82,7 +79,7 @@ get_default_helper (const gchar * desktop_path) g_free(basename); if (found) { - return &default_db[i]; + return &default_db[i - 1]; } return NULL; -- cgit v1.2.3 From a25a10c33af1d1b0907a0fa75188e27c5c6b6b46 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 22 Jul 2011 11:49:14 -0500 Subject: Use the G_N_ELEMENTS macro --- src/default-applications.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/default-applications.c b/src/default-applications.c index 339183d..0382e4d 100644 --- a/src/default-applications.c +++ b/src/default-applications.c @@ -48,7 +48,7 @@ get_default_helper (const gchar * desktop_path) gboolean found = FALSE; gint i; - gint length = sizeof(default_db)/sizeof(default_db[0]); + gint length = G_N_ELEMENTS(default_db); for (i = 0; i < length && !found; i++) { if (default_db[i].desktop_file) { if (g_strcmp0(default_db[i].desktop_file, basename) == 0) { -- cgit v1.2.3 From a7036472aeb0fc66d7d741513b6f37a6d7f01c86 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 29 Jul 2011 15:52:04 +0200 Subject: * debian/control: - use conflicts against indicator-me --- debian/changelog | 7 +++++++ debian/control | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3ab87f5..9a71a72 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +indicator-messages (0.4.92-0ubuntu2) oneiric; urgency=low + + * debian/control: + - use conflicts against indicator-me + + -- Michael Vogt Fri, 29 Jul 2011 15:49:40 +0200 + indicator-messages (0.4.92-0ubuntu1) oneiric; urgency=low * New upstream release. diff --git a/debian/control b/debian/control index 605f65b..b336742 100644 --- a/debian/control +++ b/debian/control @@ -30,7 +30,8 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: indicator-applet | indicator-renderer, indicator-status-provider-mc5 Replaces: indicator-me -Breaks: indicator-applet (<< 0.3.0), indicator-me +Breaks: indicator-applet (<< 0.3.0) +Conflicts: indicator-me Description: indicator that collects messages that need a response A place on the user's desktop that collects messages that need a response. This menu provides a condensed and collected view of all of those messages -- cgit v1.2.3 From a92965410d2bee490beff792bbd4876a95f1e0af Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Sun, 31 Jul 2011 16:37:48 -0400 Subject: releasing version 0.4.92-0ubuntu3 --- debian/changelog | 8 ++++++++ debian/control | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9a71a72..7ec4746 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +indicator-messages (0.4.92-0ubuntu3) oneiric; urgency=low + + * debian/control + - Added recommends for gwibber, it got missed when we dropped indicator-me + should get removed after we get it seeded properly + + -- Ken VanDine Sun, 31 Jul 2011 16:36:09 -0400 + indicator-messages (0.4.92-0ubuntu2) oneiric; urgency=low * debian/control: diff --git a/debian/control b/debian/control index b336742..158b8bb 100644 --- a/debian/control +++ b/debian/control @@ -28,7 +28,7 @@ Vcs-Browser: http://bazaar.launchpad.net/~ubuntu-desktop/indicator-messages/ubun Package: indicator-messages Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: indicator-applet | indicator-renderer, indicator-status-provider-mc5 +Recommends: indicator-applet | indicator-renderer, indicator-status-provider-mc5, gwibber Replaces: indicator-me Breaks: indicator-applet (<< 0.3.0) Conflicts: indicator-me -- cgit v1.2.3