Support conditional build about notification library 86/31586/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 9 Apr 2014 01:42:25 +0000 (10:42 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Sat, 6 Dec 2014 12:58:26 +0000 (21:58 +0900)
Change-Id: I32ee8e6ac440823e11bc2ca3c44b715354bce390

configure.ac
ism/extras/efl_panel/isf_panel_efl.cpp

index 6675464..450ac14 100755 (executable)
@@ -276,7 +276,9 @@ PKG_CHECK_MODULES(MINICONTROL_PROVIDER, [minicontrol-provider],
 PKG_CHECK_MODULES(AIL, [ail >= 0])
 
 # Check notification library
-PKG_CHECK_MODULES(NOTIFICATION, [notification])
+PKG_CHECK_MODULES(NOTIFICATION, [notification],
+                  [ISF_HAS_NOTIFICATION=yes],
+                  [ISF_HAS_NOTIFICATION=no])
 
 # Check tts library
 PKG_CHECK_MODULES(TTS, [tts],
@@ -330,6 +332,10 @@ fi
 
 AM_CONDITIONAL([MOBILE_ENV], [test x$ISF_HAS_UIGADGET = xyes])
 
+if test "$ISF_HAS_NOTIFICATION" = "yes"; then
+  AC_DEFINE(HAVE_NOTIFICATION,1,[Have Notification functions.])
+fi
+
 # Check GTK2 library
 PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0 pango >= 1.1.0 gdk-pixbuf-2.0 >= 2.4.0],
                   [SCIM_HAS_GTK2=yes],
index 88f5d54..529e8b9 100644 (file)
@@ -60,7 +60,9 @@
 #include <privilege-control.h>
 #include "isf_panel_utility.h"
 #include <dlog.h>
+#if HAVE_NOTIFICATION
 #include <notification.h>
+#endif
 #include <efl_assist.h>
 #if HAVE_TTS
 #include <tts.h>
@@ -3627,7 +3629,6 @@ static void slot_update_factory_info (const PanelFactoryInfo &info)
 
     String ise_name = info.name;
     String ise_icon = info.icon;
-    unsigned int keyboard_ise_count = 0;
 
     String old_ise = _panel_agent->get_current_ise_name ();
     if (old_ise != ise_name) {
@@ -3644,17 +3645,18 @@ static void slot_update_factory_info (const PanelFactoryInfo &info)
     if (ise_name.length () > 0)
         _panel_agent->set_current_ise_name (ise_name);
 
+#ifdef HAVE_NOTIFICATION
     if (old_ise != ise_name) {
         if (TOOLBAR_KEYBOARD_MODE == mode) {
             char noti_msg[256] = {0};
-            keyboard_ise_count = get_ise_size (TOOLBAR_KEYBOARD_MODE);
+            unsigned int keyboard_ise_count = get_ise_size (TOOLBAR_KEYBOARD_MODE);
             if (keyboard_ise_count == 0) {
                 LOGD ("the number of keyboard ise is %d\n", keyboard_ise_count);
                 return;
             }
             else if (keyboard_ise_count >= 2) {
                 snprintf (noti_msg, sizeof (noti_msg), _("%s selected"), ise_name.c_str ());
-           }
+            }
             else if (keyboard_ise_count == 1) {
                 snprintf (noti_msg, sizeof (noti_msg), _("Only %s available"), ise_name.c_str ());
             }
@@ -3663,7 +3665,7 @@ static void slot_update_factory_info (const PanelFactoryInfo &info)
             LOGD ("%s\n", noti_msg);
         }
     }
-
+#endif
 }
 
 /**
@@ -5325,7 +5327,9 @@ static void check_hardware_keyboard (TOOLBAR_MODE_T mode)
         input_detect_minictrl.show ();
 #endif
 
+#ifdef HAVE_NOTIFICATION
         notification_status_message_post (_("Input detected from hardware keyboard"));
+#endif
 
         /* Set input detected property for isf setting */
         val = 1;