Skip to content

Commit 4708fe6

Browse files
committed
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
1 parent 6d0a29e commit 4708fe6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/core/ConfigManager.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,16 @@ void ConfigManager::loadConfigFile( const QString & configFile )
417417
if( value( "paths", "artwork" ) != "" )
418418
{
419419
m_artworkDir = value( "paths", "artwork" );
420-
if( !QDir( m_artworkDir ).exists() )
420+
#ifdef LMMS_BUILD_WIN32
421+
// Detect a QDir/QFile hang on Windows
422+
// see issue #3417 on github
423+
bool badPath = ( m_artworkDir == "/" || m_artworkDir == "\\" );
424+
#else
425+
bool badPath = false;
426+
#endif
427+
428+
if( badPath || !QDir( m_artworkDir ).exists() ||
429+
!QFile( m_artworkDir + "/style.css" ).exists() )
421430
{
422431
m_artworkDir = defaultArtworkDir();
423432
}

0 commit comments

Comments
 (0)