clear window title at exit

This commit is contained in:
Andrzej Rybczak
2009-05-21 11:59:21 +02:00
parent 2701eed2ca
commit eb3b08b45e
4 changed files with 18 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(ncmpcpp, 0.3.4)
AM_INIT_AUTOMAKE(ncmpcpp, 0.3.5_pre)
AC_PREREQ(2.59)

View File

@@ -1782,6 +1782,7 @@ int main(int argc, char *argv[])
errorlog.close();
Mpd->Disconnect();
DestroyScreen();
WindowTitle("");
return 0;
}

View File

@@ -51,20 +51,18 @@ namespace
bool block_statusbar_update = 0;
bool block_progressbar_update = 0;
bool allow_statusbar_unlock = 1;
# ifndef USE_PDCURSES
void WindowTitle(const string &status)
{
static const string term_type = getenv("TERM") ? getenv("TERM") : "";
if (term_type != "linux" && Config.set_window_title)
std::cout << "\033]0;" << status << "\7";
}
# else
# define WindowTitle(x);
# endif // USE_PDCURSES
}
#ifndef USE_PDCURSES
void WindowTitle(const string &status)
{
static const string term_type = getenv("TERM") ? getenv("TERM") : "";
if (term_type != "linux" && Config.set_window_title)
std::cout << "\033]0;" << status << "\7";
}
#endif // !USE_PDCURSES
void StatusbarGetStringHelper(const std::wstring &)
{
TraceMpdStatus();

View File

@@ -24,6 +24,12 @@
#include "mpdpp.h"
#include "ncmpcpp.h"
#ifndef USE_PDCURSES
void WindowTitle(const std::string &);
#else
# define WindowTitle(x);
#endif // USE_PDCURSES
void LockProgressbar();
void UnlockProgressbar();