Skip to content
Permalink
Browse files

Validate theme directory

Looks for style.css in theme path to help avoid invalid theme directories.
Explicitely avoid use of "/" on Windows to prevent hang.
Closes #3417
  • Loading branch information
tresf committed Mar 16, 2017
1 parent 6d0a29e commit 4708fe63a66eb761466e3e42900211dc944b21c6
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/core/ConfigManager.cpp
@@ -417,7 +417,16 @@ void ConfigManager::loadConfigFile( const QString & configFile )
if( value( "paths", "artwork" ) != "" )
{
m_artworkDir = value( "paths", "artwork" );
if( !QDir( m_artworkDir ).exists() )
#ifdef LMMS_BUILD_WIN32
// Detect a QDir/QFile hang on Windows
// see issue #3417 on github
bool badPath = ( m_artworkDir == "/" || m_artworkDir == "\\" );
#else
bool badPath = false;
#endif

if( badPath || !QDir( m_artworkDir ).exists() ||
!QFile( m_artworkDir + "/style.css" ).exists() )
{
m_artworkDir = defaultArtworkDir();
}

0 comments on commit 4708fe6

Please sign in to comment.
You can’t perform that action at this time.