From 8cdf5b6c32657316904bef54652a18ec0339d39e Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 30 Sep 2008 10:34:56 +0000 Subject: [PATCH] lib: eliminate 2 obsolete RPC calls. svn path=/trunk/boinc/; revision=16095 --- checkin_notes | 5 ++ lib/gui_rpc_client.h | 2 - lib/gui_rpc_client_ops.cpp | 112 ------------------------------------- 3 files changed, 5 insertions(+), 114 deletions(-) diff --git a/checkin_notes b/checkin_notes index 352cac9619..abfc9e4e53 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7859,6 +7859,8 @@ Charlie 29 Sep 2008 Charlie 30 Sep 2008 - MGR: async GUI RPCs: eliminate redundant RPC calls in SimpleGUI. + - lib: eliminate obsolete RPC_CLIENT::get_project_status(CC_STATE& state), + RPC_CLIENT::get_simple_gui_info(CC_STATE& state, RESULTS& results). clientgui/ AsyncRPC.cpp @@ -7867,3 +7869,6 @@ Charlie 30 Sep 2008 sg_ClientStateIndicator.cpp sg_ProjectsComponent.cpp sg_StatImageLoader.cpp + lib/ + gui_rpc_client.h + gui_rpc_client_ops.C diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index 9ce8d1047e..ec4bd7b6e2 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -559,8 +559,6 @@ public: int get_results(RESULTS&); int get_file_transfers(FILE_TRANSFERS&); int get_simple_gui_info(SIMPLE_GUI_INFO&); - int get_simple_gui_info(CC_STATE&, RESULTS&); - int get_project_status(CC_STATE&); int get_project_status(PROJECTS&); int get_all_projects_list(ALL_PROJECTS_LIST&); int get_disk_usage(DISK_USAGE&); diff --git a/lib/gui_rpc_client_ops.cpp b/lib/gui_rpc_client_ops.cpp index bf86f7aade..45d6f14dcf 100644 --- a/lib/gui_rpc_client_ops.cpp +++ b/lib/gui_rpc_client_ops.cpp @@ -1199,68 +1199,6 @@ int RPC_CLIENT::get_simple_gui_info(SIMPLE_GUI_INFO& sgi) { } -// Updates the PROJECT array in the CC_STATE in place; -// flags any projects that don't exist anymore. -// -int RPC_CLIENT::get_simple_gui_info(CC_STATE& state, RESULTS& results) { - int retval; - SET_LOCALE sl; - char buf[256]; - unsigned int i; - static PROJECT project; - PROJECT* state_project = NULL; - RPC rpc(this); - - results.clear(); - - retval = rpc.do_rpc("\n"); - if (!retval) { - - // mark all projects for deletion (undo if client still has them) - // - for (i=0; iflag_for_delete = true; - } - - while (rpc.fin.fgets(buf, 256)) { - if (match_tag(buf, "")) break; - else if (match_tag(buf, "")) { - project.clear(); - project.parse(rpc.fin); - state_project = state.lookup_project(project.master_url); - if (state_project && (project.master_url == state_project->master_url)) { - state_project->copy(project); - state_project->flag_for_delete = false; - } else { - retval = ERR_NOT_FOUND; - } - continue; - } - else if (match_tag(buf, "")) { - RESULT* result = new RESULT(); - result->parse(rpc.fin); - results.results.push_back(result); - continue; - } - } - - // Does any project need to be deleted? - // return cryptic error code if so - // - if (!retval) { - for (i=0; iflag_for_delete) { - retval = ERR_FILE_MISSING; - } - } - } - - } - return retval; -} - // creates new array of PROJECTs // int RPC_CLIENT::get_project_status(PROJECTS& p) { @@ -1286,56 +1224,6 @@ int RPC_CLIENT::get_project_status(PROJECTS& p) { return retval; } -// Updates the PROJECT array in the CC_STATE in place; -// flags any projects that don't exist anymore. -// KLUDGE - doesn't belong here -// -int RPC_CLIENT::get_project_status(CC_STATE& state) { - int retval; - SET_LOCALE sl; - unsigned int i; - char buf[256]; - static PROJECT project; - PROJECT* state_project = NULL; - RPC rpc(this); - - retval = rpc.do_rpc("\n"); - if (!retval) { - // flag for delete - for (i=0; iflag_for_delete = true; - } - - while (rpc.fin.fgets(buf, 256)) { - if (match_tag(buf, "")) break; - else if (match_tag(buf, "")) { - project.clear(); - project.parse(rpc.fin); - state_project = state.lookup_project(project.master_url); - if (state_project && (project.master_url == state_project->master_url)) { - state_project->copy(project); - state_project->flag_for_delete = false; - } else { - retval = ERR_NOT_FOUND; - } - continue; - } - } - - // Anything need to be deleted? - if (!retval) { - for (i=0; iflag_for_delete) { - retval = ERR_FILE_MISSING; - } - } - } - } - return retval; -} - int RPC_CLIENT::get_all_projects_list(ALL_PROJECTS_LIST& pl) { int retval = 0; SET_LOCALE sl;