]> git.sesse.net Git - ccbs/commitdiff
Move the database configuration to the config file.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 18 Feb 2012 22:33:23 +0000 (23:33 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 18 Feb 2012 22:33:23 +0000 (23:33 +0100)
bigscreen/ccbs_bigscreen.cpp
bigscreen/theme.config

index eeee86cefa4bf318806be01e7fe80cd0f282345e..40d5bad57b8aa3419ab2702b5010bc70a476e279 100644 (file)
@@ -206,7 +206,14 @@ int main(int argc, char **argv)
        try {
                init_freetype();
                set_screen_size(screen_width, screen_height);
-               pqxx::connection conn("dbname=ccbs host=www.positivegaming.com user=ccbs password=GeT|>>B_");
+
+               char connstr[1024];
+               snprintf(connstr, sizeof(connstr), "dbname=%s host=%s user=%s password=%s",
+                        get_theme_config("db", "dbname").c_str(),
+                        get_theme_config("db", "host").c_str(),
+                        get_theme_config("db", "user").c_str(),
+                        get_theme_config("db", "password").c_str());
+               pqxx::connection conn(connstr);
                FlagTrigger tournament_changed(conn, "active_tournament");
                FlagTrigger rounds_changed(conn, "active_groups");
                
index bee59aa21525a2ef3c9f1092a7b0687014d44715..2ac2167a328ea3d09c11e9906b5845f92818dc8e 100644 (file)
@@ -10,6 +10,12 @@ screen.fullscreen=0
 screen.logical_width=800
 screen.logical_height=600
 
+# Database configuration.
+db.dbname=ccbs
+db.host=www.positivegaming.com
+db.user=ccbs
+db.password=GeT|>>B_
+
 # Theme.
 default.font=/usr/share/fonts/truetype/msttcorefonts/Georgia.ttf;/usr/share/fonts/truetype/freefont/FreeSerif.ttf;arialuni.ttf
 default.red=255