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
00013
00014
00015 static KCmdLineOptions options[] =
00016 {
00017 { "+[File]", I18N_NOOP("file to open"), 0 },
00018 { 0, 0, 0 }
00019
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 );
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 }
This file is part of the documentation for kdelibs Version 3.1.4.