Commit 97229d95 authored by Ed "oddsock" Zaleski's avatar Ed "oddsock" Zaleski

fixed some display bugs when showing stats

svn path=/trunk/icecast/; revision=5527
parent fe952803
......@@ -484,25 +484,35 @@ void CollectStats(stats_event_t *event)
strcpy(tempSource, event->source);
}
if (strlen(tempSource) == 0) {
strcpy(tempSource, "Global Stat");
}
int foundit = 0;
for (int i=0;i<numMainStats;i++) {
if (!strcmp(gStats[i].source, tempSource)) {
int foundit2 = 0;
gStats[i].populated = 1;
for (int j=0;j<gStats[i].numStats;j++) {
if (gStats[i].stats[j].name == tempElement.name) {
if (!strcmp(tempSource, "Global Stat")) {
if (gStats[i].stats[0].name == tempElement.name) {
gStats[i].stats[0].value = tempElement.value;
}
}
else {
if (!strcmp(gStats[i].source, tempSource)) {
int foundit2 = 0;
gStats[i].populated = 1;
for (int j=0;j<gStats[i].numStats;j++) {
if (gStats[i].stats[j].name == tempElement.name) {
gStats[i].stats[j].value = tempElement.value;
foundit2 = 1;
}
}
if (!foundit2) {
gStats[i].stats[j].name = tempElement.name;
gStats[i].stats[j].value = tempElement.value;
foundit2 = 1;
gStats[i].numStats++;
}
foundit = 1;
}
if (!foundit2) {
gStats[i].stats[j].name = tempElement.name;
gStats[i].stats[j].value = tempElement.value;
gStats[i].numStats++;
}
foundit = 1;
}
}
if (!foundit) {
......@@ -871,6 +881,7 @@ void CIcecast2winDlg::UpdateStatsLists()
lvi.iSubItem = 2;
lvi.pszText = (LPTSTR)(LPCTSTR)gStats[i].stats[k].value;
statusTab.m_GlobalStatList.SetItem(&lvi);
break;
}
if (gStats[i].stats[k].titleFlag) {
CString windowTitle = gStats[i].source + " - " + gStats[i].stats[k].name + " - " + gStats[i].stats[k].value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment