Permalink
Browse files

fix #3166: use URIUtils::AddFileToFolder

  • Loading branch information...
koying committed Sep 8, 2013
1 parent 1501e49 commit dcc0b4c6a2fcbfdf62852b811728a3efc05167cc
@@ -24,6 +24,7 @@
#include "filesystem/SpecialProtocol.h"
#include "settings/Settings.h"
#include "utils/log.h"
+#include "utils/URIUtils.h"
#include "threads/SingleLock.h"
#include "threads/Atomics.h"
@@ -76,14 +77,10 @@ CDVDSubtitlesLibass::CDVDSubtitlesLibass()
if(!m_renderer)
return;
- //Setting default font to the Arial in \media\fonts (used if FontConfig fails)
- strPath = "special://home/media/Fonts/";
- strPath += CSettings::Get().GetString("subtitles.font");
+ //Setting default font to the Arial in \media\fonts (used if FontConfig fails)
+ strPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
if (!XFILE::CFile::Exists(strPath))
- {
- strPath = "special://xbmc/media/Fonts/";
- strPath += CSettings::Get().GetString("subtitles.font");
- }
+ strPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
int fc = !CSettings::Get().GetBool("subtitles.overrideassfonts");
m_dll.ass_set_margins(m_renderer, 0, 0, 0, 0);
@@ -139,9 +139,9 @@ bool CKaraokeLyricsText::InitGraphics()
if ( m_lyrics.empty() )
return false;
- CStdString fontPath = "special://home/media/Fonts/" + CSettings::Get().GetString("karaoke.font");
+ CStdString fontPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("karaoke.font"));
if (!XFILE::CFile::Exists(fontPath))
- fontPath = "special://xbmc/media/Fonts/" + CSettings::Get().GetString("karaoke.font");
+ fontPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CSettings::Get().GetString("karaoke.font"));
m_karaokeFont = g_fontManager.LoadTTF("__karaoke__", fontPath,
m_colorLyrics, 0, CSettings::Get().GetInt("karaoke.fontheight"), FONT_STYLE_BOLD );
CGUIFont *karaokeBorder = g_fontManager.LoadTTF("__karaokeborder__", fontPath,
@@ -50,6 +50,7 @@
#include "threads/SingleLock.h"
#include "utils/log.h"
#include "utils/TimeUtils.h"
+#include "utils/URIUtils.h"
#include "XBDateTime.h"
#include "input/ButtonTranslator.h"
#include "pvr/PVRManager.h"
@@ -402,13 +403,9 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
CSingleLock lock (m_fontLock);
- CStdString fontPath = "special://home/media/Fonts/";
- fontPath += CSettings::Get().GetString("subtitles.font");
+ CStdString fontPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
if (!XFILE::CFile::Exists(fontPath))
- {
- fontPath = "special://xbmc/media/Fonts/";
- fontPath += CSettings::Get().GetString("subtitles.font");
- }
+ fontPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
// We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions.
RESOLUTION_INFO pal(720, 576, 0);

0 comments on commit dcc0b4c

Please sign in to comment.