mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Linux-specific: Optionally use XDG_CONFIG_HOME for config in Qt5 build
This commit is contained in:
parent
5de5f18f48
commit
f6742d8fb4
|
@ -52,6 +52,14 @@ namespace
|
|||
result = QDir::fromNativeSeparators( QString::fromWCharArray( _wgetenv( L"APPDATA" ) ) );
|
||||
#else
|
||||
char const * pathInHome = ".goldendict";
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) && defined( HAVE_X11 )
|
||||
// check if an old config dir is present, otherwise use standards-compliant location
|
||||
if ( !result.exists( pathInHome ) )
|
||||
{
|
||||
result.setPath( QStandardPaths::writableLocation( QStandardPaths::ConfigLocation ) );
|
||||
pathInHome = "goldendict";
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
result.mkpath( pathInHome );
|
||||
|
|
Loading…
Reference in a new issue