]> git.sesse.net Git - ccbs/blob - bigscreen/fetch_auxilliary_screens.cpp
Support odd/even theming for top5/top10.
[ccbs] / bigscreen / fetch_auxilliary_screens.cpp
1 #include "fetch_auxilliary_screens.h"
2
3 FetchAuxilliaryScreens::FetchAuxilliaryScreens(std::vector<widestring> *screens) : screens(screens) {}
4 void FetchAuxilliaryScreens::operator() (pqxx::transaction<> &t)
5 {
6         // make sure we start with an empty list
7         screens->erase(screens->begin(), screens->end());
8         
9         pqxx::result res( t.exec("SELECT * FROM bigscreen.active_screens") );
10         for (pqxx::result::const_iterator i = res.begin(); i != res.end(); ++i) {
11                 screens->push_back( i["id"].as(widestring()) );
12         }
13 }