throw away unneeded code

This commit is contained in:
Andrzej Rybczak
2009-02-15 22:28:04 +01:00
parent 9dd21b7653
commit b43d4dddeb
5 changed files with 10 additions and 95 deletions

View File

@@ -21,7 +21,6 @@
#ifndef _GLOBAL_H #ifndef _GLOBAL_H
#define _GLOBAL_H #define _GLOBAL_H
#include "settings.h"
#include "ncmpcpp.h" #include "ncmpcpp.h"
#include "mpdpp.h" #include "mpdpp.h"
#include "screen.h" #include "screen.h"
@@ -33,85 +32,34 @@ namespace Global
extern BasicScreen *myScreen; extern BasicScreen *myScreen;
extern BasicScreen *myOldScreen; extern BasicScreen *myOldScreen;
// extern Menu<MPD::Song> *myPlaylist->Main();
// extern Menu<MPD::Item> *myBrowser->Main();
// extern Menu< std::pair<Buffer *, MPD::Song *> > *mSearcher;
// extern Window *wLibActiveCol;
// extern Menu<std::string> *myLibrary->Artists;
// extern Menu<string_pair> *myLibrary->Albums;
// extern Menu<MPD::Song> *myLibrary->Songs;
# ifdef HAVE_TAGLIB_H
// extern Window *wTagEditorActiveCol;
// extern Menu<Buffer> *mTagEditor;
// extern Menu<string_pair> *mEditorAlbums;
// extern Menu<string_pair> *myTagEditor->Dirs;
// extern Menu<string_pair> *mEditorLeftCol;
// extern Menu<std::string> *myTagEditor->TagTypes;
// extern Menu<MPD::Song> *myTagEditor->Tags;
# endif // HAVE_TAGLIB_H
// extern Window *wPlaylistEditorActiveCol;
// extern Menu<std::string> *mPlaylistList;
// extern Menu<MPD::Song> *myPlaylistEditor->Content;
// extern Scrollpad *sHelp;
// extern Scrollpad *sLyrics;
// extern Scrollpad *sInfo;
extern Window *wHeader; extern Window *wHeader;
extern Window *wFooter; extern Window *wFooter;
//# ifdef ENABLE_CLOCK
// extern Scrollpad *wClock;
//# endif
extern MPD::Connection *Mpd; extern MPD::Connection *Mpd;
// extern int now_playing;
// extern int lock_statusbar_delay;
// extern size_t browsed_dir_scroll_begin;
extern size_t main_start_y; extern size_t main_start_y;
extern size_t main_height; extern size_t main_height;
// extern size_t lyrics_scroll_begin;
extern time_t timer; extern time_t timer;
// extern std::string browsed_dir;
// extern std::string editor_browsed_dir;
// extern std::string editor_highlighted_dir;
// extern std::string info_title;
// extern BasicScreen myScreen;
// extern NcmpcppScreen myOldScreen;
# ifdef HAVE_CURL_CURL_H # ifdef HAVE_CURL_CURL_H
extern pthread_mutex_t curl; extern pthread_mutex_t curl;
# endif # endif
extern bool dont_change_now_playing; extern bool dont_change_now_playing;
extern bool block_progressbar_update; extern bool block_progressbar_update;
extern bool block_playlist_update; extern bool block_playlist_update;
extern bool block_item_list_update; extern bool block_item_list_update;
extern bool messages_allowed; extern bool messages_allowed;
extern bool redraw_header; extern bool redraw_header;
// extern bool reload_lyrics;
extern std::string volume_state; extern std::string volume_state;
extern bool header_update_status; extern bool header_update_status;
// extern bool search_case_sensitive;
// extern bool search_match_to_pattern;
// extern const char *search_mode_normal;
// extern const char *search_mode_strict;
extern std::vector<int> vFoundPositions; extern std::vector<int> vFoundPositions;
extern int found_pos; extern int found_pos;
// extern MPD::Song lyrics_song;
} }
#endif #endif

View File

