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

« back to all changes in this revision

Viewing changes to languages/java/app_templates/kappjava/app_client.java

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}>
3
 
 */
4
 
 
5
 
#include <kapp.h>
6
 
#include <dcopclient.h>
7
 
#include <qdatastream.h>
8
 
#include <qstring.h>
9
 
 
10
 
int main(int argc, char **argv)
11
 
{
12
 
    KApplication app(argc, argv, "%{APPNAMELC}_client", false);
13
 
 
14
 
    // get our DCOP client and attach so that we may use it
15
 
    DCOPClient *client = app.dcopClient();
16
 
    client->attach();
17
 
 
18
 
    // do a 'send' for now
19
 
    QByteArray data;
20
 
    QDataStream ds(data, IO_WriteOnly);
21
 
    if (argc > 1)
22
 
        ds << QString(argv[1]);
23
 
    else
24
 
        ds << QString("http://www.kde.org");
25
 
    client->send("%{APPNAMELC}", "%{APPNAME}Iface", "openURL(QString)", data);
26
 
 
27
 
    return app.exec();
28
 
}