core/tags/library: Remove library enabled() function

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-10-23 14:10:59 -04:00
parent 47ab4c4b17
commit ac2b4ad52c
5 changed files with 9 additions and 21 deletions

View File

@ -170,7 +170,7 @@ void collection :: init()
for (unsigned int i = 0; i < tags :: track_size(); i++) {
track = tags :: get_track(i);
if (track && (track->library()->enabled()))
if (track && (track->library()->li_enabled))
library_q.add(track);
}
}
@ -222,7 +222,7 @@ void collection :: set_enabled(struct library *library, bool enabled)
{
Track *track;
if (!library || (library->enabled() == enabled))
if (!library || (library->li_enabled == enabled))
return;
library_set_enabled(library, enabled);

View File

@ -40,11 +40,6 @@ void library :: write(file &file)
file_writef(&file, "%d %s", li_enabled, li_path.c_str());
}
const bool library :: enabled()
{
return li_enabled;
}
const unsigned int library :: size()
{
return li_size;

View File

@ -36,7 +36,7 @@ static void list_path(struct library *lib)
if (lib) {
row = *(c_list->append());
row[c_cols.c_id] = lib->index();
row[c_cols.c_enabled] = lib->enabled();
row[c_cols.c_enabled] = lib->li_enabled;
row[c_cols.c_size] = lib->size();
row[c_cols.c_path] = lib->primary_key();
}
@ -164,9 +164,9 @@ static void on_toggled(const Glib::ustring &str)
Gtk::TreeModel::Row row;
struct library *lib = get_library_and_row(Gtk::TreePath(str), row);
collection :: set_enabled(lib, !lib->enabled());
row[c_cols.c_enabled] = lib->enabled();
if (lib->enabled())
collection :: set_enabled(lib, !lib->li_enabled);
row[c_cols.c_enabled] = lib->li_enabled;
if (lib->li_enabled)
remove_banned_tracks();
}

View File

@ -54,13 +54,6 @@ struct library : public DatabaseEntry {
void write(file &);
/**
* Called to check if this library path is currently enabled.
*
* @return Library::_enabled.
*/
const bool enabled();
/**
* Called to access the number of tracks in this library.
*

View File

@ -7,21 +7,21 @@
static void test_verify_empty(struct library *library)
{
test_equal(library->primary_key(), "");
test_equal(library->enabled(), false);
test_equal(library->li_enabled, false);
test_equal(library->size(), 0);
}
static void test_verify_zelda(struct library *library)
{
test_equal(library->primary_key(), "/home/Zelda/Music");
test_equal(library->enabled(), true);
test_equal(library->li_enabled, true);
test_equal(library->size(), 0);
}
static void test_verify_link(struct library *library)
{
test_equal(library->primary_key(), "/home/Link/Music");
test_equal(library->enabled(), false);
test_equal(library->li_enabled, false);
test_equal(library->size(), 0);
}