]> err.no Git - mapper/commitdiff
Hildon can be on the desktop so start to separate hildon/osso
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 2 Aug 2007 09:32:05 +0000 (12:32 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 2 Aug 2007 09:32:05 +0000 (12:32 +0300)
configure.ac
src/config.h.in
src/mapper.c
src/settings-gui.c
src/ui-common.c

index 8c8641b401fd38dc4b1acb7bd4ace26d5f5c3762..50c51b96095cf1ca652b12811e09f5f4e0b84cff 100644 (file)
@@ -43,7 +43,7 @@ AC_SUBST(GLIBGTK_LIBS)
 AC_SUBST(GLIBGTK_CFLAGS)
 
 dnl Ckeck for hildon-libs
-PKG_CHECK_MODULES(HILDON, hildon-libs libosso, HAVE_HILDON=yes, HAVE_HILDON=no)
+PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
 
 if test "x$HAVE_HILDON" = "xyes"; then
   AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
@@ -51,22 +51,28 @@ else
   AC_MSG_RESULT(no)
 fi
 
-AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
-
 dnl make HILDON_CFLAGS and HILDON_LIBS available
 if test "x$HAVE_HILDON" = "xyes"; then
  AC_SUBST(HILDON_CFLAGS)
  AC_SUBST(HILDON_LIBS)
 
- PKG_CHECK_MODULES(OSSO, libosso >= 1 libossohelp osso-ic)
- AC_SUBST(OSSO_LIBS)
- AC_SUBST(OSSO_CFLAGS)
+ PKG_CHECK_MODULES(OSSO, libosso >= 1 libossohelp osso-ic, HAVE_OSSO=yes, HAVE_OSSO=no)
+ if test "x$HAVE_OSSO" = "xyes"; then
+  AC_DEFINE(WITH_OSSO, 1, [build with Nokia osso])
+  AC_SUBST(OSSO_LIBS)
+  AC_SUBST(OSSO_CFLAGS)
+ else
+  AC_MSG_RESULT(no)
+ fi
 
  PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.9.50 hildon-fm)
  AC_SUBST(HILDON_LIBS)
  AC_SUBST(HILDON_CFLAGS)
 fi
 
+AM_CONDITIONAL(WITH_HILDON, test "x$HAVE_HILDON" = "xyes")
+AM_CONDITIONAL(WITH_OSSO, test "x$HAVE_OSSO" = "xyes")
+
 PKG_CHECK_MODULES(BLUEZ, bluez)
 AC_SUBST(BLUEZ_LIBS)
 AC_SUBST(BLUEZ_CFLAGS)
index b4ebfbcc0767b352af0a5c4c01ac16b7855d00cc..69b4b1613de50a4486c546c083487f339ef6ac42 100644 (file)
 
 /* build with gpsd */
 #undef WITH_LIBGPS
+
+/* build with Nokia osso */
+#undef WITH_OSSO
index 816e1c715f6611e48f640777a3febc0291a7aab1..258bea0d861baa99408cf0fdfdc49d684e7af523 100644 (file)
 #include <curl/multi.h>
 #include <gconf/gconf-client.h>
 
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
 #include <libosso.h>
 #include <osso-helplib.h>
 #include <osso-ic-dbus.h>
 #include <osso-ic.h>
 #include <bt-dbus.h>
+#include "maemo-osso.h"
+#endif
+#ifdef WITH_HILDON
 #include <hildon-widgets/hildon-program.h>
 #include <hildon-widgets/hildon-controlbar.h>
 #include <hildon-widgets/hildon-note.h>
@@ -61,7 +64,6 @@
 #include <hildon-widgets/hildon-system-sound.h>
 #include <hildon-widgets/hildon-input-mode-hint.h>
 #include <device_symbols.h>
-#include "maemo-osso.h"
 #endif
 
 #include <libintl.h>
@@ -192,25 +194,19 @@ void mapper_destroy(void)
                g_tree_destroy(_pui_tree);
 
                /* Finish up all downloads. */
