Commit 7a1c5823 authored by jan.koester's avatar jan.koester
Browse files

test

parent ddebec70
Loading
Loading
Loading
Loading
+4 −1
Changes for src/theme.cpp: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -840,8 +840,11 @@ json_object* blogi::Theme::SettingsTheme(const int tid, libhttppp::HttpRequest &
        std::vector<char> buf;
        const std::string keyColumn = dbpp::quoteIdentifier(*_Config.TDatabase[tid], "key");
        rsql << "DELETE FROM options WHERE " << keyColumn << " LIKE 'THEME_DARK_%' OR " << keyColumn << " LIKE 'THEME_LIGHT_%';";
        _Config.TDatabase[tid]->exec(rsql, rres);
        for(auto &c : colors){
            for(int p = 0; p < 2; ++p){
                rsql.clear();
                rres.clear();
                const char *prefix = p == 0 ? "THEME_DARK_" : "THEME_LIGHT_";
                const char *val    = p == 0 ? c.darkDef : c.lightDef;
                uuid::uuid id;
@@ -851,9 +854,9 @@ json_object* blogi::Theme::SettingsTheme(const int tid, libhttppp::HttpRequest &
                     << dbpp::SQL::escaped(buf, (std::string(prefix) + c.suffix).c_str())
                     << "','"
                     << dbpp::SQL::escaped(buf, val) << "');";
                _Config.TDatabase[tid]->exec(rsql, rres);
            }
        }
        _Config.TDatabase[tid]->exec(rsql, rres);
    } else {
        for(auto &profile : profiles){
            std::string pfx = std::string("THEME_") + (std::string(profile) == "light" ? "LIGHT" : "DARK") + "_";