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

Don't overwrite the "square" tileset option on startup #2034

Merged
Merged
Show file tree
Hide file tree
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
37 changes: 0 additions & 37 deletions client/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4783,43 +4783,6 @@ const char *tileset_name_for_topology(int topology_id)
return tsn;
}

/**
Set given tileset as the default for suitable topology
*/
void option_set_default_ts(struct tileset *t)
{
const char *optname = "<not set>";
struct option *opt;

switch (tileset_topo_index(t)) {
case TS_TOPO_SQUARE:
// Overhead
optname = "default_tileset_square_name";
break;
case TS_TOPO_HEX:
// Hex
optname = "default_tileset_hex_name";
break;
case TS_TOPO_ISOHEX:
// Isohex
optname = "default_tileset_isohex_name";
break;
}

opt = optset_option_by_name(client_optset, optname);

if (opt == nullptr) {
qCritical("Unknown option name \"%s\" in option_set_default_ts()",
optname);
return;
}

/* Do not call option_str_set() since we don't want option changed callback
* to reload this tileset. */
opt->str_vtable->set(opt, tileset_basename(t));
option_gui_update(opt);
}

/**
Does topology-specific tileset option lack value?
*/
Expand Down
1 change: 0 additions & 1 deletion client/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,5 +322,4 @@ extern int messages_where[]; // OR-ed MW_ values [E_COUNT]
struct tileset;

const char *tileset_name_for_topology(int topology_id);
void option_set_default_ts(struct tileset *t);
void fill_topo_ts_default();
1 change: 0 additions & 1 deletion client/tileset/tilespec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,6 @@ bool tilespec_try_read(const QString &tileset_name, bool verbose,
} else {
original = true;
}
option_set_default_ts(tileset);

return original;
}
Expand Down
Loading