From 3375b23dedbf9e0ad0a19b56541b0e0aa3dae474 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Mon, 30 Mar 2009 15:19:10 +0000 Subject: [PATCH] Remove mandatory dependency on libprofile in hildon2.2 platform pmo-trunk-r8472 --- configure.ac | 9 +++++++-- src/hildon2/modest-platform.c | 20 ++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 7bb4713..c8a0e12 100644 --- a/configure.ac +++ b/configure.ac @@ -205,13 +205,18 @@ pluginpkgs=$hildonpkgs echo "Plugin Packages $pluginpkgs" AC_SUBST(pluginpkgs) +use_profile_data=false # Plugin packages must not include libcanberra and libprofile if test "$have_hildon2" = "true"; then echo "DETECTED HILDON 2 $have_hildon2." detected_toolkit=hildon2 - hildonpkgs="$hildonpkgs libcanberra profile" + hildonpkgs="$hildonpkgs libcanberra" + AC_CHECK_HEADER([profiled/keys_nokia.h], use_profile_data=true, use_profile_data=false) + if test "$use_profile_data" = "true"; then + hildonpkgs="$hildonpkgs profile" + AC_DEFINE_UNQUOTED(MODEST_USE_PROFILE, 1, ["Use the Profile data include"]) + fi echo "HILDON 2 PACKAGES $hildonpkgs" - AC_CHECK_HEADER([profiled/keys_nokia.h], [], AC_MSG_ERROR([You have to install package profile-data-dev])) fi AC_SUBST(hildonpkgs) diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index b8affcc..b27552a 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -63,8 +63,10 @@ #include #include "hildon2/modest-hildon2-details-dialog.h" #include "hildon2/modest-hildon2-window-mgr.h" +#ifdef MODEST_USE_PROFILE #include #include +#endif #include #include #include "modest-header-window.h" @@ -92,8 +94,12 @@ #define URI_ACTION_COPY "copy:" #define MODEST_NOTIFICATION_CATEGORY "email-message" #define MODEST_NEW_MAIL_LIGHTING_PATTERN "PatternCommunicationEmail" +#ifdef MODEST_USE_PROFILE #define PROFILE_MAIL_TONE PROFILEKEY_EMAIL_ALERT_TONE #define PROFILE_MAIL_VOLUME PROFILEKEY_EMAIL_ALERT_VOLUME +#else +#define MAIL_TONE "message-new-email" +#endif #define COMMON_FOLDER_DIALOG_ENTRY "entry" #define COMMON_FOLDER_DIALOG_ACCOUNT_PICKER "account-picker" @@ -2442,18 +2448,26 @@ modest_platform_get_osso_context (void) static void _modest_platform_play_email_tone (void) { - gchar *active_profile; gchar *mail_tone; - gchar *mail_volume; gint mail_volume_int; int ret; ca_context *ca_con = NULL; ca_proplist *pl = NULL; +#ifdef MODEST_USE_PROFILE + gchar *active_profile; + gchar *mail_volume; + active_profile = profile_get_profile (); mail_tone = profile_get_value (active_profile, PROFILE_MAIL_TONE); mail_volume = profile_get_value (active_profile, PROFILE_MAIL_VOLUME); mail_volume_int = profile_parse_int (mail_volume); + g_free (mail_volume); + g_free (active_profile); +#else + mail_tone = MAIL_TONE; + mail_volume_int = 100; +#endif if (mail_tone && !strstr (mail_tone, "/")) { gchar *tmp; @@ -2487,9 +2501,7 @@ _modest_platform_play_email_tone (void) ca_context_destroy(ca_con); } - g_free (mail_volume); g_free (mail_tone); - g_free (active_profile); } #define MOVE_TO_DIALOG_FOLDER_VIEW "folder-view" -- 1.7.9.5