|
|
|
@ -21,150 +21,129 @@ namespace filesystem {
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE Paths::Paths() = default;
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE Paths::HierarchyType Paths::getHierarchyType() // -V2008
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE void Paths::setupSystemDirectories( const QString& defaultEtcDirectory,
|
|
|
|
|
const QString& defaultConstDataDirectory,
|
|
|
|
|
const QString& defaultVarDataDirectory,
|
|
|
|
|
const QString& defaultLogDirectory )
|
|
|
|
|
{
|
|
|
|
|
QFileInfo etcDirInfo { defaultEtcDirectory };
|
|
|
|
|
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() )
|
|
|
|
|
{
|
|
|
|
|
m_systemConfigDirectory = defaultEtcDirectory;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_systemConfigDirectory = m_userConfigDirectory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFileInfo constDataDirInfo { defaultConstDataDirectory };
|
|
|
|
|
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() )
|
|
|
|
|
{
|
|
|
|
|
m_systemConstDataDirectory = defaultConstDataDirectory;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_systemConstDataDirectory = m_userConstDataDirectory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFileInfo varDataDirInfo { defaultVarDataDirectory };
|
|
|
|
|
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() )
|
|
|
|
|
{
|
|
|
|
|
m_systemVarDataDirectory = defaultVarDataDirectory;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_systemVarDataDirectory = m_userVarDataDirectory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFileInfo logDirInfo { defaultLogDirectory };
|
|
|
|
|
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() )
|
|
|
|
|
{
|
|
|
|
|
m_systemLogDirectory = defaultLogDirectory;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_systemLogDirectory = m_userLogDirectory;
|
|
|
|
|
}
|
|
|
|
|
} // Paths::setupSystemDirectories
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Paths::HierarchyType Paths::getHierarchyType()
|
|
|
|
|
{
|
|
|
|
|
QRegExp binUnityRegexp( "/s*bin/unity$" );
|
|
|
|
|
QRegExp binRegexp( "/s*bin$" );
|
|
|
|
|
auto binaryDir = m_currentExecutable.m_canonicalFilePath.canonicalPath();
|
|
|
|
|
auto binaryDir = m_executableDirectory;
|
|
|
|
|
|
|
|
|
|
if ( binUnityRegexp.indexIn( binaryDir ) >= 0 )
|
|
|
|
|
{
|
|
|
|
|
binaryDir.remove( binUnityRegexp );
|
|
|
|
|
|
|
|
|
|
QFileInfo etcDirInfo { binaryDir + "/etc" };
|
|
|
|
|
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo constDataDirInfo { binaryDir + "/files/data" };
|
|
|
|
|
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo varDataDirInfo { binaryDir + "/files/lib" };
|
|
|
|
|
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo logDirInfo { binaryDir + "/files/log" };
|
|
|
|
|
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
m_systemConfigDirectory = etcDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemConstDataDirectory = constDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemVarDataDirectory = varDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemLogDirectory = logDirInfo.canonicalFilePath();
|
|
|
|
|
setupSystemDirectories( binaryDir + "/etc",
|
|
|
|
|
binaryDir + "/files/data",
|
|
|
|
|
binaryDir + "/files/lib",
|
|
|
|
|
binaryDir + "/files/log" );
|
|
|
|
|
|
|
|
|
|
return ( HierarchyType::kDevelopment );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QRegExp binRegexp( "/s*bin$" );
|
|
|
|
|
if ( binRegexp.indexIn( binaryDir ) == -1 )
|
|
|
|
|
{
|
|
|
|
|
m_systemConstDataDirectory = m_executableDirectory;
|
|
|
|
|
m_systemVarDataDirectory = m_executableDirectory;
|
|
|
|
|
m_systemConfigDirectory = m_executableDirectory;
|
|
|
|
|
m_systemLogDirectory = m_executableDirectory;
|
|
|
|
|
|
|
|
|
|
return ( HierarchyType::kFlat );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QRegExp optRegexp( "^/opt(/|/.+/)" + m_projectName + "/" );
|
|
|
|
|
|
|
|
|
|
if ( optRegexp.indexIn( binaryDir ) >= 0 )
|
|
|
|
|
{
|
|
|
|
|
binaryDir.remove( binRegexp );
|
|
|
|
|
QFileInfo etcDirInfo { binaryDir + "/etc" };
|
|
|
|
|
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo constDataDirInfo { binaryDir + "/files/data" };
|
|
|
|
|
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo varDataDirInfo { binaryDir + "/files/lib" };
|
|
|
|
|
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo logDirInfo { binaryDir + "/files/log" };
|
|
|
|
|
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
m_systemConfigDirectory = etcDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemConstDataDirectory = constDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemVarDataDirectory = varDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemLogDirectory = logDirInfo.canonicalFilePath();
|
|
|
|
|
setupSystemDirectories( binaryDir + "/etc",
|
|
|
|
|
binaryDir + "/files/data",
|
|
|
|
|
binaryDir + "/files/lib",
|
|
|
|
|
binaryDir + "/files/log" );
|
|
|
|
|
|
|
|
|
|
return ( HierarchyType::kOpt );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( binaryDir.startsWith( QStringLiteral( "/usr/local" ) ) )
|
|
|
|
|
{
|
|
|
|
|
QFileInfo etcDirInfo { "/usr/local/etc/" + m_projectName };
|
|
|
|
|
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo constDataDirInfo { "/usr/local/share/" + m_projectName };
|
|
|
|
|
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo varDataDirInfo { "/var/lib/" + m_projectName };
|
|
|
|
|
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo logDirInfo { "/var/log/" + m_projectName };
|
|
|
|
|
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
m_systemConfigDirectory = etcDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemConstDataDirectory = constDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemVarDataDirectory = varDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemLogDirectory = logDirInfo.canonicalFilePath();
|
|
|
|
|
setupSystemDirectories( "/usr/local/etc/" + m_projectName,
|
|
|
|
|
"/usr/local/share/" + m_projectName,
|
|
|
|
|
"/var/lib/" + m_projectName,
|
|
|
|
|
"/var/log/" + m_projectName );
|
|
|
|
|
|
|
|
|
|
return ( HierarchyType::kUsr );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( binaryDir.startsWith( QStringLiteral( "/usr" ) ) )
|
|
|
|
|
{
|
|
|
|
|
QFileInfo etcDirInfo { "/etc/" + m_projectName };
|
|
|
|
|
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo constDataDirInfo { "/usr/share/" + m_projectName };
|
|
|
|
|
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo varDataDirInfo { "/var/lib/" + m_projectName };
|
|
|
|
|
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo logDirInfo { "/var/log/" + m_projectName };
|
|
|
|
|
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
m_systemConfigDirectory = etcDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemConstDataDirectory = constDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemVarDataDirectory = varDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemLogDirectory = logDirInfo.canonicalFilePath();
|
|
|
|
|
setupSystemDirectories( "/etc/" + m_projectName,
|
|
|
|
|
"/usr/share/" + m_projectName,
|
|
|
|
|
"/var/lib/" + m_projectName,
|
|
|
|
|
"/var/log/" + m_projectName );
|
|
|
|
|
|
|
|
|
|
return ( HierarchyType::kUsr );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( binaryDir.startsWith( m_homeDirectory.canonicalPath() + "/.local/bin" ) ||
|
|
|
|
|
binaryDir.startsWith( m_homeDirectory.canonicalPath() + "/bin" ) )
|
|
|
|
|
if ( binaryDir.startsWith( m_homeDirectory + "/.local/bin" ) ||
|
|
|
|
|
binaryDir.startsWith( m_homeDirectory + "/bin" ) )
|
|
|
|
|
{
|
|
|
|
|
QFileInfo etcDirInfo { m_userConfigDirectory.canonicalPath() };
|
|
|
|
|
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo constDataDirInfo { m_userConstDataDirectory.canonicalPath() };
|
|
|
|
|
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo varDataDirInfo { m_userVarDataDirectory.canonicalPath() };
|
|
|
|
|
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo logDirInfo { m_userLogDirectory.canonicalPath() };
|
|
|
|
|
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
m_systemConfigDirectory = etcDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemConstDataDirectory = constDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemVarDataDirectory = varDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemLogDirectory = logDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemConfigDirectory = m_userConfigDirectory;
|
|
|
|
|
m_systemConstDataDirectory = m_userConstDataDirectory;
|
|
|
|
|
m_systemVarDataDirectory = m_userVarDataDirectory;
|
|
|
|
|
m_systemLogDirectory = m_userLogDirectory;
|
|
|
|
|
|
|
|
|
|
return( HierarchyType::kHome );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
binaryDir.remove( binRegexp );
|
|
|
|
|
|
|
|
|
|
QFileInfo etcDirInfo { binaryDir + "/etc" };
|
|
|
|
|
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo constDataDirInfo { binaryDir + "/files/data" };
|
|
|
|
|
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo varDataDirInfo { binaryDir + "/files/lib" };
|
|
|
|
|
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
QFileInfo logDirInfo { binaryDir + "/files/log" };
|
|
|
|
|
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
|
|
|
|
|
|
|
|
|
m_systemConfigDirectory = etcDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemConstDataDirectory = constDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemVarDataDirectory = varDataDirInfo.canonicalFilePath();
|
|
|
|
|
m_systemLogDirectory = logDirInfo.canonicalFilePath();
|
|
|
|
|
setupSystemDirectories( binaryDir + "/etc",
|
|
|
|
|
binaryDir + "/files/data",
|
|
|
|
|
binaryDir + "/files/lib",
|
|
|
|
|
binaryDir + "/files/log" );
|
|
|
|
|
|
|
|
|
|
return ( HierarchyType::kDevelopment );
|
|
|
|
|
} // Paths::getHierarchyType
|
|
|
|
@ -172,7 +151,12 @@ MYXLIB_INLINE Paths::HierarchyType Paths::getHierarchyType() // -V2008
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE bool Paths::init( const QString& projectDir, const QString& configFileExtension )
|
|
|
|
|
{
|
|
|
|
|
m_projectName = projectDir.isEmpty() ? m_currentExecutable.m_canonicalFilePath.fileName()
|
|
|
|
|
CurrentExecutable exe;
|
|
|
|
|
m_executableName = exe.m_canonicalFilePath.fileName();
|
|
|
|
|
m_executableFilePath = exe.m_canonicalFilePath.absoluteFilePath();
|
|
|
|
|
m_executableDirectory = exe.m_canonicalFilePath.absolutePath();
|
|
|
|
|
|
|
|
|
|
m_projectName = projectDir.isEmpty() ? m_executableName
|
|
|
|
|
: projectDir;
|
|
|
|
|
m_configFileExtension = configFileExtension.isEmpty() ? QStringLiteral( "conf" )
|
|
|
|
|
: configFileExtension;
|
|
|
|
@ -184,14 +168,14 @@ MYXLIB_INLINE bool Paths::init( const QString& projectDir, const QString& config
|
|
|
|
|
auto configHome = QString::fromLocal8Bit( qgetenv( "XDG_CONFIG_HOME" ) );
|
|
|
|
|
if ( configHome.isEmpty() )
|
|
|
|
|
{
|
|
|
|
|
configHome = m_homeDirectory.canonicalPath() + "/.config";
|
|
|
|
|
configHome = m_homeDirectory + "/.config";
|
|
|
|
|
}
|
|
|
|
|
m_userConfigDirectory = configHome + "/" + m_projectName;
|
|
|
|
|
|
|
|
|
|
auto dataHome = QString::fromLocal8Bit( qgetenv( "XDG_DATA_HOME" ) );
|
|
|
|
|
if ( dataHome.isEmpty() )
|
|
|
|
|
{
|
|
|
|
|
dataHome = m_homeDirectory.canonicalPath() + "/.local/share";
|
|
|
|
|
dataHome = m_homeDirectory + "/.local/share";
|
|
|
|
|
}
|
|
|
|
|
dataHome += "/" + m_projectName;
|
|
|
|
|
m_userConstDataDirectory = dataHome + "/data";
|
|
|
|
@ -200,15 +184,7 @@ MYXLIB_INLINE bool Paths::init( const QString& projectDir, const QString& config
|
|
|
|
|
|
|
|
|
|
m_hierarchyType = getHierarchyType();
|
|
|
|
|
|
|
|
|
|
if ( m_hierarchyType == HierarchyType::kFlat )
|
|
|
|
|
{
|
|
|
|
|
m_systemConstDataDirectory = m_currentExecutable.m_canonicalFilePath.canonicalPath();
|
|
|
|
|
m_systemVarDataDirectory = m_currentExecutable.m_canonicalFilePath.canonicalPath();
|
|
|
|
|
m_systemConfigDirectory = m_currentExecutable.m_canonicalFilePath.canonicalPath();
|
|
|
|
|
m_systemLogDirectory = m_currentExecutable.m_canonicalFilePath.canonicalPath();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_configFilePath = m_systemConfigDirectory.canonicalPath() + "/" + m_configFileName;
|
|
|
|
|
m_configFilePath = m_systemConfigDirectory + "/" + m_configFileName;
|
|
|
|
|
|
|
|
|
|
return( true );
|
|
|
|
|
} // Paths::updatePaths
|
|
|
|
@ -217,11 +193,17 @@ MYXLIB_INLINE bool Paths::init( const QString& projectDir, const QString& config
|
|
|
|
|
MYXLIB_INLINE bool Paths::makeDefaultDirectories()
|
|
|
|
|
{
|
|
|
|
|
bool status = true;
|
|
|
|
|
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_userLogDirectory )) { status = false; };
|
|
|
|
|
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_systemLogDirectory )) { status = false; };
|
|
|
|
|
|
|
|
|
|
if ( !m_userConfigDirectory.mkpath( m_userConfigDirectory.absolutePath() ) ) { status = false; }
|
|
|
|
|
if ( !m_userVarDataDirectory.mkpath( m_userVarDataDirectory.absolutePath() ) ) { status = false; }
|
|
|
|
|
if ( !m_userConstDataDirectory.mkpath( m_userConstDataDirectory.absolutePath() ) ) { status = false; }
|
|
|
|
|
if ( !m_userLogDirectory.mkpath( m_userLogDirectory.absolutePath() ) ) { status = false; }
|
|
|
|
|
return( status );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -244,32 +226,26 @@ MYXLIB_INLINE QString Paths::findConfigFile( const QString& defaultConfigFile )
|
|
|
|
|
|
|
|
|
|
if ( QFileInfo( m_configFilePath ).isReadable() )
|
|
|
|
|
{
|
|
|
|
|
return( m_configFilePath.absoluteFilePath() );
|
|
|
|
|
return( m_configFilePath );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return( QString() );
|
|
|
|
|
} // Paths::findConfigFile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE QDir Paths::executableFileDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_currentExecutable.m_canonicalFilePath.dir() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::userConfigDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::userConfigDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_userConfigDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::systemConfigDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::systemConfigDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_systemConfigDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QFileInfo& Paths::configFilePath() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::configFilePath() const
|
|
|
|
|
{
|
|
|
|
|
return( m_configFilePath );
|
|
|
|
|
}
|
|
|
|
@ -287,49 +263,49 @@ MYXLIB_INLINE const QString& Paths::configFileExtension() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::userVarDataDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::userVarDataDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_userVarDataDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::systemVarDataDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::systemVarDataDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_systemVarDataDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::userConstDataDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::userConstDataDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_userConstDataDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::systemConstDataDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::systemConstDataDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_systemConstDataDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::userLogDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::userLogDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_userLogDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::systemLogDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::systemLogDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_systemLogDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::tempDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::tempDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_tempDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QDir& Paths::homeDirectory() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::homeDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_homeDirectory );
|
|
|
|
|
}
|
|
|
|
@ -341,15 +317,21 @@ MYXLIB_INLINE const QString& Paths::projectName() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE QString Paths::executableFileName() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::executableName() const
|
|
|
|
|
{
|
|
|
|
|
return( m_currentExecutable.m_canonicalFilePath.fileName() );
|
|
|
|
|
return( m_executableName );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QFileInfo& Paths::executableFilePath() const
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::executableFilePath() const
|
|
|
|
|
{
|
|
|
|
|
return( m_currentExecutable.m_canonicalFilePath );
|
|
|
|
|
return( m_executableFilePath );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYXLIB_INLINE const QString& Paths::executableDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return( m_executableDirectory );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace filesystem
|
|
|
|
|