diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index e42917f6bd..c58d0e1878 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -400,7 +400,10 @@ struct CC_STATE { APP_VERSION* lookup_app_version(PROJECT*, APP*, char* platform, int vnum, char* plan_class ); - APP_VERSION* lookup_app_version_old(PROJECT*, APP*, int); + APP_VERSION* lookup_app_version(PROJECT*, APP*, + int vnum, char* plan_class + ); + APP_VERSION* lookup_app_version(PROJECT*, APP*, int vnum); WORKUNIT* lookup_wu(PROJECT*, const char* name); RESULT* lookup_result(PROJECT*, const char* name); RESULT* lookup_result(const char* url, const char* name); diff --git a/lib/gui_rpc_client_ops.cpp b/lib/gui_rpc_client_ops.cpp index 7a50ca7d7f..9c61020c1c 100644 --- a/lib/gui_rpc_client_ops.cpp +++ b/lib/gui_rpc_client_ops.cpp @@ -703,6 +703,7 @@ void RESULT::clear() { version_num = 0; safe_strcpy(plan_class, ""); safe_strcpy(project_url, ""); + safe_strcpy(platform, ""); safe_strcpy(graphics_exec_path, ""); safe_strcpy(web_graphics_url, ""); safe_strcpy(remote_desktop_addr, ""); @@ -973,13 +974,18 @@ int CC_STATE::parse(XML_PARSER& xp) { } result->app = result->wup->app; APP_VERSION* avp; - if (result->version_num) { + if (strlen(result->platform)) { avp = lookup_app_version( project, result->app, result->platform, result->version_num, result->plan_class ); + } else if (result->version_num) { + avp = lookup_app_version( + project, result->app, + result->version_num, result->plan_class + ); } else { - avp = lookup_app_version_old( + avp = lookup_app_version( project, result->app, result->wup->version_num ); } @@ -1077,7 +1083,22 @@ APP_VERSION* CC_STATE::lookup_app_version( return 0; } -APP_VERSION* CC_STATE::lookup_app_version_old( +APP_VERSION* CC_STATE::lookup_app_version( + PROJECT* project, APP* app, + int version_num, char* plan_class +) { + unsigned int i; + for (i=0; iproject != project) continue; + if (app_versions[i]->app != app) continue; + if (app_versions[i]->version_num != version_num) continue; + if (strcmp(app_versions[i]->plan_class, plan_class)) continue; + return app_versions[i]; + } + return 0; +} + +APP_VERSION* CC_STATE::lookup_app_version( PROJECT* project, APP* app, int version_num ) { unsigned int i;