core/tags/library: Remove library enabled() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
47ab4c4b17
commit
ac2b4ad52c
|
@ -170,7 +170,7 @@ void collection :: init()
|
||||||
|
|
||||||
for (unsigned int i = 0; i < tags :: track_size(); i++) {
|
for (unsigned int i = 0; i < tags :: track_size(); i++) {
|
||||||
track = tags :: get_track(i);
|
track = tags :: get_track(i);
|
||||||
if (track && (track->library()->enabled()))
|
if (track && (track->library()->li_enabled))
|
||||||
library_q.add(track);
|
library_q.add(track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ void collection :: set_enabled(struct library *library, bool enabled)
|
||||||
{
|
{
|
||||||
Track *track;
|
Track *track;
|
||||||
|
|
||||||
if (!library || (library->enabled() == enabled))
|
if (!library || (library->li_enabled == enabled))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
library_set_enabled(library, enabled);
|
library_set_enabled(library, enabled);
|
||||||
|
|
|
@ -40,11 +40,6 @@ void library :: write(file &file)
|
||||||
file_writef(&file, "%d %s", li_enabled, li_path.c_str());
|
file_writef(&file, "%d %s", li_enabled, li_path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool library :: enabled()
|
|
||||||
{
|
|
||||||
return li_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
const unsigned int library :: size()
|
const unsigned int library :: size()
|
||||||
{
|
{
|
||||||
return li_size;
|
return li_size;
|
||||||
|
|
|
@ -36,7 +36,7 @@ static void list_path(struct library *lib)
|
||||||
if (lib) {
|
if (lib) {
|
||||||
row = *(c_list->append());
|
row = *(c_list->append());
|
||||||
row[c_cols.c_id] = lib->index();
|
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_size] = lib->size();
|
||||||
row[c_cols.c_path] = lib->primary_key();
|
row[c_cols.c_path] = lib->primary_key();
|
||||||
}
|
}
|
||||||
|
@ -164,9 +164,9 @@ static void on_toggled(const Glib::ustring &str)
|
||||||
Gtk::TreeModel::Row row;
|
Gtk::TreeModel::Row row;
|
||||||
struct library *lib = get_library_and_row(Gtk::TreePath(str), row);
|
struct library *lib = get_library_and_row(Gtk::TreePath(str), row);
|
||||||
|
|
||||||
collection :: set_enabled(lib, !lib->enabled());
|
collection :: set_enabled(lib, !lib->li_enabled);
|
||||||
row[c_cols.c_enabled] = lib->enabled();
|
row[c_cols.c_enabled] = lib->li_enabled;
|
||||||
if (lib->enabled())
|
if (lib->li_enabled)
|
||||||
remove_banned_tracks();
|
remove_banned_tracks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,13 +54,6 @@ struct library : public DatabaseEntry {
|
||||||
void write(file &);
|
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.
|
* Called to access the number of tracks in this library.
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,21 +7,21 @@
|
||||||
static void test_verify_empty(struct library *library)
|
static void test_verify_empty(struct library *library)
|
||||||
{
|
{
|
||||||
test_equal(library->primary_key(), "");
|
test_equal(library->primary_key(), "");
|
||||||
test_equal(library->enabled(), false);
|
test_equal(library->li_enabled, false);
|
||||||
test_equal(library->size(), 0);
|
test_equal(library->size(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_verify_zelda(struct library *library)
|
static void test_verify_zelda(struct library *library)
|
||||||
{
|
{
|
||||||
test_equal(library->primary_key(), "/home/Zelda/Music");
|
test_equal(library->primary_key(), "/home/Zelda/Music");
|
||||||
test_equal(library->enabled(), true);
|
test_equal(library->li_enabled, true);
|
||||||
test_equal(library->size(), 0);
|
test_equal(library->size(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_verify_link(struct library *library)
|
static void test_verify_link(struct library *library)
|
||||||
{
|
{
|
||||||
test_equal(library->primary_key(), "/home/Link/Music");
|
test_equal(library->primary_key(), "/home/Link/Music");
|
||||||
test_equal(library->enabled(), false);
|
test_equal(library->li_enabled, false);
|
||||||
test_equal(library->size(), 0);
|
test_equal(library->size(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue