~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/app_templates/kofficepart/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
 
3
   It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
 
4
*/
 
5
 
 
6
#include <koApplication.h>
 
7
#include <koDocument.h>
 
8
#include <koMainWindow.h>
 
9
#include <kcmdlineargs.h>
 
10
#include <klocale.h>
 
11
#include <dcopclient.h>
 
12
#include "%{APPNAMELC}_aboutdata.h"
 
13
 
 
14
 
 
15
static const KCmdLineOptions options[]=
 
16
{
 
17
        {"+[file]", I18N_NOOP("File to open"),0},
 
18
        KCmdLineLastOption
 
19
};
 
20
 
 
21
int main( int argc, char **argv )
 
22
{
 
23
    KCmdLineArgs::init( argc, argv, new%{APPNAME}AboutData() );
 
24
    KCmdLineArgs::addCmdLineOptions( options );
 
25
    KoApplication app;
 
26
 
 
27
    app.dcopClient()->attach();
 
28
    app.dcopClient()->registerAs( "%{APPNAMELC}" );
 
29
 
 
30
    if (!app.start()) // parses command line args, create initial docs and shells
 
31
        return 1;
 
32
    return app.exec();
 
33
}