From 26365d9832a749fa09018e6101cb5a03ccbc75e0 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 15 Feb 2009 22:56:41 +0100 Subject: [PATCH] rename status_checker -> status / + some cleaning --- src/Makefile.am | 6 ++---- src/browser.cpp | 2 +- src/clock.cpp | 2 +- src/helpers.cpp | 2 +- src/info.cpp | 2 +- src/lyrics.cpp | 2 +- src/media_library.cpp | 2 +- src/ncmpcpp.cpp | 15 ++++----------- src/playlist.cpp | 2 +- src/playlist_editor.cpp | 2 +- src/screen.h | 2 +- src/search_engine.cpp | 2 +- src/{status_checker.cpp => status.cpp} | 2 +- src/{status_checker.h => status.h} | 0 src/tag_editor.cpp | 5 ++--- 15 files changed, 19 insertions(+), 29 deletions(-) rename src/{status_checker.cpp => status.cpp} (99%) rename src/{status_checker.h => status.h} (100%) diff --git a/src/Makefile.am b/src/Makefile.am index c58209cf..3eab11aa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,8 +2,7 @@ bin_PROGRAMS = ncmpcpp ncmpcpp_SOURCES = browser.cpp charset.cpp clock.cpp display.cpp help.cpp \ helpers.cpp info.cpp libmpdclient.c lyrics.cpp media_library.cpp misc.cpp mpdpp.cpp \ ncmpcpp.cpp playlist.cpp playlist_editor.cpp screen.cpp scrollpad.cpp \ - search_engine.cpp settings.cpp song.cpp status_checker.cpp str_pool.c tag_editor.cpp \ - window.cpp + search_engine.cpp settings.cpp song.cpp status.cpp str_pool.c tag_editor.cpp window.cpp # set the include path found by configure INCLUDES= $(all_includes) @@ -12,5 +11,4 @@ INCLUDES= $(all_includes) ncmpcpp_LDFLAGS = $(all_libraries) noinst_HEADERS = browser.h charset.h clock.h display.h global.h help.h \ helpers.h info.h lyrics.h media_library.h menu.h mpdpp.h playlist_editor.h \ - screen.h scrollpad.h search_engine.h settings.h song.h status_checker.h \ - tag_editor.h window.h + screen.h scrollpad.h search_engine.h settings.h song.h tag_editor.h window.h diff --git a/src/browser.cpp b/src/browser.cpp index 8b0c4e75..d9615ca0 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -29,7 +29,7 @@ #include "helpers.h" #include "playlist.h" #include "settings.h" -#include "status_checker.h" +#include "status.h" #ifdef HAVE_TAGLIB_H # include "tag_editor.h" #endif // HAVE_TAGLIB_H diff --git a/src/clock.cpp b/src/clock.cpp index eab64180..27eb44a0 100644 --- a/src/clock.cpp +++ b/src/clock.cpp @@ -27,7 +27,7 @@ #include "global.h" #include "playlist.h" #include "settings.h" -#include "status_checker.h" +#include "status.h" using namespace Global; diff --git a/src/helpers.cpp b/src/helpers.cpp index 3ce227db..810ca30d 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -25,7 +25,7 @@ #include "global.h" #include "helpers.h" #include "playlist.h" -#include "status_checker.h" +#include "status.h" #include "tag_editor.h" using namespace MPD; diff --git a/src/info.cpp b/src/info.cpp index e27e3b67..64c2b91e 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -35,7 +35,7 @@ #include "playlist.h" #include "playlist_editor.h" #include "search_engine.h" -#include "status_checker.h" +#include "status.h" #include "tag_editor.h" using namespace Global; diff --git a/src/lyrics.cpp b/src/lyrics.cpp index dda24a8c..b0154004 100644 --- a/src/lyrics.cpp +++ b/src/lyrics.cpp @@ -34,7 +34,7 @@ #include "search_engine.h" #include "settings.h" #include "song.h" -#include "status_checker.h" +#include "status.h" #include "tag_editor.h" using namespace Global; diff --git a/src/media_library.cpp b/src/media_library.cpp index 589648a7..87528571 100644 --- a/src/media_library.cpp +++ b/src/media_library.cpp @@ -28,7 +28,7 @@ #include "media_library.h" #include "mpdpp.h" #include "playlist.h" -#include "status_checker.h" +#include "status.h" using namespace MPD; using namespace Global; diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index bec59ab8..8a759d4e 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -43,7 +43,7 @@ #include "settings.h" #include "song.h" #include "info.h" -#include "status_checker.h" +#include "status.h" #include "tag_editor.h" #define CHECK_MPD_MUSIC_DIR \ @@ -209,11 +209,9 @@ int main(int argc, char *argv[]) // header stuff gettimeofday(&past, 0); - const size_t max_allowed_title_length = wHeader ? wHeader->GetWidth()-volume_state.length() : 0; - if (((past.tv_sec == now.tv_sec && past.tv_usec >= now.tv_usec+500000) - || past.tv_sec > now.tv_sec) - && ((myScreen == myBrowser && myBrowser->CurrentDir().length() > max_allowed_title_length) - || myScreen == myLyrics)) + if (((past.tv_sec == now.tv_sec && past.tv_usec >= now.tv_usec+500000) || past.tv_sec > now.tv_sec) + && (myScreen == myBrowser || myScreen == myLyrics) + ) { redraw_header = 1; gettimeofday(&now, 0); @@ -329,7 +327,6 @@ int main(int argc, char *argv[]) } else if (input == KEY_RESIZE) { -// redraw_screen = 1; redraw_header = 1; if (COLS < 20 || LINES < 5) @@ -451,7 +448,6 @@ int main(int argc, char *argv[]) myPlaylist->Main()->DeleteOption(*it); } ShowMessage("Selected items deleted!"); -// redraw_screen = 1; } else { @@ -517,7 +513,6 @@ int main(int argc, char *argv[]) } utf_to_locale(myPlaylistEditor->List->Current()); ShowMessage("Selected items deleted from playlist '%s'!", myPlaylistEditor->List->Current().c_str()); -// redraw_screen = 1; } else { @@ -916,7 +911,6 @@ int main(int argc, char *argv[]) if (mySearcher->Main()->Size() > SearchEngine::StaticOptions) mySearcher->Main()->SetTitle(Config.columns_in_search_engine ? Display::Columns(Config.song_columns_list_format) : ""); } -// redraw_screen = 1; } # ifdef HAVE_CURL_CURL_H else if (Keypressed(input, Key.ToggleLyricsDB)) @@ -1348,7 +1342,6 @@ int main(int argc, char *argv[]) size_t id = mDialog->Choice(); -// redraw_screen = 1; if (myScreen == myLibrary) { myLibrary->Refresh(); diff --git a/src/playlist.cpp b/src/playlist.cpp index 301cadec..c76211ca 100644 --- a/src/playlist.cpp +++ b/src/playlist.cpp @@ -24,7 +24,7 @@ #include "menu.h" #include "playlist.h" #include "song.h" -#include "status_checker.h" +#include "status.h" #include "tag_editor.h" using namespace Global; diff --git a/src/playlist_editor.cpp b/src/playlist_editor.cpp index 5fdeff08..af86d012 100644 --- a/src/playlist_editor.cpp +++ b/src/playlist_editor.cpp @@ -27,7 +27,7 @@ #include "playlist.h" #include "playlist_editor.h" #include "mpdpp.h" -#include "status_checker.h" +#include "status.h" #include "tag_editor.h" using namespace Global; diff --git a/src/screen.h b/src/screen.h index 1fec3e33..c6768284 100644 --- a/src/screen.h +++ b/src/screen.h @@ -25,7 +25,7 @@ #include "menu.h" #include "mpdpp.h" #include "helpers.h" -#include "status_checker.h" +#include "status.h" class BasicScreen { diff --git a/src/search_engine.cpp b/src/search_engine.cpp index d32b6fbf..26a22cb4 100644 --- a/src/search_engine.cpp +++ b/src/search_engine.cpp @@ -24,7 +24,7 @@ #include "playlist.h" #include "search_engine.h" #include "settings.h" -#include "status_checker.h" +#include "status.h" using namespace MPD; using namespace Global; diff --git a/src/status_checker.cpp b/src/status.cpp similarity index 99% rename from src/status_checker.cpp rename to src/status.cpp index 73ac1ee7..d2dd4c6e 100644 --- a/src/status_checker.cpp +++ b/src/status.cpp @@ -31,7 +31,7 @@ #include "playlist_editor.h" #include "search_engine.h" #include "settings.h" -#include "status_checker.h" +#include "status.h" #include "tag_editor.h" using namespace Global; diff --git a/src/status_checker.h b/src/status.h similarity index 100% rename from src/status_checker.h rename to src/status.h diff --git a/src/tag_editor.cpp b/src/tag_editor.cpp index 399b2743..45b28be5 100644 --- a/src/tag_editor.cpp +++ b/src/tag_editor.cpp @@ -38,7 +38,7 @@ #include "playlist.h" #include "playlist_editor.h" #include "search_engine.h" -#include "status_checker.h" +#include "status.h" using namespace Global; using namespace MPD; @@ -496,10 +496,9 @@ void TagEditor::Update() Tags->Refresh(); } - if (/*redraw_screen && */w == TagTypes && TagTypes->Choice() < 13) + if (w == TagTypes && TagTypes->Choice() < 13) { Tags->Refresh(); -// redraw_screen = 0; } else if (TagTypes->Choice() >= 13) Tags->Window::Clear();