Форматирование кода

This commit is contained in:
2019-10-21 20:35:50 +03:00
parent 671f0f3ec4
commit 18ecd62eb7
7 changed files with 57 additions and 57 deletions

View File

@ -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" ) ||

View File

@ -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;

View File

@ -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 )
{
}

View File

@ -103,7 +103,7 @@ private:
#endif
whereami_string_t m_path;
int m_dirnameLength;
int m_dirnameLength;
}; // class whereami_path_t
/**