qthighway/xqservice/src/xqaiwfiledriver.cpp
changeset 14 6fbed849b4f4
parent 1 2b40d63a9c3d
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    26 #include "xqaiwutils.h"
    26 #include "xqaiwutils.h"
    27 #include "xqaiwfiledriver.h"
    27 #include "xqaiwfiledriver.h"
    28 
    28 
    29 XQAiwFileDriver::XQAiwFileDriver(const QFile &file, const XQAiwInterfaceDescriptor& descriptor, const QString &operation)
    29 XQAiwFileDriver::XQAiwFileDriver(const QFile &file, const XQAiwInterfaceDescriptor& descriptor, const QString &operation)
    30     : XQAiwRequestDriver(),
    30     : XQAiwRequestDriver(),
    31       mFile(file.fileName()),
       
    32       mUtilities(NULL)
    31       mUtilities(NULL)
    33 {
    32 {
    34 
    33 
    35     mErrorMsg = "";
    34     mErrorMsg = "";
    36     mDescr = descriptor; 
    35     mDescr = descriptor; 
    37     mOperation = operation; 
    36     mOperation = operation;
       
    37     mFile = file.fileName();
    38     
    38     
    39     XQSERVICE_DEBUG_PRINT("XQAiwFileDriver::XQAiwFileDriver: %s",
    39     XQSERVICE_DEBUG_PRINT("XQAiwFileDriver::XQAiwFileDriver: %s",
    40                           qPrintable(file.fileName()));
    40                           qPrintable(file.fileName()));
    41     
    41     
       
    42 }
       
    43 
       
    44 XQAiwFileDriver::XQAiwFileDriver(const XQSharableFile &file, const XQAiwInterfaceDescriptor& descriptor, const QString &operation)
       
    45     : XQAiwRequestDriver(),
       
    46       mUtilities(NULL)
       
    47 {
       
    48 
       
    49     mErrorMsg = "";
       
    50     mDescr = descriptor; 
       
    51     mOperation = operation;
       
    52     mFile = qVariantFromValue(file);
       
    53 
       
    54     XQSERVICE_DEBUG_PRINT("XQAiwFileDriver::XQAiwFileDriver: sharable %s",
       
    55                           qPrintable(file.fileName()));
       
    56 
    42 }
    57 }
    43 
    58 
    44 
    59 
    45 XQAiwFileDriver::~XQAiwFileDriver()
    60 XQAiwFileDriver::~XQAiwFileDriver()
    46 {
    61 {
    73         return false;
    88         return false;
    74     }
    89     }
    75     QVariant applicationId =  mDescr.property(XQAiwInterfaceDescriptor::ImplementationId);
    90     QVariant applicationId =  mDescr.property(XQAiwInterfaceDescriptor::ImplementationId);
    76     XQSERVICE_DEBUG_PRINT("Application id %x", applicationId.toInt());
    91     XQSERVICE_DEBUG_PRINT("Application id %x", applicationId.toInt());
    77 
    92 
    78     // Create space separated command line args
    93     mErrorCode = mUtilities->launchFile(applicationId.toInt(), mFile);
    79     QString args = mUtilities->createCmdlineArgs(mArguments);
       
    80     XQSERVICE_DEBUG_PRINT("args %s", qPrintable(args));
       
    81     
       
    82     mErrorCode = mUtilities->launchApplication(applicationId.toInt(), args);
       
    83     XQSERVICE_DEBUG_PRINT("XQAiwFileDriver::errorCode %d", mErrorCode);
    94     XQSERVICE_DEBUG_PRINT("XQAiwFileDriver::errorCode %d", mErrorCode);
    84     QVariant ret(!mErrorCode);
    95     QVariant ret(!mErrorCode);
    85     retValue = ret;
    96     retValue = ret;
    86     return (!mErrorCode);
    97     return (!mErrorCode);
    87 }
    98 }