F:/KPlato/koffice/libs/koproperty/test/main.cpp

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #include "test.h"
00021 #include <kapplication.h>
00022 #include <kaboutdata.h>
00023 #include <kcmdlineargs.h>
00024 #include <klocale.h>
00025 
00026 static const char description[] = "A test application for the KoProperty library";
00027 
00028 static const char version[] = "0.2";
00029 
00030 static KCmdLineOptions options[] =
00031 {
00032     { "flat", "Flat display: don't display groups\n(useful for testing)", 0 },
00033     { "ro", "Set all properties as read-only:\n(useful for testing read-only mode)", 0 },
00034     KCmdLineLastOption
00035 };
00036 
00037 int main(int argc, char **argv)
00038 {
00039     KAboutData about("proptest", "KoProperty Test", version, description,
00040                      KAboutData::License_GPL, "(C) 2005 Cedric Pasteur", 0, 0, "cedric.pasteur@free.fr");
00041      about.addAuthor( "Cedric Pasteur", 0, "cedric.pasteur@free.fr" );
00042     KCmdLineArgs::init(argc, argv, &about);
00043     KCmdLineArgs::addCmdLineOptions( options );
00044     KApplication app;
00045     Test *mainWin = 0;
00046 
00047     if (app.isSessionRestored())
00048     {
00049         RESTORE(Test);
00050     }
00051     else
00052     {
00053         // no session.. just start up normally
00054         KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00055 
00057 
00058         mainWin = new Test();
00059         mainWin->show();
00060 
00061         args->clear();
00062     }
00063 
00064     // mainWin has WDestructiveClose flag by default, so it will delete itself.
00065     return app.exec();
00066 }
00067 

Généré le Wed Nov 22 23:41:07 2006 pour KPlato par  doxygen 1.5.1-p1