~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to src/rpc/CRPCServer.cpp

  • Committer: Nathan Osman
  • Date: 2012-07-05 02:31:40 UTC
  • Revision ID: admin@quickmediasolutions.com-20120705023140-5xazd0wewmksckts
Implemented single RPC method and added Nautilus extension.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
CRPCServer::CRPCServer()
23
23
{
 
24
    /* Register the methods we allow. Notice that we use List when
 
25
       we expect a list of strings and not StringList. */
 
26
    registerMethod("SendFiles", QVariant::Bool, QVariant::List);
 
27
 
24
28
    connect(this, SIGNAL(incomingRequest(int,QString,QList<xmlrpc::Variant>)),
25
29
                  SLOT(OnRequest(int,QString,QList<xmlrpc::Variant>)));
26
30
}
39
43
 
40
44
void CRPCServer::OnRequest(int request_id, QString method_name, QList<xmlrpc::Variant> parameters)
41
45
{
42
 
    //...
 
46
    qDebug() << "RPC call to" << method_name;
 
47
 
 
48
    if(method_name == "SendFiles")
 
49
    {
 
50
        emit SendFiles(parameters.at(0).toStringList(), "");
 
51
        sendReturnValue(request_id, true);
 
52
    }
43
53
}