From bc8e133c24097757083dc6ed1641cc769359292a Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 20 Jan 2006 23:45:17 +0000 Subject: [PATCH] Display server names --- vdr.h | 1 - vserverselect.cc | 8 ++++---- vserverselect.h | 5 ++++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/vdr.h b/vdr.h index d63b1f5..9111d2c 100644 --- a/vdr.h +++ b/vdr.h @@ -63,7 +63,6 @@ struct ServerSorter { bool operator() (const VDRServer a, const VDRServer b) { - printf("%s %s\n", a.name, b.name); if (strcmp(b.name, a.name) > 0) return true; return false; } diff --git a/vserverselect.cc b/vserverselect.cc index 4718f60..f6bfb5c 100644 --- a/vserverselect.cc +++ b/vserverselect.cc @@ -20,7 +20,7 @@ #include "vserverselect.h" -VServerSelect::VServerSelect(std::vector* serverIPs, void* treplyTo) +VServerSelect::VServerSelect(vector& servers, void* treplyTo) { // I tried the whole passing using a reference here, but // the program segfaulted when settitletext tried to new @@ -46,10 +46,10 @@ VServerSelect::VServerSelect(std::vector* serverIPs, void* treplyTo) sl.setSurfaceOffset(10, 30 + 5); sl.setDimensions(area.w - 20, area.h - 30 - 15); - sl.addOption((*serverIPs)[0], 1); - for(UINT k = 1; k < serverIPs->size(); k++) + sl.addOption(servers[0].name, 1); + for(UINT k = 1; k < servers.size(); k++) { - sl.addOption((*serverIPs)[k], 0); + sl.addOption(servers[k].name, 0); } replyTo = treplyTo; diff --git a/vserverselect.h b/vserverselect.h index c01c144..2af588d 100644 --- a/vserverselect.h +++ b/vserverselect.h @@ -33,11 +33,14 @@ #include "video.h" #include "viewman.h" #include "i18n.h" +#include "vdr.h" + +using namespace std; class VServerSelect : public View { public: - VServerSelect(std::vector* tserverIPs, void* replyTo); + VServerSelect(vector& servers, void* replyTo); ~VServerSelect(); int handleCommand(int command); -- 2.39.5