do not initialize screens lazily as it doesn't make much sense

This commit is contained in:
Andrzej Rybczak
2012-09-14 00:54:48 +02:00
parent 7c3f93e211
commit 1891c1c050
41 changed files with 153 additions and 205 deletions

View File

@@ -40,7 +40,7 @@ using namespace std::placeholders;
using Global::MainHeight;
using Global::MainStartY;
PlaylistEditor *myPlaylistEditor = new PlaylistEditor;
PlaylistEditor *myPlaylistEditor;
namespace {//
@@ -55,7 +55,7 @@ bool SongEntryMatcher(const Regex &rx, const MPD::Song &s);
}
void PlaylistEditor::init()
PlaylistEditor::PlaylistEditor()
{
LeftColumnWidth = COLS/3-1;
RightColumnStartX = LeftColumnWidth+1;
@@ -81,7 +81,6 @@ void PlaylistEditor::init()
Content->setItemDisplayer(std::bind(Display::Songs, _1, this, Config.song_list_format));
w = Playlists;
isInitialized = 1;
}
void PlaylistEditor::resize()
@@ -123,9 +122,6 @@ void PlaylistEditor::switchTo()
if (myScreen == this)
return;
if (!isInitialized)
init();
if (myLockedScreen)
updateInactiveScreen(this);
@@ -509,8 +505,6 @@ void PlaylistEditor::nextColumn()
void PlaylistEditor::Locate(const std::string &name)
{
if (!isInitialized)
init();
update();
for (size_t i = 0; i < Playlists->size(); ++i)
{