ksync Library API Documentation

main.cpp

00001 
00002 #include <kcmdlineargs.h>
00003 #include <kaboutdata.h>
00004 #include <klocale.h>
00005 #include <kglobal.h>
00006 
00007 #include "ksync.h"
00008 
00009 
00010 static const char *description =
00011         I18N_NOOP("KSync");
00012 // INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
00013 
00014 
00015 static KCmdLineOptions options[] =
00016 {
00017   { "+[File]", I18N_NOOP("file to open"), 0 },
00018   { 0, 0, 0 }
00019   // INSERT YOUR COMMANDLINE OPTIONS HERE
00020 };
00021 
00022 int main(int argc, char *argv[])
00023 {
00024 
00025         KAboutData aboutData( "ksync", I18N_NOOP("KSync"),
00026                           "0.1", description, KAboutData::License_GPL,
00027                           "(c) 2001, Cornelius Schumacher", 0, 0, "schumacher@kde.org");
00028         aboutData.addAuthor("Cornelius Schumacher",0, "schumacher@kde.org");
00029         KCmdLineArgs::init( argc, argv, &aboutData );
00030         KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
00031 
00032     KApplication app;
00033     KGlobal::locale()->insertCatalogue("libksync");
00034 
00035     if (app.isRestored())
00036     {
00037         RESTORE(KSync);
00038     }
00039     else
00040     {
00041         KSync *ksync = new KSync();
00042         ksync->show();
00043 
00044         KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00045 
00046         if (args->count())
00047         {
00048             ksync->openDocumentFile(args->arg(0));
00049         }
00050         else
00051         {
00052             ksync->openDocumentFile();
00053         }
00054         args->clear();
00055     }
00056 
00057     return app.exec();
00058 }
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:48 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001