| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Use memcpy() even when the cursor is at the end. It copies only the
trailing null terminator in this case.
The constant "length" is declared here in preparation for the "wide
character" patches.
|
|
|
|
|
| |
memmove() handles overlapping buffers well, we can use it to get room
for the inserted character.
|
|
|
|
| |
Remove some clutter from wreadln(), isolate some code into a function.
|
|
|
|
|
|
| |
Since the buffer size is already known at compile time, don't do a
second malloc() for it, declare it statically in struct wreadln. This
way, it is going to be allocated on the stack.
|
|
|
|
|
| |
Don't pass a dozen of parameters to all internal functions; pass a
pointer to the wreadln struct instead.
|
|
|
|
|
|
|
| |
Several internal functions calculate the width of the input field by
subtracting "x0" from "x1", although the width is already being passed
to them. Eliminate the parameter "x1" in all functions, and use
"width" instead.
|
|
|
|
|
| |
Convert wrln_max_line_size and wrln_max_history_length to local
constants. They have no real use outside of wreadln.c.
|
|
|
|
|
| |
Don't use "extern" outside of the headers, include the proper header
instead.
|
|
|
|
| |
Follow the same code style als MPD itself.
|
|
|
|
|
| |
There are no special cases left for my_wgetch() to handle. We can
remove it and use the original wgetch() instead.
|
|
|
|
|
| |
We're better off doing our own signal handling, instead of switching
ncurses to raw mode. Anyway, it was commented out and didn't work...
|
|
|
|
|
| |
The wide character version of wreadln() is currently a non-functional
mess. Remove it for now, I will reimplement that later.
|
|
|
|
|
| |
Variables which store integer seconds should be declared as GTime.
This fixes a gcc warning.
|
| |
|
|
|
|
|
| |
Another occurence of the non-portable basename() wasn't converted to
glib yet.
|
|
|
|
|
|
| |
The glib function g_timeout_add() wants the interval as guint in
milliseconds. Store the update interval in this form, instead of
having to multiply MPD_UPDATE_TIME with 1000.
|
|
|
|
|
| |
Don't reset sa_mask and sa_flags after every sigaction() call. Do it
once.
|
|
|
|
|
|
| |
Set option SA_RESTART for the SIGWINCH handler. The screen resizer
function is called by the glib main loop anyway, no need to interrupt
any random system call here.
|
|
|
|
|
|
|
| |
Somehow the "ignore SIGPIPE" patch had a fatal typo: instead of
ignoring SIGPIPE, it ignored SIGWINCH. Somehow ncurses managed to
hide the bug's symptoms, but a recent patch finally broke it. Repair
the typo.
|
|
|
|
|
| |
screen_t is a singleton. We do not have to pass it around
everywhere. Export the one global variable.
|
|
|
|
|
| |
None of the paint() implementations acutally uses the mpdclient
pointer. Remove it from the method signature.
|
|
|
|
|
|
|
| |
Remove the last paint() dependency on the mpdclient pointer: remember
a pointer to the playlist object, and don't take it from mpdclient
every time we paint. Also add the variable "current_song_id" which is
calculated in update().
|
|
|
|
| |
Repaint immediately instead of setting "painted=0".
|
|
|
|
|
| |
Since we are handling SIGWINCH, we do not need to handle KEY_RESIZE
from ncurses. Remove it.
|
|
|
|
|
| |
Save some bytes again: remove search_tag.id, make the array index
equal to the tag id.
|
|
|
|
|
| |
mpdclient_finish_command() is already imported by mpdclient.h, don't
do it again in the sources.
|
|
|
|
| |
The future is now!
|
|
|
|
|
| |
Global variables are already initialized with zero when the program
starts, don't memset(0) again.
|
|
|
|
|
| |
Just make everybody use the global "options" variable. This
eliminates namespace confusion and the NO_GLOBAL_OPTIONS hack.
|
|
|
|
|
| |
Default is colors disabled. Those who love colorful terminals have
the option to enable it with --enable-colors.
|
|
|
|
|
|
| |
Instead of calling printf() multiple times for every compile time
option, build the whole string at compile time and print it with
puts().
|
|
|
|
|
| |
The color ids are sequential, and we can save some bytes if we use it
for the array index.
|
|
|
|
|
| |
Instead of declaring a bunch of CPP macros, use a C enum for
identifying colors.
|
|
|
|
| |
Follow the same code style als MPD itself.
|
|
|
|
|
|
| |
The artist screen shouldn't be marked "experimental" anymore.
Describe the current state of the screen in the title, instead of
always writing "Artist".
|
|
|
|
|
|
|
|
| |
We do not need to save a stack of list window states. When we return
to a parent directory, we just have to find the directory which we
come from in the parent list. Note that this patch resets the cursor
when going to the root directory, but I think it's not that important,
and I will deal with that later.
|
|
|
|
|
| |
The function filelist_find_directory() will be useful for the
following patch.
|
|
|
|
|
|
|
| |
The variable "album" was set to _("All tracks") when it was empty.
When reloading the songs, ncmpc was trying to find an album named "All
tracks", which didn't seem to work. Leave "album" in its canonical
form and generate the title text on demand.
|
|
|
|
|
| |
The GTK charset functions accept "-1" if the parameter is null
terminated.
|
| |
|
|
|
|
|
| |
g_basename() is always available, no need to implement a fallback.
Also use g_path_get_dirname(), g_path_get_basename().
|
|
|
|
| |
Don't duplicate code which is already provided by glib.
|
|
|
|
| |
Don't duplicate code which is already provided by glib.
|
| |
|
|
|
|
|
| |
Moved the format string for playlist files to the constant
"playlist_format".
|
|
|
|
|
| |
The code did not compile when HAVE_LOCALE_H was not set. Also don't
compile all that code in charset.c, when there is no locale.h.
|
|
|
|
|
| |
Convert the lyrics to the current character set before displaying
them.
|
|
|
|
|
| |
Use g_convert_with_fallback() for charset conversion, and don't print
a status bar message on error.
|
|
|
|
|
| |
Don't pass "noconvert" to charset_init(). Let charset_init()
determine that with g_get_charset() and return its name.
|
|
|
|
|
|
| |
my_strlen() is a bad name for the function, since the return value is
not a length, but a visible width on the screen. Rename it to
utf8_width() and change its return type to "unsigned".
|