Переименования

This commit is contained in:
Andrei Astafev 2021-06-10 07:21:54 +03:00
parent 297b04bd56
commit 360b2b41d1
2 changed files with 24 additions and 24 deletions

View File

@ -54,56 +54,56 @@ MYXLIB_INLINE bool Paths::init( bool autodetect )
} // Paths::init } // Paths::init
MYXLIB_INLINE void Paths::setupSystemDirectories( const QString& defaultProjectDirectory, MYXLIB_INLINE void Paths::setupSystemDirectories( const QString& projectDir,
const QString& defaultEtcDirectory, const QString& etcDir,
const QString& defaultConstDataDirectory, const QString& constDataDir,
const QString& defaultVarDataDirectory, const QString& varDataDir,
const QString& defaultLogDirectory ) const QString& logDir )
{ {
QFileInfo prefixDirInfo { defaultProjectDirectory }; QFileInfo prefixDirInfo { projectDir };
if ( prefixDirInfo.isDir() && prefixDirInfo.isReadable() ) if ( prefixDirInfo.isDir() && prefixDirInfo.isReadable() )
{ {
m_projectDirectory = defaultProjectDirectory; m_projectDirectory = projectDir;
} }
else else
{ {
m_projectDirectory = QStringLiteral( "." ); m_projectDirectory = QStringLiteral( "." );
} }
QFileInfo etcDirInfo { defaultEtcDirectory }; QFileInfo etcDirInfo { etcDir };
if ( etcDirInfo.isDir() && etcDirInfo.isReadable() ) if ( etcDirInfo.isDir() && etcDirInfo.isReadable() )
{ {
m_systemConfigDirectory = defaultEtcDirectory; m_systemConfigDirectory = etcDir;
} }
else else
{ {
m_systemConfigDirectory = m_userConfigDirectory; m_systemConfigDirectory = m_userConfigDirectory;
} }
QFileInfo constDataDirInfo { defaultConstDataDirectory }; QFileInfo constDataDirInfo { constDataDir };
if ( constDataDirInfo.isDir() && constDataDirInfo.isReadable() ) if ( constDataDirInfo.isDir() && constDataDirInfo.isReadable() )
{ {
m_systemConstDataDirectory = defaultConstDataDirectory; m_systemConstDataDirectory = constDataDir;
} }
else else
{ {
m_systemConstDataDirectory = m_userConstDataDirectory; m_systemConstDataDirectory = m_userConstDataDirectory;
} }
QFileInfo varDataDirInfo { defaultVarDataDirectory }; QFileInfo varDataDirInfo { varDataDir };
if ( varDataDirInfo.isDir() && varDataDirInfo.isWritable() ) if ( varDataDirInfo.isDir() && varDataDirInfo.isWritable() )
{ {
m_systemVarDataDirectory = defaultVarDataDirectory; m_systemVarDataDirectory = varDataDir;
} }
else else
{ {
m_systemVarDataDirectory = m_userVarDataDirectory; m_systemVarDataDirectory = m_userVarDataDirectory;
} }
QFileInfo logDirInfo { defaultLogDirectory }; QFileInfo logDirInfo { logDir };
if ( logDirInfo.isDir() && logDirInfo.isWritable() ) if ( logDirInfo.isDir() && logDirInfo.isWritable() )
{ {
m_systemLogDirectory = defaultLogDirectory; m_systemLogDirectory = logDir;
} }
else else
{ {
@ -284,10 +284,10 @@ MYXLIB_INLINE bool Paths::makeDefaultSystemDirectories()
bool status = true; bool status = true;
QDir dir; QDir dir;
if ( !dir.mkpath( m_systemConfigDirectory ) ) { status = false; }
if ( !dir.mkpath( m_systemVarDataDirectory ) ) { status = false; }
if ( !dir.mkpath( m_systemConstDataDirectory ) ) { status = false; } if ( !dir.mkpath( m_systemConstDataDirectory ) ) { status = false; }
if ( !dir.mkpath( m_systemLogDirectory ) ) { status = false; } if ( !dir.mkpath( m_systemLogDirectory ) ) { status = false; }
if ( !dir.mkpath( m_systemConfigDirectory ) ) { status = false; }
if ( !dir.mkpath( m_systemVarDataDirectory ) ) { status = false; }
return( status ); return( status );
} }
@ -298,10 +298,10 @@ MYXLIB_INLINE bool Paths::makeDefaultUserDirectories()
bool status = true; bool status = true;
QDir dir; QDir dir;
if ( !dir.mkpath( m_userConfigDirectory ) ) { status = false; }
if ( !dir.mkpath( m_userVarDataDirectory ) ) { status = false; }
if ( !dir.mkpath( m_userConstDataDirectory ) ) { status = false; } if ( !dir.mkpath( m_userConstDataDirectory ) ) { status = false; }
if ( !dir.mkpath( m_userLogDirectory ) ) { status = false; } if ( !dir.mkpath( m_userLogDirectory ) ) { status = false; }
if ( !dir.mkpath( m_userConfigDirectory ) ) { status = false; }
if ( !dir.mkpath( m_userVarDataDirectory ) ) { status = false; }
return( status ); return( status );
} }

View File

@ -208,11 +208,11 @@ private:
QRegularExpression m_binDirRegex; QRegularExpression m_binDirRegex;
QRegularExpression m_unityBinDirRegex; QRegularExpression m_unityBinDirRegex;
void setupSystemDirectories( const QString& defaultProjectDirectory, void setupSystemDirectories( const QString& projectDir,
const QString& defaultEtcDirectory, const QString& etcDir,
const QString& defaultConstDataDirectory, const QString& constDataDir,
const QString& defaultVarDataDirectory, const QString& varDataDir,
const QString& defaultLogDirectory ); const QString& logDir );
void setupUserDirectories(); void setupUserDirectories();
HierarchyType getHierarchyType(); HierarchyType getHierarchyType();