From kde-commits Sun Oct 01 17:46:08 2006 From: =?utf-8?q?Friedrich=20W=2E=20H=2E=20Kossebau?= Date: Sun, 01 Oct 2006 17:46:08 +0000 To: kde-commits Subject: playground/pim/contactsapplet/contactcards Message-Id: <1159724768.135221.26192.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=115972478515409 SVN commit 591093 by kossebau: split into simple looking modules M +2 -4 Makefile.am A about.cpp [License: GPL (v2)] A about.h [License: LGPL (v2)] M +5 -49 main.cpp A program.cpp [License: GPL (v2)] A program.h [License: LGPL (v2)] --- trunk/playground/pim/contactsapplet/contactcards/Makefile.am #591092:591093 @@ -14,13 +14,11 @@ $(LIB_KDEUI) $(LIB_KABC) noinst_HEADERS = \ - cardwindow.h cardwindowmanager.h -# contactcards.h + about.h program.h cardwindow.h cardwindowmanager.h contactcards_SOURCES = \ cardwindow.cpp cardwindowmanager.cpp cardwindowmanager.skel \ - main.cpp -# contactcards.cpp + about.cpp program.cpp main.cpp xdg_apps_DATA = contactcards.desktop --- trunk/playground/pim/contactsapplet/contactcards/main.cpp #591092:591093 @@ -18,60 +18,16 @@ */ -// kde specific -#include -#include -#include -#include -// app specific -#include "cardwindowmanager.h" +// program specific +#include "program.h" -// Program -static const char ProgramId[] = "contactcards"; -static const char ProgramName[] = I18N_NOOP("ContactCards"); -static const char ProgramDescription[] = I18N_NOOP("Viewer for Contact Cards"); -static const char ProgramVersion[] = "0.0.1"; -static const char ProgramCopyright[] = "(C) 2006 Friedrich W. H. Kossebau"; -static const char ProgramComment[] = I18N_NOOP("ContactCards shows interactive cards of your contacts"); -// Author -static const char FWHKName[] = "Friedrich W. H. Kossebau"; -static const char FWHKTask[] = I18N_NOOP("Author"); -static const char FWHKEmailAddress[] = "Friedrich.W.H@Kossebau.de"; -static KCmdLineOptions ProgramOptions[] = -{ - { "+[UID]", I18N_NOOP( "UID of Contact to show." ), 0 }, - KCmdLineLastOption -}; - - int main( int argc, char *argv[] ) { - KAboutData AboutData( ProgramId, ProgramName, ProgramVersion, ProgramDescription, - KAboutData::License_GPL_V2, ProgramCopyright, ProgramComment, 0, FWHKEmailAddress ); - AboutData.addAuthor( FWHKName, FWHKTask, FWHKEmailAddress ); + ContactCardsProgram Program( argc, argv ); - KCmdLineArgs::init( argc, argv, &AboutData ); - KCmdLineArgs::addCmdLineOptions( ProgramOptions ); - KUniqueApplication::addCmdLineOptions(); + int Result = Program.execute(); - if( !KUniqueApplication::start() ) - exit( 0 ); //TODO: send arguments to running instance? - - KCmdLineArgs *Args = KCmdLineArgs::parsedArgs(); - if( Args->count() > 0 ) - { - for( int i=0; icount(); ++i ) - ; - } - Args->clear(); - - KUniqueApplication Program; - - //if( Program.isRestored() ) - CardWindowManager *Server = new CardWindowManager; - Program.dcopClient()->setDefaultObject( "ContactCardsIf" ); - - return Program.exec(); + return Result; }