|
|
|
@@ -19,9 +19,9 @@ namespace myx {
|
|
|
|
|
|
|
|
|
|
namespace filesystem {
|
|
|
|
|
|
|
|
|
|
Paths::Paths() = default;
|
|
|
|
|
MYXLIB_INLINE Paths::Paths() = default;
|
|
|
|
|
|
|
|
|
|
Paths::HierarchyType Paths::getHierarchyType()
|
|
|
|
|
MYXLIB_INLINE Paths::HierarchyType Paths::getHierarchyType()
|
|
|
|
|
{
|
|
|
|
|
QRegExp binUnityRegexp( "/s*bin/unity$" );
|
|
|
|
|
QRegExp binRegexp( "/s*bin$" );
|
|
|
|
@@ -170,7 +170,7 @@ Paths::HierarchyType Paths::getHierarchyType()
|
|
|
|
|
} // Paths::getHierarchyType
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Paths::init( const QString& projectDir, const QString& configFileExtension )
|
|
|
|
|
MYXLIB_INLINE bool Paths::init( const QString& projectDir, const QString& configFileExtension )
|
|
|
|
|
{
|
|
|
|
|
m_projectName = projectDir.isEmpty() ? m_currentExecutable.m_canonicalFilePath.fileName()
|
|
|
|
|
: projectDir;
|
|
|
|
@@ -214,7 +214,7 @@ bool Paths::init( const QString& projectDir, const QString& configFileExtension
|
|
|
|
|
} // Paths::updatePaths
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Paths::makeDefaultDirectories()
|
|
|
|
|
MYXLIB_INLINE bool Paths::makeDefaultDirectories()
|
|
|
|
|
{
|
|
|
|
|
bool status = true;
|
|
|
|
|
|
|
|
|
@@ -226,7 +226,7 @@ bool Paths::makeDefaultDirectories()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString Paths::findConfigFile( const QString& defaultConfigFile )
|
|
|
|
|
MYXLIB_INLINE QString Paths::findConfigFile( const QString& defaultConfigFile )
|
|
|
|
|
{
|
|
|
|
|
if ( !defaultConfigFile.isEmpty() && QFileInfo( defaultConfigFile ).isReadable() )
|
|
|
|
|
{
|
|
|
|
@@ -251,103 +251,103 @@ QString Paths::findConfigFile( const QString& defaultConfigFile )
|
|
|
|
|
} // Paths::findConfigFile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QDir Paths::executableFileDirectory() const
|
|
|
|
|
MYXLIB_INLINE QDir Paths::executableFileDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_currentExecutable.m_canonicalFilePath.dir() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::userConfigDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::userConfigDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_userConfigDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::systemConfigDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::systemConfigDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_systemConfigDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QFileInfo& Paths::configFilePath() const
|
|
|
|
|
MYXLIB_INLINE const QFileInfo& Paths::configFilePath() const
|
|
|
|
|
{
|
|
|
|
|
return( m_configFilePath );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QString& Paths::configFileName() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::configFileName() const
|
|
|
|
|
{
|
|
|
|
|
return( m_configFileName );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QString& Paths::configFileExtension() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::configFileExtension() const
|
|
|
|
|
{
|
|
|
|
|
return( m_configFileExtension );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::userVarDataDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::userVarDataDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_userVarDataDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::systemVarDataDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::systemVarDataDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_systemVarDataDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::userConstDataDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::userConstDataDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_userConstDataDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::systemConstDataDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::systemConstDataDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_systemConstDataDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::userLogDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::userLogDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_userLogDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::systemLogDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::systemLogDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_systemLogDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::tempDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::tempDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_tempDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QDir& Paths::homeDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::homeDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_homeDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QString& Paths::projectName() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::projectName() const
|
|
|
|
|
{
|
|
|
|
|
return( m_projectName );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString Paths::executableFileName() const
|
|
|
|
|
MYXLIB_INLINE QString Paths::executableFileName() const
|
|
|
|
|
{
|
|
|
|
|
return( m_currentExecutable.m_canonicalFilePath.fileName() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QFileInfo& Paths::executableFilePath() const
|
|
|
|
|
MYXLIB_INLINE const QFileInfo& Paths::executableFilePath() const
|
|
|
|
|
{
|
|
|
|
|
return( m_currentExecutable.m_canonicalFilePath );
|
|
|
|
|
}
|
|
|
|
|