refactor: xunused (#4416)
* chore: remove unused function gtr_combo_box_new_enum() * chore: remove unused function gtr_priority_combo_new() * chore: remove unused function tr_logLevelToKey() * refactor: remove unused tr_sessionGetDeleteSource() * refactor: remove unused peer_atom::isValid()
This commit is contained in:
parent
1e734f36b1
commit
e17da3e19e
14
gtk/Utils.cc
14
gtk/Utils.cc
|
@ -529,13 +529,6 @@ void gtr_combo_box_set_active_enum(Gtk::ComboBox& combo_box, int value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtk::ComboBox* gtr_combo_box_new_enum(std::vector<std::pair<Glib::ustring, int>> const& items)
|
|
||||||
{
|
|
||||||
auto* w = Gtk::make_managed<Gtk::ComboBox>();
|
|
||||||
gtr_combo_box_set_enum(*w, items);
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gtr_combo_box_set_enum(Gtk::ComboBox& combo, std::vector<std::pair<Glib::ustring, int>> const& items)
|
void gtr_combo_box_set_enum(Gtk::ComboBox& combo, std::vector<std::pair<Glib::ustring, int>> const& items)
|
||||||
{
|
{
|
||||||
auto store = Gtk::ListStore::create(enum_combo_cols);
|
auto store = Gtk::ListStore::create(enum_combo_cols);
|
||||||
|
@ -567,13 +560,6 @@ int gtr_combo_box_get_active_enum(Gtk::ComboBox const& combo_box)
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtk::ComboBox* gtr_priority_combo_new()
|
|
||||||
{
|
|
||||||
auto* w = Gtk::make_managed<Gtk::ComboBox>();
|
|
||||||
gtr_priority_combo_init(*w);
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gtr_priority_combo_init(Gtk::ComboBox& combo)
|
void gtr_priority_combo_init(Gtk::ComboBox& combo)
|
||||||
{
|
{
|
||||||
gtr_combo_box_set_enum(
|
gtr_combo_box_set_enum(
|
||||||
|
|
|
@ -189,12 +189,10 @@ void gtr_window_raise(Gtk::Window& window);
|
||||||
****
|
****
|
||||||
***/
|
***/
|
||||||
|
|
||||||
Gtk::ComboBox* gtr_priority_combo_new();
|
|
||||||
void gtr_priority_combo_init(Gtk::ComboBox& combo);
|
void gtr_priority_combo_init(Gtk::ComboBox& combo);
|
||||||
#define gtr_priority_combo_get_value(w) gtr_combo_box_get_active_enum(w)
|
#define gtr_priority_combo_get_value(w) gtr_combo_box_get_active_enum(w)
|
||||||
#define gtr_priority_combo_set_value(w, val) gtr_combo_box_set_active_enum(w, val)
|
#define gtr_priority_combo_set_value(w, val) gtr_combo_box_set_active_enum(w, val)
|
||||||
|
|
||||||
Gtk::ComboBox* gtr_combo_box_new_enum(std::vector<std::pair<Glib::ustring, int>> const& items);
|
|
||||||
void gtr_combo_box_set_enum(Gtk::ComboBox& combo, std::vector<std::pair<Glib::ustring, int>> const& items);
|
void gtr_combo_box_set_enum(Gtk::ComboBox& combo, std::vector<std::pair<Glib::ustring, int>> const& items);
|
||||||
int gtr_combo_box_get_active_enum(Gtk::ComboBox const&);
|
int gtr_combo_box_get_active_enum(Gtk::ComboBox const&);
|
||||||
void gtr_combo_box_set_active_enum(Gtk::ComboBox&, int value);
|
void gtr_combo_box_set_active_enum(Gtk::ComboBox&, int value);
|
||||||
|
|
|
@ -339,8 +339,3 @@ std::optional<tr_log_level> tr_logGetLevelFromKey(std::string_view key_in)
|
||||||
|
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view tr_logLevelToKey(tr_log_level key)
|
|
||||||
{
|
|
||||||
return LogKeys[key].first;
|
|
||||||
}
|
|
||||||
|
|
|
@ -42,8 +42,6 @@ enum tr_log_level
|
||||||
|
|
||||||
std::optional<tr_log_level> tr_logGetLevelFromKey(std::string_view key);
|
std::optional<tr_log_level> tr_logGetLevelFromKey(std::string_view key);
|
||||||
|
|
||||||
std::string_view tr_logLevelToKey(tr_log_level);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
struct tr_log_message
|
struct tr_log_message
|
||||||
|
|
|
@ -161,13 +161,6 @@ struct peer_atom
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TR_ENABLE_ASSERTS
|
|
||||||
[[nodiscard]] bool isValid() const noexcept
|
|
||||||
{
|
|
||||||
return fromFirst < TR_PEER_FROM__MAX && fromBest < TR_PEER_FROM__MAX && addr.is_valid();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[[nodiscard]] constexpr auto isSeed() const noexcept
|
[[nodiscard]] constexpr auto isSeed() const noexcept
|
||||||
{
|
{
|
||||||
return (flags & ADDED_F_SEED_FLAG) != 0;
|
return (flags & ADDED_F_SEED_FLAG) != 0;
|
||||||
|
|
|
@ -1174,13 +1174,6 @@ void tr_sessionSetDeleteSource(tr_session* session, bool delete_source)
|
||||||
session->settings_.should_delete_source_torrents = delete_source;
|
session->settings_.should_delete_source_torrents = delete_source;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tr_sessionGetDeleteSource(tr_session const* session)
|
|
||||||
{
|
|
||||||
TR_ASSERT(session != nullptr);
|
|
||||||
|
|
||||||
return session->shouldDeleteSource();
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
****
|
****
|
||||||
***/
|
***/
|
||||||
|
|
|
@ -586,7 +586,6 @@ void tr_sessionSetPaused(tr_session*, bool is_paused);
|
||||||
bool tr_sessionGetPaused(tr_session const*);
|
bool tr_sessionGetPaused(tr_session const*);
|
||||||
|
|
||||||
void tr_sessionSetDeleteSource(tr_session*, bool delete_source);
|
void tr_sessionSetDeleteSource(tr_session*, bool delete_source);
|
||||||
bool tr_sessionGetDeleteSource(tr_session const*);
|
|
||||||
|
|
||||||
tr_priority_t tr_torrentGetPriority(tr_torrent const*);
|
tr_priority_t tr_torrentGetPriority(tr_torrent const*);
|
||||||
void tr_torrentSetPriority(tr_torrent*, tr_priority_t);
|
void tr_torrentSetPriority(tr_torrent*, tr_priority_t);
|
||||||
|
|
Loading…
Reference in New Issue