| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Use one g_utf8_collate() call instead of g_utf8_collate_key() twice
plus strcmp().
|
|
|
|
|
| |
All functions must receive UTF-8 file names. Delete all which still
work with locale strings, and remove the _utf8 suffix from the others.
|
|
|
|
|
|
| |
Don't convert the character set of strings to and from the current
locale. This library cannot know what the strings are going to be
used for, so it should not mess with them.
|
|
|
|
|
| |
Move everything which deals with UTF-8 strings and character set
conversion to charset.c, header charset.h.
|
|
|
|
|
| |
Use options.list_format and options.status_format directly instead of
these two macros.
|
|
|
|
| |
gdb is for debugging. We don't need D() calls littered all over.
|
|
|
|
|
| |
Since all screen updating is now on demand, we don't need this flag
anymore.
|
|
|
|
|
|
| |
connection->errorCode has an undefined value when connection->error is
not MPD_ERROR_ACK. Read it only if MPD_ERROR_ACK is set, to make
valgrind happy.
|
|
|
|
|
| |
During authentication, the message pointer was allocated, but never
freed. Allocate it only if it is really used (and freed).
|
|
|
|
| |
Follow the same code style als MPD itself.
|
|
|
|
| |
The caller should decide how to display error messages.
|
|
|
|
|
| |
The "crop" command deletes all songs from the playlist, except the one
currently being played.
|
|
|
|
|
| |
Since we do a lot of indexed accesses to the filelist, a linked list
doesn't seem appropriate. Use GPtrArray instead.
|
|
|
|
| |
Avoid direct accesses to the filelist struct, provide an API for that.
|
|
|
|
|
| |
The separate filelist library does not depend on mpdclient, so the
prefix is superfluous.
|
|
|
|
|
|
|
|
| |
Move everything which is solely filelist related to filelist.c and
filelist.h. Fix the indentation of that file, and provide the struct
name "filelist". Don't clear data in mpdclient_filelist_free() before
calling g_free(). Constify the "song" parameter to
mpdclient_filelist_find_song().
|
|
|
|
| |
Follow the same code style als MPD itself.
|
|
|
|
|
| |
The caller may check the playlist.id instead of checking the old
"updated" flag.
|
|
|
|
|
|
|
|
|
|
| |
playlist_remove_reuse() removes a song from the playlist, but does not
free it.
Use this function in mpdclient_cmd_delete() to fix a segmentation
fault: the song pointer was still used after it was freed, by passing
it to mpdclient_playlist_callback(). Free the song manually now.
Reorganize and simply some code in mpdclient_cmd_delete().
|
| |
|
| |
|
|
|
|
| |
Follow the same code style als MPD itself.
|
|
|
|
|
|
| |
Instead of freeing the playlist with mpdclient_playlist_free(), call
playlist_clear() to empty the song list. This fixes a segmentation
fault which occured when you cleared the playlist.
|
|
|
|
|
|
| |
Added functions like playlist_length(), playlist_get(),
playlist_replace(), playlist_remove(). Don't access the
mpdclient_playlist struct directly.
|
|
|
|
|
|
| |
Moved code from mpdclient_new() and mpdclient_playlist_free(). In
mpdclient_disconnect(), call mpdclient_playlist_clear() instead of
mpdclient_playlist_free() (which is now called in mpdclient_free()).
|
|
|
|
|
|
|
|
|
|
| |
Move everything which manipulates the mpdclient_playlist struct to
playlist.c. Many of the functions get a mpdclient pointer instead of
a playlist; this will be changed later.
The functions mpdclient_playlist_update() and
mpdclient_playlist_update_changes() stay in mpdclient.c for now, since
they are tightly connected to the client code.
|
|
|
|
|
| |
Use a forward declared struct mpd_song instead of the typedef
mpd_Song.
|
|
|
|
| |
Follow the same code style als MPD itself.
|
|
|
|
|
|
| |
Using a doubly linked list for the local playlist copy is a huge waste
of both memory and CPU cycles. Use GArray instead of GList, which is
much faster in this case.
|
|
|
|
|
|
| |
Memory leak: the function mpdclient_playlist_update_changes() did not
free the entity which was returned by mpd_getNextInfoEntity(). Add a
mpd_freeInfoEntity() call at the end of each iteration.
|
| |
|
|
|
|
|
| |
Rename local variables and function parameters, so they don't shadow
global variables.
|
|
|
|
|
|
| |
A header should include all headers which he needs. Move local
includes on top, and let foo.c include foo.h in the first line, to
automatically test its dependencies.
|
|
|
|
|
| |
Convert pointers to const whenever it is possible. Fixes all those
-Wconst warnings.
|
|
|
|
|
| |
NDEBUG is more commonly used than DEBUG, e.g. in assert.h. Convert
all macros to NDEBUG, and declare NDEBUG when debugging is disabled.
|
|
|
|
|
|
|
| |
Follow the same code style als MPD itself. This patch only fixes
parts of the code which are going to be touched in the following bunch
of patches, i.e. there will be more "code style" patches in the
future.
|
|
|
|
| |
Also remove some commented code and unused function parameters.
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4953 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4741 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4615 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4562 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4548 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3357 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3322 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2668 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1766 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1587 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1553 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1525 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|