javamanager/javaappscheme/src.s60/main.cpp
author hgs
Fri, 23 Jul 2010 12:27:20 +0300
changeset 56 abc41079b313
permissions -rw-r--r--
v2.2.7_1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     1
/*
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     3
* All rights reserved.
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     8
*
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
     9
* Initial Contributors:
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    11
*
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    12
* Contributors:
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    13
*
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    14
* Description:  QT Service application the implements support for
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    15
*               starting Java applications using "javaapp:" QUrl
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    16
*
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    17
*/
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    18
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    19
#include <QTimer>
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    20
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    21
#include "logger.h"
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    22
#include "serviceapp.h"
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    23
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    24
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    25
int main(int argc, char **argv)
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    26
{
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    27
    LOG1(EJavaQtServiceApp, EInfo, "javaappscheme main() called with %d args", argc);
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    28
    for (int nInd = 0; nInd < argc; nInd++)
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    29
    {
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    30
        LOG2(EJavaQtServiceApp, EInfo, "javaappscheme main() arg %d is %s", nInd, *(argv + nInd)); 
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    31
    }
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    32
    
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    33
    ServiceApp app(argc, argv);
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    34
   
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    35
    // Close this service app after 14 seconds if no one has called us
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    36
    QTimer::singleShot(14 * 1000, &app, SLOT(quit()));
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    37
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    38
    int ret = app.exec();
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    39
    
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    40
    LOG1(EJavaQtServiceApp, EInfo, "javaappscheme main() exiting with value %d", ret);
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    41
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    42
    return ret;
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    43
}
abc41079b313 v2.2.7_1
hgs
parents:
diff changeset
    44