From: Dirk-Jan C. Binnema Date: Fri, 26 Oct 2007 14:06:34 +0000 (+0000) Subject: * make osso-addressbook (libosso-abook-dev) optional; if it's X-Git-Tag: git_migration_finished~2208 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=5fe0a29a29e1d14da5b63f720fc686ddc20cda07;ds=sidebyside * make osso-addressbook (libosso-abook-dev) optional; if it's not there, we'll use modest-address-book-dummy.c pmo-trunk-r3591 --- diff --git a/configure.ac b/configure.ac index 89c016b..673f895 100644 --- a/configure.ac +++ b/configure.ac @@ -95,7 +95,7 @@ if test "x$with_platform" == "xgnome"; then AC_MSG_ERROR([The GNOME Build is currently broken; please try the Maemo build instead]) else have_easysetup=true - PKG_CHECK_MODULES(MODEST_PLATFORM,libosso conic libtinymail-maemo-1.0 osso-addressbook-1.0 libebook-1.2 libalarm) + PKG_CHECK_MODULES(MODEST_PLATFORM,libosso conic libtinymail-maemo-1.0 libebook-1.2 libalarm microb-engine-nss) AC_DEFINE_UNQUOTED(MODEST_PLATFORM_MAEMO, 1, ["Whether modest is being built for the MAEMO platform."]) AC_DEFINE_UNQUOTED(MODEST_HAVE_EASYSETUP, 1, ["Whether we have the easysetup feature"]) fi @@ -272,13 +272,27 @@ fi # check the version of the addressbook on maemo # if test "x$with_platform" == "xmaemo"; then - PKG_CHECK_MODULES(MODEST_ABOOK, osso-addressbook-1.0 < 2.0, have_old_abook=true,have_old_abook=false) - if test "x$have_old_abook" == "xtrue"; then - AC_DEFINE_UNQUOTED(MODEST_HAVE_OLD_ABOOK, 1, ["whether we have an old osso-addressbook"]) + PKG_CHECK_MODULES(MODEST_ABOOK,osso-addressbook-1.0,have_abook=true,have_abook=false) + AC_SUBST(MODEST_ABOOK_CFLAGS) + AC_SUBST(MODEST_ABOOK_LIBS) + + if test "x$have_abook" == "xtrue"; then + PKG_CHECK_MODULES(MODEST_ABOOK_OLD, osso-addressbook-1.0 < 2.0, have_old_abook=true,have_old_abook=false) + if test "x$have_old_abook" == "xtrue"; then + AC_DEFINE_UNQUOTED(MODEST_HAVE_OLD_ABOOK, 1, ["whether we have an old osso-addressbook"]) + fi + AC_DEFINE_UNQUOTED(MODEST_HAVE_ABOOK,1, ["whether we have osso-addressbook"]) + addressbook="osso-addressbook" fi fi +# +# if we don't have an addressbook, use the dummy one +# +AM_CONDITIONAL(MODEST_USE_DUMMY_ADDRESS_BOOK,test "x$have_abook"="xtrue") + + #FIXME: hack to set the right gettext package.. if test "x$have_hildon1" == "xtrue"; then @@ -414,6 +428,7 @@ echo "Build docs : $build_docs" echo "Gettext Packages : $GETTEXT_PACKAGE" echo "Easysetup data : $providers_data" echo "Editor lib : $wpeditor" +echo "Addressbook : $addressbook" echo "Help lib : $helplib" echo "Hildon-Notify : $have_hildon_notify" echo "LibOGS support : $have_ogs_support" diff --git a/src/Makefile.am b/src/Makefile.am index ffd0b2c..eae8f1e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ # # Makefile.am -# Time-stamp: <2007-08-02 16:13:34 (djcb)> +# Time-stamp: <2007-10-26 12:47:06 (djcb)> SUBDIRS=$(MODEST_PLATFORM) widgets $(dbus_api) @@ -33,20 +33,28 @@ modest-marshal.h: modest-marshal.list bin_PROGRAMS=\ modest +# +# NOTE: $(addressbook) will be modest-addressbook-dummy.c +# if no real addressbook has been defined (configure.ac) +# modest_SOURCES=\ - modest-account-mgr-helpers.c\ - modest-account-mgr-helpers.h\ - modest-account-mgr-priv.h\ - modest-account-mgr.c\ - modest-account-mgr.h\ - modest-email-clipboard.c\ - modest-email-clipboard.h\ - modest-address-book.h\ - modest-cache-mgr.c\ - modest-cache-mgr.h\ - modest-conf.c\ + modest-account-mgr-helpers.c \ + modest-account-mgr-helpers.h \ + modest-account-mgr-priv.h \ + modest-account-mgr.c \ + modest-account-mgr.h \ + modest-address-book.h \ + modest-cache-mgr.c \ + modest-cache-mgr.h \ + modest-conf.c \ modest-conf.h \ - modest-defs.h\ + modest-defs.h \ + modest-dimming-rule.c \ + modest-dimming-rule.h \ + modest-dimming-rules-group.c \ + modest-dimming-rules-group.h \ + modest-email-clipboard.c \ + modest-email-clipboard.h \ modest-error.h \ modest-formatter.c \ modest-formatter.h \ @@ -58,57 +66,58 @@ modest_SOURCES=\ modest-mail-operation-queue.h \ modest-mail-operation.c \ modest-mail-operation.h \ - modest-ui-dimming-manager.c \ - modest-ui-dimming-manager.h \ - modest-dimming-rules-group.c \ - modest-dimming-rules-group.h \ - modest-dimming-rule.c \ - modest-dimming-rule.h \ - modest-main.c\ + modest-main.c \ modest-marshal.c \ modest-marshal.h \ - modest-pair.c\ - modest-pair.h\ - modest-platform.h\ - modest-progress-object.c\ - modest-progress-object.h\ - modest-protocol-info.c\ - modest-protocol-info.h\ - modest-runtime.c\ - modest-runtime.h\ - modest-runtime-priv.h\ - modest-singletons.c\ - modest-singletons.h\ - modest-signal-mgr.h\ - modest-signal-mgr.c\ - modest-text-utils.c\ - modest-text-utils.h\ - modest-tny-account-store.c\ - modest-tny-account-store.h\ - modest-tny-account.c\ - modest-tny-account.h\ - modest-tny-local-folders-account.c\ - modest-tny-local-folders-account.h\ - modest-tny-outbox-account.c\ - modest-tny-outbox-account.h\ + modest-pair.c \ + modest-pair.h \ + modest-platform.h \ + modest-platform.h \ + modest-progress-object.c \ + modest-progress-object.h \ + modest-protocol-info.c \ + modest-protocol-info.h \ + modest-runtime-priv.h \ + modest-runtime.c \ + modest-runtime.h \ + modest-search.c \ + modest-search.h \ + modest-signal-mgr.c \ + modest-signal-mgr.h \ + modest-singletons.c \ + modest-singletons.h \ + modest-text-utils.c \ + modest-text-utils.h \ + modest-tny-account-store.c \ + modest-tny-account-store.h \ + modest-tny-account.c \ + modest-tny-account.h \ modest-tny-folder.c \ modest-tny-folder.h \ - modest-tny-msg.c\ - modest-tny-msg.h\ - modest-platform.h\ + modest-tny-local-folders-account.c \ + modest-tny-local-folders-account.h \ + modest-tny-msg.c \ + modest-tny-msg.h \ + modest-tny-outbox-account.c \ + modest-tny-outbox-account.h \ modest-tny-platform-factory.c \ modest-tny-platform-factory.h \ - modest-tny-send-queue.c\ - modest-tny-send-queue.h\ - modest-ui-actions.c\ - modest-ui-actions.h\ - modest-ui-dimming-rules.c\ - modest-ui-dimming-rules.h\ + modest-tny-send-queue.c \ + modest-tny-send-queue.h \ + modest-ui-actions.c \ + modest-ui-actions.h \ + modest-ui-dimming-manager.c \ + modest-ui-dimming-manager.h \ + modest-ui-dimming-rules.c \ + modest-ui-dimming-rules.h \ modest-widget-memory-priv.h \ - modest-widget-memory.c\ - modest-widget-memory.h\ - modest-search.c\ - modest-search.h + modest-widget-memory.c \ + modest-widget-memory.h + +if MODEST_USE_DUMMY_ADDRESS_BOOK +modest_SOURCES += modest-address-book-dummy.c +endif + modest_CFLAGS = $(MAEMO_LAUNCHER_CFLAGS) modest_LDFLAGS = $(MAEMO_LAUNCHER_LDFLAGS) diff --git a/src/maemo/Makefile.am b/src/maemo/Makefile.am index 15d979b..22ed80b 100644 --- a/src/maemo/Makefile.am +++ b/src/maemo/Makefile.am @@ -32,6 +32,7 @@ INCLUDES=\ $(MODEST_GSTUFF_CFLAGS) \ $(MODEST_WPEDITOR_CFLAGS) \ $(MODEST_PLATFORM_CFLAGS) \ + $(MODEST_ABOOK_CFLAGS) \ $(MODEST_HILDON_WIDGETS_CFLAGS) \ $(MODEST_HILDON_HELP_CFLAGS) \ $(MODEST_HILDON_MIME_CFLAGS) \ @@ -49,7 +50,6 @@ noinst_LTLIBRARIES=\ libmodest_ui_la_SOURCES= \ modest-account-view-window.c \ - modest-address-book.c \ modest-icon-names.h \ modest-maemo-global-settings-dialog.c \ modest-maemo-global-settings-dialog.h \ @@ -81,9 +81,16 @@ libmodest_ui_la_SOURCES= \ modest-osso-state-saving.c \ modest-osso-state-saving.h +if MODEST_USE_DUMMY_ADDRESS_BOOK +# nothing +else +libmodest_ui_la_SOURCES += modest-address-book.c +endif + libmodest_ui_la_LIBADD = \ $(MODEST_GSTUFF_LIBS) \ + $(MODEST_ABOOK_LIBS) \ $(MODEST_PLATFORM_LIBS) \ $(MODEST_WPEDITOR_LIBS) \ $(MODEST_HILDON_WIDGETS_LIBS) \ diff --git a/src/modest-address-book-dummy.c b/src/modest-address-book-dummy.c new file mode 100644 index 0000000..f9081c6 --- /dev/null +++ b/src/modest-address-book-dummy.c @@ -0,0 +1,54 @@ +/* Copyright (c) 2007, Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Nokia Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * modest-address-book-dummy's only purpose in life is the make sure we + * can build modest without any addressbook support + */ + +#include "modest-address-book.h" + +void modest_address_book_add_address (const gchar *address) +{ + g_message ("trying to add '%s' to non-existing address book", + address); +} + + +void modest_address_book_select_addresses (ModestRecptEditor *editor) +{ + return; +} + +gboolean modest_address_book_check_names (ModestRecptEditor *editor, gboolean update_addressbook) +{ + /* let's be optimistic */ + return TRUE; +} +