Skip to content

Commit

Permalink
Remove unused code for tileset preferred themes
Browse files Browse the repository at this point in the history
The user should be able to set tilesets and widget styles independently.
Having one influence the other cannot be made to work in a way that's
not confusing.
  • Loading branch information
lmoureaux authored and jwrober committed Jul 8, 2024
1 parent 88bb015 commit 75f3bdd
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions client/tileset/tilespec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ struct tileset {
int replaced_hue; // -1 means no replacement
struct color_system *color_system;
struct extra_type_list *style_lists[ESTYLE_COUNT];

int num_preferred_themes;
char **preferred_themes;
};

struct tileset *tileset;
Expand Down Expand Up @@ -904,15 +901,6 @@ static void tileset_free_toplevel(struct tileset *t)
{
int i;

if (t->preferred_themes) {
for (i = 0; i < t->num_preferred_themes; i++) {
delete[] t->preferred_themes[i];
}
delete[] t->preferred_themes;
t->preferred_themes = nullptr;
}
t->num_preferred_themes = 0;

if (t->estyle_hash) {
delete t->estyle_hash;
t->estyle_hash = nullptr;
Expand Down Expand Up @@ -1646,7 +1634,6 @@ static struct tileset *tileset_read_toplevel(const QString &tileset_name,
const char **spec_filenames;
size_t num_layers;
const char **layer_order = nullptr;
size_t num_preferred_themes;
struct section_list *sections = nullptr;
const char *file_capstr;
bool duplicates_ok, is_hex;
Expand Down Expand Up @@ -2171,23 +2158,6 @@ static struct tileset *tileset_read_toplevel(const QString &tileset_name,

t->color_system = color_system_read(file);

// FIXME: remove this hack.
t->preferred_themes = const_cast<char **>(secfile_lookup_str_vec(
file, &num_preferred_themes, "tilespec.preferred_themes"));
if (num_preferred_themes <= 0) {
t->preferred_themes = const_cast<char **>(secfile_lookup_str_vec(
file, &num_preferred_themes, "tilespec.prefered_themes"));
if (num_preferred_themes > 0) {
qCWarning(deprecations_category,
"Entry tilespec.prefered_themes in tilespec."
" Use correct spelling tilespec.preferred_themes instead");
}
}
t->num_preferred_themes = num_preferred_themes;
for (i = 0; i < t->num_preferred_themes; i++) {
t->preferred_themes[i] = fc_strdup(t->preferred_themes[i]);
}

secfile_check_unused(file);
secfile_destroy(file);
qDebug("finished reading \"%s\".", fname);
Expand Down

0 comments on commit 75f3bdd

Please sign in to comment.