gui/filebrowser: don't crash when fonts are changed (untested)

Origin commit data
------------------
Commit: 805a1232cf
Author: martii <m4rtii@gmx.de>
Date: 2013-11-26 (Tue, 26 Nov 2013)
This commit is contained in:
martii
2013-11-26 23:00:19 +01:00
committed by [CST] Focus
parent 69f917f16d
commit 4a4a871772
2 changed files with 10 additions and 4 deletions

View File

@@ -274,9 +274,6 @@ CFileBrowser::CFileBrowser(const char * const _base, const tFileBrowserMode mode
void CFileBrowser::commonInit()
{
frameBuffer = CFrameBuffer::getInstance();
fnt_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
fnt_item = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM];
fnt_small = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL];
//shoutcast
sc_init_dir = "/legacy/genrelist?k=" + g_settings.shoutcast_dev_id;
@@ -288,7 +285,15 @@ void CFileBrowser::commonInit()
Hide_records = false;
selected = 0;
selections.clear();
m_SMSKeyInput.setTimeout(SMSKEY_TIMEOUT);
fontInit();
}
void CFileBrowser::fontInit()
{
fnt_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
fnt_item = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM];
fnt_small = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL];
width = frameBuffer->getScreenWidthRel();
height = frameBuffer->getScreenHeightRel();
x = getScreenStartX(width);
@@ -307,7 +312,6 @@ void CFileBrowser::commonInit()
height = theight + listmaxshow * fheight + 2 * foheight;
y = getScreenStartY(height);
m_SMSKeyInput.setTimeout(SMSKEY_TIMEOUT);
}
@@ -760,6 +764,7 @@ bool CFileBrowser::exec(const char * const dirname)
name = dirname;
std::replace(name.begin(), name.end(), '\\', '/');
fontInit();
paintHead();
int selection = -1;
if (name == Path)