Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code for tileset preferred themes #2322

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading