Форматирование кода
This commit is contained in:
@ -63,16 +63,16 @@ Paths::Paths()
|
||||
{
|
||||
m_prefixDirectory = "/opt/" + QCoreApplication::organizationName().toLower() +
|
||||
"/" + QCoreApplication::applicationName().toLower();
|
||||
m_binaryDirectory = m_prefixDirectory.absolutePath() + "/bin";
|
||||
m_configDirectory = m_prefixDirectory.absolutePath() + "/etc";
|
||||
m_cacheDirectory = m_prefixDirectory.absolutePath() + "/var";
|
||||
m_tempDirectory = QString::fromLocal8Bit( qgetenv( qPrintable( "TMPDIR" ) ) );
|
||||
m_dataDirectory = m_prefixDirectory.absolutePath() + "/share";
|
||||
m_homeDirectory = QString::fromLocal8Bit( qgetenv( qPrintable( "HOME" ) ) );
|
||||
m_binaryDirectory = m_prefixDirectory.absolutePath() + "/bin";
|
||||
m_configDirectory = m_prefixDirectory.absolutePath() + "/etc";
|
||||
m_cacheDirectory = m_prefixDirectory.absolutePath() + "/var";
|
||||
m_tempDirectory = QString::fromLocal8Bit( qgetenv( qPrintable( "TMPDIR" ) ) );
|
||||
m_dataDirectory = m_prefixDirectory.absolutePath() + "/share";
|
||||
m_homeDirectory = QString::fromLocal8Bit( qgetenv( qPrintable( "HOME" ) ) );
|
||||
m_executableFileName = QCoreApplication::applicationName().toLower();
|
||||
m_configFileName = m_executableFileName + ".conf";
|
||||
m_configFileName = m_executableFileName + ".conf";
|
||||
m_executableFilePath = m_binaryDirectory.absolutePath() + "/" + m_executableFileName;
|
||||
m_configFilePath = m_binaryDirectory.absolutePath() + "/" + m_configFileName;
|
||||
m_configFilePath = m_binaryDirectory.absolutePath() + "/" + m_configFileName;
|
||||
|
||||
|
||||
if ( m_tempDirectory.absolutePath().isEmpty() || ( m_tempDirectory.path() == "." ) )
|
||||
@ -159,17 +159,17 @@ bool Paths::updatePaths()
|
||||
whereami::whereami_path_t executablePath = whereami::getExecutablePath();
|
||||
|
||||
m_executableFileName = QString::fromStdString( executablePath.basename() );
|
||||
m_binaryDirectory = QString::fromStdString( executablePath.dirname() );
|
||||
m_binaryDirectory = QString::fromStdString( executablePath.dirname() );
|
||||
m_executableFilePath = QFile( m_binaryDirectory.absolutePath() + "/" + m_executableFileName );
|
||||
|
||||
if ( m_binaryDirectory.absolutePath().endsWith( "/bin" ) )
|
||||
{
|
||||
m_prefixDirectory = m_binaryDirectory.absolutePath().remove( QRegExp( "/bin$" ) );
|
||||
m_configDirectory = m_prefixDirectory.absolutePath() + "/etc";
|
||||
m_cacheDirectory = m_prefixDirectory.absolutePath() + "/var";
|
||||
m_dataDirectory = m_prefixDirectory.absolutePath() + "/share";
|
||||
m_configFilePath = QFile( m_configDirectory.absolutePath() + "/" +
|
||||
QCoreApplication::applicationName() + ".conf" );
|
||||
m_cacheDirectory = m_prefixDirectory.absolutePath() + "/var";
|
||||
m_dataDirectory = m_prefixDirectory.absolutePath() + "/share";
|
||||
m_configFilePath = QFile( m_configDirectory.absolutePath() + "/" +
|
||||
QCoreApplication::applicationName() + ".conf" );
|
||||
}
|
||||
|
||||
if ( m_prefixDirectory.absolutePath().startsWith( "/opt" ) ||
|
||||
|
@ -11,15 +11,15 @@ namespace filesystem {
|
||||
|
||||
class Paths
|
||||
{
|
||||
QDir m_prefixDirectory;
|
||||
QDir m_binaryDirectory;
|
||||
QDir m_configDirectory;
|
||||
QDir m_cacheDirectory;
|
||||
QDir m_tempDirectory;
|
||||
QDir m_dataDirectory;
|
||||
QDir m_homeDirectory;
|
||||
QString m_executableFileName;
|
||||
QString m_configFileName;
|
||||
QDir m_prefixDirectory;
|
||||
QDir m_binaryDirectory;
|
||||
QDir m_configDirectory;
|
||||
QDir m_cacheDirectory;
|
||||
QDir m_tempDirectory;
|
||||
QDir m_dataDirectory;
|
||||
QDir m_homeDirectory;
|
||||
QString m_executableFileName;
|
||||
QString m_configFileName;
|
||||
QFileInfo m_executableFilePath;
|
||||
QFileInfo m_configFilePath;
|
||||
|
||||
|
@ -51,7 +51,7 @@ int getExecutablePath( char* out, int capacity, int* dirname_length )
|
||||
{
|
||||
char buffer[PATH_MAX];
|
||||
char* resolved = nullptr;
|
||||
int length = -1;
|
||||
int length = -1;
|
||||
|
||||
for (;; )
|
||||
{
|
||||
@ -234,16 +234,16 @@ whereami_path_t::operator const whereami_string_t&() const
|
||||
#endif // if defined( WHEREAMI_CXX11 )
|
||||
|
||||
#if defined( WHEREAMI_CXX11 )
|
||||
whereami_path_t::whereami_path_t( whereami_string_t&& path, int dirname_length ) noexcept
|
||||
: m_path( std::move( path ) ),
|
||||
whereami_path_t::whereami_path_t( whereami_string_t&& path, int dirname_length ) noexcept :
|
||||
m_path ( std::move( path ) ),
|
||||
m_dirnameLength( dirname_length )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
whereami_path_t::whereami_path_t( whereami_string_t& path, int dirname_length )
|
||||
: m_path( path ),
|
||||
whereami_path_t::whereami_path_t( whereami_string_t& path, int dirname_length ) :
|
||||
m_path ( path ),
|
||||
m_dirnameLength( dirname_length )
|
||||
{
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ private:
|
||||
#endif
|
||||
|
||||
whereami_string_t m_path;
|
||||
int m_dirnameLength;
|
||||
int m_dirnameLength;
|
||||
}; // class whereami_path_t
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user