From 4708fe63a66eb761466e3e42900211dc944b21c6 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Wed, 15 Mar 2017 22:13:11 -0400 Subject: [PATCH] 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 --- src/core/ConfigManager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 0db58a59c9f..e8f263ade20 100644 --- a/src/core/ConfigManager.cpp +++ b/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(); }