mirror of https://github.com/BOINC/boinc.git
- MGR: Fix the application name for both views.
NOTE: the data type 'char' should NOT be used within the various views. This is the classic example of how direct data access messes things up in projects with many developers. Use wxString with the PrintF method instead. clientgui/ ViewWork.cpp ViewWorkGrid.cpp svn path=/trunk/boinc/; revision=15574
This commit is contained in:
parent
cbde755a32
commit
0fd57fa3f6
|
@ -5588,3 +5588,14 @@ Eric K 8 July 2008
|
|||
client/
|
||||
cs_platforms.C
|
||||
|
||||
Rom 8 July 2008
|
||||
- MGR: Fix the application name for both views.
|
||||
|
||||
NOTE: the data type 'char' should NOT be used within the various
|
||||
views. This is the classic example of how direct data access
|
||||
messes things up in projects with many developers. Use wxString
|
||||
with the PrintF method instead.
|
||||
|
||||
clientgui/
|
||||
ViewWork.cpp
|
||||
ViewWorkGrid.cpp
|
||||
|
|
|
@ -735,7 +735,8 @@ void CViewWork::GetDocApplicationName(wxInt32 item, wxString& strBuffer) const {
|
|||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
RESULT* result = wxGetApp().GetDocument()->result(item);
|
||||
RESULT* state_result = NULL;
|
||||
wxString strLocalBuffer;
|
||||
wxString strAppBuffer = wxEmptyString;
|
||||
wxString strClassBuffer = wxEmptyString;
|
||||
|
||||
wxASSERT(pDoc);
|
||||
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
||||
|
@ -750,23 +751,27 @@ void CViewWork::GetDocApplicationName(wxInt32 item, wxString& strBuffer) const {
|
|||
|
||||
wxString strLocale = wxString(setlocale(LC_NUMERIC, NULL), wxConvUTF8);
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
||||
if (state_result->wup->app->user_friendly_name.size()) {
|
||||
strLocalBuffer = HtmlEntityDecode(wxString(state_result->app->user_friendly_name.c_str(), wxConvUTF8));
|
||||
strAppBuffer = HtmlEntityDecode(wxString(state_result->app->user_friendly_name.c_str(), wxConvUTF8));
|
||||
} else {
|
||||
strLocalBuffer = HtmlEntityDecode(wxString(state_result->wup->avp->app_name.c_str(), wxConvUTF8));
|
||||
strAppBuffer = HtmlEntityDecode(wxString(state_result->wup->avp->app_name.c_str(), wxConvUTF8));
|
||||
}
|
||||
char buf[256];
|
||||
|
||||
if (state_result->wup->avp->plan_class.size()) {
|
||||
sprintf(buf, " (%s)", state_result->wup->avp->plan_class.c_str());
|
||||
} else {
|
||||
strcpy(buf, "");
|
||||
strClassBuffer.Printf(
|
||||
wxT(" (%s)"),
|
||||
wxString(state_result->wup->avp->plan_class.c_str(), wxConvUTF8)
|
||||
);
|
||||
}
|
||||
|
||||
strBuffer.Printf(
|
||||
wxT(" %s %.2f%s"),
|
||||
strLocalBuffer.c_str(),
|
||||
strAppBuffer.c_str(),
|
||||
state_result->wup->avp->version_num/100.0,
|
||||
buf
|
||||
strClassBuffer.c_str()
|
||||
);
|
||||
|
||||
setlocale(LC_NUMERIC, (const char*)strLocale.mb_str());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -599,7 +599,8 @@ wxInt32 CViewWorkGrid::FormatApplicationName(wxInt32 item, wxString& strBuffer)
|
|||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
RESULT* result = wxGetApp().GetDocument()->result(item);
|
||||
RESULT* state_result = NULL;
|
||||
wxString strLocalBuffer;
|
||||
wxString strAppBuffer = wxEmptyString;
|
||||
wxString strClassBuffer = wxEmptyString;
|
||||
|
||||
wxASSERT(pDoc);
|
||||
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
||||
|
@ -614,23 +615,27 @@ wxInt32 CViewWorkGrid::FormatApplicationName(wxInt32 item, wxString& strBuffer)
|
|||
|
||||
wxString strLocale = wxString(setlocale(LC_NUMERIC, NULL), wxConvUTF8);
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
||||
if (state_result->wup->app->user_friendly_name.size()) {
|
||||
strLocalBuffer = HtmlEntityDecode(wxString(state_result->app->user_friendly_name.c_str(), wxConvUTF8));
|
||||
strAppBuffer = HtmlEntityDecode(wxString(state_result->app->user_friendly_name.c_str(), wxConvUTF8));
|
||||
} else {
|
||||
strLocalBuffer = HtmlEntityDecode(wxString(state_result->wup->avp->app_name.c_str(), wxConvUTF8));
|
||||
strAppBuffer = HtmlEntityDecode(wxString(state_result->wup->avp->app_name.c_str(), wxConvUTF8));
|
||||
}
|
||||
char buf[256];
|
||||
|
||||
if (state_result->wup->avp->plan_class.size()) {
|
||||
sprintf(buf, " (%s)", state_result->wup->avp->plan_class.c_str());
|
||||
} else {
|
||||
strcpy(buf, "");
|
||||
strClassBuffer.Printf(
|
||||
wxT(" (%s)"),
|
||||
wxString(state_result->wup->avp->plan_class.c_str(), wxConvUTF8)
|
||||
);
|
||||
}
|
||||
|
||||
strBuffer.Printf(
|
||||
wxT(" %s %.2f%s"),
|
||||
strLocalBuffer.c_str(),
|
||||
strAppBuffer.c_str(),
|
||||
state_result->wup->avp->version_num/100.0,
|
||||
buf
|
||||
strClassBuffer.c_str()
|
||||
);
|
||||
|
||||
setlocale(LC_NUMERIC, (const char*)strLocale.mb_str());
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue