~ubuntu-branches/ubuntu/intrepid/kdesdk/intrepid-updates

« back to all changes in this revision

Viewing changes to kapptemplate/kapp/app_client.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-28 10:11:43 UTC
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: james.westby@ubuntu.com-20080528101143-gzc3styjz1b70zxu
Tags: upstream-4.0.80
ImportĀ upstreamĀ versionĀ 4.0.80

Show diffs side-by-side

added added

removed removed

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