aboutsummaryrefslogtreecommitdiffstats
path: root/tools/evolution-addressbook-export.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-19 05:18:25 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-19 05:18:25 +0800
commitd4fd9c55c7f5d5b7ad3f0bf1c4a2481023f7bceb (patch)
tree0345248e002c380e1eff080933d05ca7353118d4 /tools/evolution-addressbook-export.c
parent8589cb087050e616facdba00e79479868b08c07f (diff)
downloadgsoc2013-evolution-d4fd9c55c7f5d5b7ad3f0bf1c4a2481023f7bceb.tar.gz
gsoc2013-evolution-d4fd9c55c7f5d5b7ad3f0bf1c4a2481023f7bceb.tar.zst
gsoc2013-evolution-d4fd9c55c7f5d5b7ad3f0bf1c4a2481023f7bceb.zip
Bumped the required version of gal to 0.15.99.1 for use in
2001-10-18 Christopher James Lahey <clahey@ximian.com> * configure.in: Bumped the required version of gal to 0.15.99.1 for use in evolution-addressbook-export. * tools/.cvsignore: Added evolution-addressbook-clean, evolution-addressbook-export, evolution-addressbook-import, and .libs. * tools/Makefile.am: Added evolution-addressbook-clean, evolution-addressbook-export, and evolution-addressbook-import. * tools/evolution-addressbook-clean.in: Main script to clean up the local contact database. * tools/evolution-addressbook-export.c: Exports the local addressbook to the specified file (--output-file). If no --output-file is given, writes out to a unique file in the /tmp directory. In either case, prints the filename to stdout. * tools/evolution-addressbook-import.c: Imports the specified file (--input-file) to the local addressbook. svn path=/trunk/; revision=13774
Diffstat (limited to 'tools/evolution-addressbook-export.c')
-rw-r--r--tools/evolution-addressbook-export.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/tools/evolution-addressbook-export.c b/tools/evolution-addressbook-export.c
new file mode 100644
index 0000000000..cfc0237a02
--- /dev/null
+++ b/tools/evolution-addressbook-export.c
@@ -0,0 +1,67 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+#include <config.h>
+
+#include <liboaf/liboaf.h>
+#include <bonobo/bonobo-main.h>
+#include <backend/ebook/e-book-util.h>
+#include <gnome.h>
+#include <fcntl.h>
+#include <gal/util/e-util.h>
+
+static void
+save_cards (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
+{
+ char *filename = closure;
+ char *vcard;
+ int result;
+ /* This has to be an array so that it's not const. */
+ char tmpname[] = "/tmp/evo-addressbook-tmp.XXXXXX";
+
+ vcard = e_card_list_get_vcard (cards);
+
+ if (filename)
+ result = e_write_file (filename, vcard, O_CREAT | O_EXCL);
+ else
+ result = e_write_file_mkstemp (tmpname, vcard);
+ printf (tmpname);
+ sync();
+ gtk_exit (result);
+}
+
+static void
+use_addressbook (EBook *book, gpointer closure)
+{
+ if (book == NULL)
+ g_error (_("Error loading default addressbook."));
+ e_book_simple_query (book, "(contains \"x-evolution-any-field\" \"\")", save_cards, closure);
+}
+
+int
+main (int argc, char *argv[])
+{
+ char *filename = NULL;
+
+ struct poptOption options[] = {
+ { "output-file", '\0', POPT_ARG_STRING, &filename, 0, N_("Output File"), NULL },
+ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, &oaf_popt_options, 0, NULL, NULL },
+ POPT_AUTOHELP
+ { NULL, '\0', 0, NULL, 0, NULL, NULL }
+ };
+
+ bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR);
+ textdomain (PACKAGE);
+
+ gnome_init_with_popt_table ("evolution-addressbook-clean", "0.0",
+ argc, argv, options, 0, NULL);
+ oaf_init (argc, argv);
+
+ if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
+ g_error (_("Could not initialize Bonobo"));
+
+ e_book_use_local_address_book (use_addressbook, filename);
+
+ bonobo_main ();
+
+ return 0;
+}
h=EVOLUTION_2_29_91&id=0b6c6f6e5b2f4486a1955af2669604fa23f46183'>Add gnome-vfs-module-2.0 to Evo compile flags forHarish Krishnaswamy2005-01-082-1/+5 * shushJP Rosevear2005-01-081-0/+5 * Updated Lithuanian translation.Žygimantas Beručka2005-01-082-3208/+3871 * Add libedataserverui to the e-util libs and cflags.Hans Petter Jansson2005-01-082-1/+5 * scriptyFunda Wang2005-01-081-906/+1303 * new protosJP Rosevear2005-01-084-9/+202 * ensure there is only one attendee in the RSVP even if the user isJP Rosevear2005-01-082-2/+14 * clear the attendees, somehow I remove this in an earlier commitJP Rosevear2005-01-083-1/+8 * put a name to the 'Send options' frame.Rodrigo Moya2005-01-085-30/+43 * set the dialog's parent.Rodrigo Moya2005-01-082-0/+7 * protosJP Rosevear2005-01-084-22/+124 * use the new ECategoriesDialog in libedataserverui.Rodrigo Moya2005-01-082-10/+9 * define EDS's datadir, needed to get to the Locations.xml file.Rodrigo Moya2005-01-083-9/+20 * define weatherdatadir here, no need to use e-d-s's one, use evolution'sRodrigo Moya2005-01-082-6/+12 * removed weatherdatadir definition here.Rodrigo Moya2005-01-082-5/+4 * add protosJP Rosevear2005-01-074-21/+205 * Translation updated.Priit Laes2005-01-072-5461/+6360 * MissingRodrigo Moya2005-01-072-0/+4 * added calendar-weather plugin to build.David Trowbridge2005-01-072-1/+11 * initial import of ECalEvent targetsDavid Trowbridge2005-01-074-0/+270 * Initial import of weather properties pluginDavid Trowbridge2005-01-0711-0/+833 * Translation updated by Ivar Smolin.Priit Laes2005-01-072-499/+380 * remove old code, setup transient parent and weak ref for refresh. someNot Zed2005-01-074-18/+14 * Add the GTK_DIALOG_NOSEPARATOR flag, and set appropriate border widthsRodney Dawes2005-01-072-1/+14 * add some uninstall rules for local dataJP Rosevear2005-01-072-0/+14 * install schemas properlyJP Rosevear2005-01-072-1/+5 * install schemas properlyJP Rosevear2005-01-072-1/+5 * install schemas properlyJP Rosevear2005-01-072-1/+5 * install schemas properly and add some uninstall rules for local installJP Rosevear2005-01-072-1/+16 * Handle the CamelOfflineStore case just like the CamelDiscoStore case.Jeffrey Stedfast2005-01-073-22/+53 * dist the glade fileJP Rosevear2005-01-062-0/+5 * include top_srcdirJP Rosevear2005-01-062-0/+5 * use the base name only, so if a full path is passed to us we still writeJP Rosevear2005-01-062-2/+11 * Commiting send optionsChenthill Palanisamy2005-01-0612-7/+588 * Commiting the files mentioned below again to HEAD since it was not addedChenthill Palanisamy2005-01-064-0/+1939 * merging send optionsChenthill Palanisamy2005-01-062-0/+12 * fix build for non gtk file chooser caseJP Rosevear2005-01-062-1/+6 * Dist the errors data properly, and add the .eplug output file toRodney Dawes2005-01-062-2/+8 * Remove mail-errors.xml (the .h belongs here, not the straight .xmlRodney Dawes2005-01-052-1/+5 * added a new argument to pass the calendar client, since it might happen toRodrigo Moya2005-01-053-4/+27 * Add the widget target, missed this.Not Zed2005-01-052-0/+11 * turn off debug, setup g private instance data structure. (setup_ui):Not Zed2005-01-052-3/+46 * add a semi-dummy target for widget target.Not Zed2005-01-053-0/+34 * handle the "reply" parameter, if set.Not Zed2005-01-053-9/+35 * -uu-:---F1 POTFILES.in (FundamentalJP Rosevear2005-01-052-5/+4 * new protos, modesJP Rosevear2005-01-057-36/+419 * add component button view itemsJP Rosevear2005-01-055-5/+38 * remove dead filesJP Rosevear2005-01-057-347/+4 * use the new e-categories API in e-d-s.Rodrigo Moya2005-01-052-1/+7 * removed most of the API. The rest will be removed as the GAL dependenciesRodrigo Moya2005-01-053-114/+15 * search our internal data for the correct event.Rodrigo Moya2005-01-052-2/+26 * Use standard error messagesPhilip Van Hoof2005-01-043-34/+14 * Use standard error messagesPhilip Van Hoof2005-01-042-17/+8 * add a11y name to calendar sidebar selector. add a11y name to task sidebarHarry Lu2005-01-043-0/+13 * add atk name for the treeview.Mengjie Yu2005-01-042-0/+9 * Modify the changelog's entry date to corret year.Harry Lu2005-01-041-1/+1 * add ea-combo-button.[ch] to Makefile.Harry Lu2005-01-046-1/+224 * new internal function to popup the menu. (impl_button_press_event): callHarry Lu2005-01-043-4/+61 * Don't do set_usize () on the containerRodney Dawes2005-01-042-1/+5 * load accountsJP Rosevear2005-01-042-0/+7 * remove unused messageJP Rosevear2005-01-043-9/+12 * implement cancel (update_item): add cancel info itemJP Rosevear2005-01-042-7/+19 * Fixes #69663JP Rosevear2005-01-042-1/+18 * utility routine to make it easier to add info itemsJP Rosevear2005-01-044-30/+74 * add itip-formatter to the "all" list, its not ready to be in the base yetJP Rosevear2005-01-042-2/+9 * move the adjust item work here when we actually have the calendarJP Rosevear2005-01-042-59/+60 * move the adjust item work here when we actually have the calendarJP Rosevear2005-01-042-5/+45 * add response enumsJP Rosevear2005-01-047-35/+288 * new protos, signalJP Rosevear2005-01-034-114/+749 * redo the queries after emitting the 'time_range_changed' signal, since nowRodrigo Moya2005-01-034-24/+19 * Warning when overwriting filePhilip Van Hoof2005-01-034-10/+60 * Warning when overwriting filePhilip Van Hoof2005-01-032-1/+30 * Fixing bug 61068 (removing a white space in a string)Andre Klapper2005-01-032-1/+6 * scriptyFunda Wang2005-01-021-90/+153 * add necessary includeJP Rosevear2005-01-0110-57/+114 * Updated Bulgarian translation by myselfAlexander Shopov2004-12-302-745/+293 * new protosJP Rosevear2004-12-305-40/+953 * 2.0 is the current stable version.Rodrigo Moya2004-12-302-1/+6 * Updated Bulgarian translation by Vladimir Petkov <vpetkov@i-space.org>Alexander Shopov2004-12-292-5190/+6417 * s/strcmp/strncmp.David Trowbridge2004-12-283-3/+9 * removed superfluous if check. (e_cal_view_objects_modified_cb): add allRodrigo Moya2004-12-272-6/+8 * set fields we free to NULL.Rodrigo Moya2004-12-272-0/+7 * kill warnings (map_default_cb): the to entry widget is now just a gtkJP Rosevear2004-12-242-13/+12 * Updated Simplified Chinese translationFunda Wang2004-12-241-623/+911 * Make intltool happy. Removed serveral non-exists file references.Funda Wang2004-12-242-58/+87 * set start_offline gconf key when ever offline state is changed.Sivaiah Nallaagatla2004-12-242-4/+15 * typo correctionHarish Krishnaswamy2004-12-241-1/+1 * Check for the existence of the meet/sched pages before attempting toHarish Krishnaswamy2004-12-242-2/+9 * Merging offline brnach with HEADSivaiah Nallagatla2004-12-242-0/+50 * Merge from offline brnachSivaiah Nallagatla2004-12-244-12/+104 * get instance times using the correct timezone. (redo_queries): emitRodrigo Moya2004-12-231-39/+0 * get instance times using the correct timezone. (redo_queries): emitRodrigo Moya2004-12-234-97/+56 * This is the last we see of ESelectNames.Hans Petter Jansson2004-12-2330-7290/+34 * Remove select-names from here.Hans Petter Jansson2004-12-233-6/+10 * Remove select-names from Makefile output list.Hans Petter Jansson2004-12-232-1/+4 * No more select-names. (libevolution_addressbook_la_LIBADD): RemoveHans Petter Jansson2004-12-234-18/+13 * Correct bad include.Hans Petter Jansson2004-12-233-14/+9 * Unref the name selector. (e_contact_list_editor_save_contact): Fix aHans Petter Jansson2004-12-2316-460/+525 * prevent compare against null default_fb_uri and fix thinkoJP Rosevear2004-12-232-1/+6 * Initial checkin of new itip formatterJP Rosevear2004-12-237-0/+1135 * list format-handler.h as a source so it distsJP Rosevear2004-12-222-1/+11 * Change copyright from ximian to novellJP Rosevear2004-12-222-1/+5 * add translation stuff.Not Zed2004-12-222-1/+13 * moved to after emae_authtype_changed to fix warning.Not Zed2004-12-227-29/+48 * translate strings based on translation-domain, if supplied.Not Zed2004-12-222-9/+29 * svn path=/trunk/; revision=28178Not Zed2004-12-223-2/+8 * svn path=/trunk/; revision=28177Not Zed2004-12-228-8/+24 * api changes.Not Zed2004-12-224-3/+13 * include config.h.Not Zed2004-12-224-4/+34 * Fixes #61077JP Rosevear2004-12-223-2/+10 * Fixes #61076JP Rosevear2004-12-223-3/+13 * Fixes #61975JP Rosevear2004-12-222-20/+7 * Fixes #30992JP Rosevear2004-12-222-1/+8 * Fixes #29309JP Rosevear2004-12-222-3/+18 * Fixes #41624JP Rosevear2004-12-222-1/+8 * no need to convert times now. (add_instance_cb): no need to convert here.Rodrigo Moya2004-12-222-29/+23 * Merge from recurrences-work-branchRodrigo Moya2004-12-226-243/+309 * convert to G_DEFINE_TYPEJP Rosevear2004-12-213-37/+33 * Convert to G_DEFINE_TYPEJP Rosevear2004-12-2111-146/+90 * Fix spacingJP Rosevear2004-12-211-1/+2 * convert to G_DEFINE_TYPEJP Rosevear2004-12-214-31/+27 * if we're turned on, then record the current authtype setting on theNot Zed2004-12-212-8/+41 * bump version, requiresJP Rosevear2004-12-214-45/+169 * add mail/default/ja/Makefile mail/default/nl/Makefile to AC_OUTPUT sectionSivaiah Nallagatla2004-12-201-0/+2 * Translation updated.Vincent van Adrighem2004-12-202-1/+5 * Code splitup, each format has it's own c-file Added. Code splitup Added.Philip Van Hoof2004-12-207-566/+1258 * Updated vi.poNguyen Thai Ngoc Duy2004-12-20