* Added MCE ifdefs
authorSergio Villar Senin <svillar@igalia.com>
Wed, 19 Dec 2007 10:03:37 +0000 (10:03 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 19 Dec 2007 10:03:37 +0000 (10:03 +0000)
pmo-trunk-r3943

configure.ac
src/maemo/modest-platform.c

index f7474d1..84fd835 100644 (file)
@@ -175,7 +175,20 @@ else
 fi
 fi
 
-
+#
+# check for MCE
+#
+if test "x$with_platform" == "xmaemo"; then  
+PKG_CHECK_MODULES(MODEST_MCE,mce,have_mce=true,have_mce=false)
+if test "x$have_mce" == "xtrue"; then
+   mce="mce"   
+   AC_DEFINE_UNQUOTED(MODEST_HAVE_MCE, 1, ["Whether mce is used."])
+   AC_SUBST(MODEST_MCE_CFLAGS)
+   AC_SUBST(MODEST_MCE_LIBS)
+else
+   mce=""
+fi
+fi
 
 #
 # check for libconic; this is a trick to check whether we run
@@ -473,6 +486,7 @@ if test "x$with_platform" == "xmaemo"; then
    echo "Help lib         : $helplib"
    echo "libconic support : $have_libconic"
    echo "Alarm            : $have_libalarm"
+   echo "MCE              : $have_mce"
    echo "Hildon-Notify    : $have_hildon_notify"    
    echo "LibOGS support   : $have_ogs_support"
    echo "MozEmbed support : $use_mozembed"
index 8b0f3b5..83080ae 100644 (file)
@@ -40,7 +40,6 @@
 #include <dbus_api/modest-dbus-callbacks.h>
 #include <maemo/modest-osso-autosave-callbacks.h>
 #include <libosso.h>
-#include <mce/dbus-names.h>
 #include <tny-maemo-conic-device.h>
 #include <tny-simple-list.h>
 #include <tny-folder.h>
 #include <maemo/easysetup/modest-easysetup-wizard.h>
 #include <hildon/hildon-sound.h>
 
+#ifdef MODEST_HAVE_MCE
+#include <mce/dbus-names.h>
+#endif /*MODEST_HAVE_MCE*/
+
 #ifdef MODEST_HAVE_ABOOK
 #include <libosso-abook/osso-abook.h>
 #endif /*MODEST_HAVE_ABOOK*/
@@ -1363,6 +1366,7 @@ modest_platform_on_new_headers_received (TnyList *header_list,
                        
                        /* Activate LED. This must be deactivated by
                           modest_platform_remove_new_mail_notifications */
+#ifdef MODEST_HAVE_MCE
                        osso_rpc_run_system (modest_maemo_utils_get_osso_context (),
                                             MCE_SERVICE,
                                             MCE_REQUEST_PATH,
@@ -1371,6 +1375,7 @@ modest_platform_on_new_headers_received (TnyList *header_list,
                                             NULL,
                                             DBUS_TYPE_STRING, MODEST_NEW_MAIL_LIGHTING_PATTERN,
                                             DBUS_TYPE_INVALID);
+#endif
                }
                /* We do a return here to avoid indentation with an else */
                return;
@@ -1471,6 +1476,7 @@ void
 modest_platform_remove_new_mail_notifications (gboolean only_visuals) 
 {
        if (only_visuals) {
+#ifdef MODEST_HAVE_MCE
                osso_rpc_run_system (modest_maemo_utils_get_osso_context (),
                                     MCE_SERVICE,
                                     MCE_REQUEST_PATH,
@@ -1479,6 +1485,7 @@ modest_platform_remove_new_mail_notifications (gboolean only_visuals)
                                     NULL,
                                     DBUS_TYPE_STRING, MODEST_NEW_MAIL_LIGHTING_PATTERN,
                                     DBUS_TYPE_INVALID);
+#endif
                return;
        }