-               while (CURLM_CALL_MULTI_PERFORM
-                      == curl_multi_perform(_curl_multi, &num_transfers)
-                      || num_transfers) {
+               while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(_curl_multi, &num_transfers) || num_transfers) {
+                       /* XXX: should inform the user why it's taking so damn long... */
                }
 
                /* Close all finished files. */
                while ((msg = curl_multi_info_read(_curl_multi, &num_msgs))) {
                        if (msg->msg == CURLMSG_DONE) {
                                /* This is a map download. */
-                               ProgressUpdateInfo *pui =
-                                   g_hash_table_lookup(_pui_by_easy,
-                                                       msg->easy_handle);
-                               g_queue_push_head(_curl_easy_queue,
-                                                 msg->easy_handle);
-                               g_hash_table_remove(_pui_by_easy,
-                                                   msg->easy_handle);
+                               ProgressUpdateInfo *pui = g_hash_table_lookup(_pui_by_easy, msg->easy_handle);
+                               g_queue_push_head(_curl_easy_queue, msg->easy_handle);
+                               g_hash_table_remove(_pui_by_easy, msg->easy_handle);
                                fclose(pui->file);
-                               curl_multi_remove_handle(_curl_multi,
-                                                        msg->easy_handle);
+                               curl_multi_remove_handle(_curl_multi, msg->easy_handle);
                        }
                }
 
@@ -235,7 +231,7 @@ _conn_state = RCVR_OFF;
 
 gint mapper_osso_init(void)
 {
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
 /* Initialize _osso. */
 _osso = osso_initialize("org.tal.mapper", VERSION, TRUE, NULL);
 if (!_osso) {
@@ -248,7 +244,7 @@ return 0;
 
 gint mapper_osso_cb_init(void)
 {
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
 if (OSSO_OK != osso_rpc_set_default_cb_f(_osso, dbus_cb_default, NULL)) {
        g_printerr("osso_rpc_set_default_cb_f failed.\n");
        return 1;
@@ -279,8 +275,10 @@ gint main(gint argc, gchar * argv[])
 
        g_thread_init(NULL);
        g_type_init();
+#ifdef WITH_OSSO
        if (mapper_osso_init()!=0)
                return 1;
+#endif
        set_var_defaults();     
        gst_init(&argc, &argv);
        gtk_init(&argc, &argv);
@@ -290,11 +288,13 @@ gint main(gint argc, gchar * argv[])
        timezone_init();
        gpx_init();
        mapper_init(argc, argv);
+#ifdef WITH_OSSO
        if (mapper_osso_cb_init()!=0)
                return 1;
+#endif
        gtk_main();
        mapper_destroy();
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
        osso_deinitialize(_osso);
 #endif
        vprintf("%s(): return\n", __PRETTY_FUNCTION__);
index f821bcdbf9457197553e9aa7eedd714188914150..77bfdeb0eda92bf842651a2858f58b0ca23546e0 100644 (file)
 #include <locale.h>
 #include <sqlite3.h>
 
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
 #include <libosso.h>
 #include <osso-helplib.h>
+#endif
+#ifdef WITH_HILDON
 #include <hildon-widgets/hildon-program.h>
 #include <hildon-widgets/hildon-controlbar.h>
 #include <hildon-widgets/hildon-note.h>
index a26b31d5e6825bf0db154bc917f0e801a49cf9c5..096107780d0e93e85438958d1c13789a6f27fec8 100644 (file)
 #include <locale.h>
 #include <sqlite3.h>
 
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
 #include <libosso.h>
 #include <osso-helplib.h>
 #include <osso-ic-dbus.h>
 #include <osso-ic.h>
 #include <bt-dbus.h>
+#include "maemo-osso.h"
+#include "iap.h"
+#endif
+#ifdef WITH_HILDON
 #include <hildon-widgets/hildon-program.h>
 #include <hildon-widgets/hildon-controlbar.h>
 #include <hildon-widgets/hildon-note.h>
@@ -38,8 +42,6 @@
 #include <hildon-widgets/hildon-system-sound.h>
 #include <hildon-widgets/hildon-input-mode-hint.h>
 #include <device_symbols.h>
-#include "iap.h"
-#include "maemo-osso.h"
 #endif
 
 #include "utils.h"