コード例 #1
0
ファイル: taskeditor.cpp プロジェクト: martamius/mushi
void TaskEditor::refreshFromServer(){
    ServerCommand *command =new ServerCommand(this);
    command->set("command","getTask");
    command->set("taskID",this->store.get("id","").asCString());
    this->connect(command,SIGNAL(saveComplete(Json::Value)),this,SLOT(refreshFromServerComplete(Json::Value)));
    this->connect(command,SIGNAL(saveComplete(Json::Value)),command,SLOT(deleteLater()));
    command->send();
}
コード例 #2
0
ファイル: taskeditor.cpp プロジェクト: martamius/mushi
void TaskEditor::setStore(Json::Value &s, bool getNotes){
    this->store=s;
    //remove all notes
    while(this->notes.length()){
        this->notes.takeFirst()->deleteLater();
    }
    if(this->store.get("id","")!="" && getNotes){
        ServerCommand *command =new ServerCommand(this);
        command->set("command","getTaskNotes");
        command->set("taskID",this->store.get("id","").asCString());
        this->connect(command,SIGNAL(saveComplete(Json::Value)),this,SLOT(getNotesResponse(Json::Value)));
        this->connect(command,SIGNAL(saveComplete(Json::Value)),command,SLOT(deleteLater()));
        command->send();
    }
    this->updateFromStore();
}