Skip to content

Commit

Permalink
Validate theme directory
Browse files Browse the repository at this point in the history
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 4708fe6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 4708fe6

Please sign in to comment.