[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/pim/contactsapplet/contactcards
From:       Friedrich W. H. Kossebau <Friedrich.W.H () Kossebau ! de>
Date:       2006-10-01 17:46:08
Message-ID: 1159724768.135221.26192.nullmailer () svn ! kde ! org
[Download RAW message or body]

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 <kuniqueapplication.h>
-#include <dcopclient.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-// 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; i<Args->count(); ++i )
-        ;
-    }
-    Args->clear();
-
-    KUniqueApplication Program;
-
-    //if( Program.isRestored() )
-    CardWindowManager *Server = new CardWindowManager;
-    Program.dcopClient()->setDefaultObject( "ContactCardsIf" );
-
-    return Program.exec();
+    return Result;
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic