ksync Library API Documentation

main.cpp

00001 /*
00002     This file is part of ksync.
00003 
00004     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #include <kcmdlineargs.h>
00023 #include <kaboutdata.h>
00024 #include <klocale.h>
00025 #include <kglobal.h>
00026 
00027 #include "ksync.h"
00028 
00029 
00030 static const char description[] =
00031     I18N_NOOP("KSync");
00032 
00033 static KCmdLineOptions options[] =
00034 {
00035   { "+[File]", I18N_NOOP("file to open"), 0 },
00036   KCmdLineLastOption
00037   // INSERT YOUR COMMANDLINE OPTIONS HERE
00038 };
00039 
00040 int main(int argc, char *argv[])
00041 {
00042 
00043     KAboutData aboutData( "ksync", I18N_NOOP("KSync"),
00044                           "0.1", description, KAboutData::License_GPL,
00045                           "(c) 2001, Cornelius Schumacher", 0, 0, "schumacher@kde.org");
00046     aboutData.addAuthor("Cornelius Schumacher",0, "schumacher@kde.org");
00047     KCmdLineArgs::init( argc, argv, &aboutData );
00048     KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
00049 
00050     KApplication app;
00051     KGlobal::locale()->insertCatalogue("libksync");
00052 
00053     if (app.isRestored())
00054     {
00055         RESTORE(KSync);
00056     }
00057     else
00058     {
00059         KSync *ksync = new KSync();
00060         ksync->show();
00061 
00062         KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00063 
00064         if (args->count())
00065         {
00066             ksync->openDocumentFile(args->url(0));
00067         }
00068         else
00069         {
00070             ksync->openDocumentFile();
00071         }
00072         args->clear();
00073     }
00074 
00075     return app.exec();
00076 }
KDE Logo
This file is part of the documentation for ksync Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:37 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003