| # kabc Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# bigwrite.cpp

    00001 #include <kaboutdata.h>
    00002 #include <kapplication.h>
    00003 #include <kdebug.h>
    00004 #include <klocale.h>
    00005 #include <kcmdlineargs.h>
    00006
    00007 #include "addressbook.h"
    00008 #include "vcardformat.h"
    00009 #include "resourcefile.h"
    00010
    00011 using namespace KABC;
    00012
    00013 int main(int argc,char **argv)
    00014 {
    00015   KAboutData aboutData("bigtest","BigTestKabc","0.1");
    00016   KCmdLineArgs::init(argc,argv,&aboutData);
    00017
    00018   KApplication app;
    00019
    00020   AddressBook ab;
    00021   ResourceFile r( &ab, "my.kabc" );
    00022   ab.addResource( &r );
    00023
    00024   for( int i = 0; i < 1000; ++i ) {
    00025     Addressee a;
    00026     a.setGivenName( "number" + QString::number( i ) );
    00027     a.setFamilyName( "Name" );
    00028     a.insertEmail( QString::number( i ) + "@domain" );
    00029
    00030     ab.insertAddressee( a );
    00031   }
    00032   printf( "\n" );
    00033
    00034   Ticket *t = ab.requestSaveTicket( &r );
    00035   if ( t ) {
    00036     if ( !ab.save( t ) ) {
    00037       kdDebug() << "Can't save." << endl;
    00038     }
    00039   } else {
    00040     kdDebug() << "No ticket for save." << endl;
    00041   }
    00042 }

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:29:18 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001