@@ -119,8 +119,6 @@ template <class T> class Menu : public Window, public List
virtual Menu<T> *Clone() const { return new Menu<T>(*this); } virtual Menu<T> *Clone() const { return new Menu<T>(*this); }
virtual Menu<T> *EmptyClone() const; virtual Menu<T> *EmptyClone() const;
//virtual string GetOption(int i = -1) const;
protected: protected:
ItemDisplayer itsItemDisplayer; ItemDisplayer itsItemDisplayer;
void *itsItemDisplayerUserdata; void *itsItemDisplayerUserdata;
@@ -196,8 +194,6 @@ template <class T> void Menu<T>::AddOption(const T &item, bool is_bold, bool is_
itsOptions.push_back(o); itsOptions.push_back(o);
} }
//template <> void Menu<Buffer>::AddOption(const Buffer &buf, bool is_bold, bool is_static, bool have_separator);
template <class T> void Menu<T>::AddSeparator() template <class T> void Menu<T>::AddSeparator()
{ {
Option o; Option o;

View File

@@ -73,9 +73,6 @@ size_t Global::main_height;
time_t Global::timer; time_t Global::timer;
//string Global::myTagEditor->CurrentDir() = "/";
//string Global::editor_highlighted_dir;
bool Global::dont_change_now_playing = 0; bool Global::dont_change_now_playing = 0;
bool Global::block_progressbar_update = 0; bool Global::block_progressbar_update = 0;
bool Global::block_playlist_update = 0; bool Global::block_playlist_update = 0;
@@ -993,7 +990,11 @@ int main(int argc, char *argv[])
{ {
CHECK_MPD_MUSIC_DIR; CHECK_MPD_MUSIC_DIR;
# ifdef HAVE_TAGLIB_H # ifdef HAVE_TAGLIB_H
if (myScreen->Cmp() == myLibrary->Artists) if (myTinyTagEditor->SetEdited(myScreen->CurrentSong()))
{
myTinyTagEditor->SwitchTo();
}
else if (myScreen->Cmp() == myLibrary->Artists)
{ {
LockStatusbar(); LockStatusbar();
Statusbar() << fmtBold << IntoStr(Config.media_lib_primary_tag) << fmtBoldEnd << ": "; Statusbar() << fmtBold << IntoStr(Config.media_lib_primary_tag) << fmtBoldEnd << ": ";
@@ -1068,10 +1069,6 @@ int main(int argc, char *argv[])
} }
} }
} }
else if (myTinyTagEditor->SetEdited(myScreen->CurrentSong()))
{
myTinyTagEditor->SwitchTo();
}
else if (myScreen->Cmp() == myTagEditor->Dirs) else if (myScreen->Cmp() == myTagEditor->Dirs)
{ {
string old_dir = myTagEditor->Dirs->Current().first; string old_dir = myTagEditor->Dirs->Current().first;
@@ -1203,7 +1200,6 @@ int main(int argc, char *argv[])
# endif // HAVE_TAGLIB_H # endif // HAVE_TAGLIB_H
) )
{ {
List *mList = reinterpret_cast<Menu<Song> *>(myWindow->Main()); List *mList = reinterpret_cast<Menu<Song> *>(myWindow->Main());
for (size_t i = 0; i < mList->Size(); i++) for (size_t i = 0; i < mList->Size(); i++)
mList->Select(i, !mList->isSelected(i) && !mList->isStatic(i)); mList->Select(i, !mList->isSelected(i) && !mList->isStatic(i));

View File

@@ -103,28 +103,6 @@ void Song::Localize()
# endif // SUPPORTED_LOCALES && HAVE_ICONV_H # endif // SUPPORTED_LOCALES && HAVE_ICONV_H
} }
/*void Song::Delocalize()
{
# if !defined(_UTF8) && defined(HAVE_ICONV_H)
if (!isLocalised)
return;
str_pool_locale_to_utf(itsSong->file);
__Count_Last_Slash_Position();
str_pool_locale_to_utf(itsSong->artist);
str_pool_locale_to_utf(itsSong->title);
str_pool_locale_to_utf(itsSong->album);
str_pool_locale_to_utf(itsSong->track);
str_pool_locale_to_utf(itsSong->name);
str_pool_locale_to_utf(itsSong->date);
str_pool_locale_to_utf(itsSong->genre);
str_pool_locale_to_utf(itsSong->composer);
str_pool_locale_to_utf(itsSong->performer);
str_pool_locale_to_utf(itsSong->disc);
str_pool_locale_to_utf(itsSong->comment);
isLocalised = 0;
# endif // !_UTF8 && HAVE_ICONV_H
}*/
void Song::Clear() void Song::Clear()
{ {
if (itsSong) if (itsSong)

View File

@@ -78,9 +78,7 @@ namespace MPD
void NullMe() { itsSong = 0; } void NullMe() { itsSong = 0; }
void CopyPtr(bool copy) { copyPtr = copy; } void CopyPtr(bool copy) { copyPtr = copy; }
//void GetEmptyFields(bool get) { itsGetEmptyFields = get; }
void Localize(); void Localize();
//void Delocalize();
void Clear(); void Clear();
bool Empty() const; bool Empty() const;
bool IsFromDB() const; bool IsFromDB() const;
@@ -103,7 +101,6 @@ namespace MPD
bool copyPtr; bool copyPtr;
bool isStream; bool isStream;
bool isLocalised; bool isLocalised;
//bool itsGetEmptyFields;
}; };
} }