From 57cab87a3604d4802f10ceddab84fb797ef24f09 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 4 Apr 2009 16:53:49 +0200 Subject: [PATCH] fetch now playing song and set window title if it's empty --- configure.in | 2 +- src/status.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 5cb64df4..bbfa7ae7 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_INIT(configure.in) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(ncmpcpp, 0.3.3) +AM_INIT_AUTOMAKE(ncmpcpp, 0.3.4_pre) AC_PREREQ(2.59) diff --git a/src/status.cpp b/src/status.cpp index 99430c2b..9e03d412 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -369,6 +369,11 @@ void NcmpcppStatusChanged(Connection *Mpd, StatusChanges changed, void *) } if (changed.ElapsedTime) { + if (np.Empty()) + { + np = Mpd->GetCurrentSong(); + WindowTitle(utf_to_locale_cpy(np.toString(Config.song_window_title_format))); + } if (!np.Empty() && !player_state.empty()) { int elapsed = Mpd->GetElapsedTime();