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
This commit is contained in:
Tres Finocchiaro
2017-03-15 22:13:11 -04:00
parent 6d0a29e36b
commit 4708fe63a6

View File

@@ -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();
}