I found that databases were always decrementing _size when remove() was
called. This patch fixes the bug by checking if the entry is valid
before removal.
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
This will let me set up a Track class that has pointers to the
corresponding artist, album and genre information without needing to
know their IDs directly. Having this information available means I
won't need to keep a "join struct" when doing lookups - instead I can
return a pointer to a Track class that already knows everything.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I didn't have any changes to make to the IdleQueue itself, but I did
need to update the unit test and reword a few things in the design.
Signed-off-by: Anna Schuamker <schumaker.anna@gmail.com>
- filter :: add() now returns the lowercased text
- Don't cache lowercased strings
- Remove functions depending on CONFIG_TEST
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I updated the design and rewrote the unit tests. This creates something
more consistent with how I ended up using the index.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I add:
- Autosaving option
- Real iterators
- Better accessor functions
The new design and unit test also allows me to remove the 300,000+ line
"database.good" file that the old tests were based on.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Needing to use throw / catch was getting in the way. Instead, check for
a boolean return value.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I changed primary_key() into a function since it is only called once,
and there is no point in using more mmemory than I need to. I also
created a basic unit test for everything that database entries are
supposed to do.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I'm taking a break from gui code to clean up the build system and update
my unit tests. This patch updates how code is built, and reworks my
"print" test to test version number instead.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Start on the collection page. I eventually want to display the first
enable playqueue, though.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This prevents an error message (and possible corruption) by continuing
with the open() function even if the file doesn't exist.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This was a bug I discovered when double clicking on paths in the
collection manager to change the path in the FileChooserWidget.
Before this patch, strings could be read as:
<string> /home/anna/Music</string>
Now, the same string will be read as:
<string>/home/anna/Music</string>
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
I implemented an entire Gtk::TreeModel in this commit, plus some minor
supporting code in the library to look up playlist entries by index.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
The signal connections for these features are really difficult to test
programmatically, but I can test the effects by calling each function
directly.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This allows a user to explore what has been added in each of their
library paths. Right now I filter for directories only, but it may be a
good idea to change this in the future.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
Gstreamer includes <errno.h>, which already defines several of these
symbols. I rename them to avoid namespace collisions. Perhaps a better
solution would be to use the errno.h definitions directly?
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This is used for the recently played playqueue to iterate backwards when
the previous() function is called.
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>