mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 01:05:35 +08:00
refs #865, make log directory available for blackmisc
This commit is contained in:
committed by
Mathew Sutcliffe
parent
68dccbefa6
commit
301db27945
@@ -14,10 +14,10 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QRegularExpression>
|
||||
#include <QStandardPaths>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
QString applicationDirectoryPathImpl()
|
||||
{
|
||||
QString appDirectoryString(qApp->applicationDirPath());
|
||||
@@ -49,6 +49,15 @@ namespace BlackMisc
|
||||
return appDir;
|
||||
}
|
||||
|
||||
const QString &CDirectoryUtils::getLogDirectory()
|
||||
{
|
||||
static const QString logPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
|
||||
"/org.swift-project/" +
|
||||
CDirectoryUtils::normalizedApplicationDirectory() +
|
||||
"/logs";
|
||||
return logPath;
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#define BLACKMISC_DIRECTORYUTILS_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -32,8 +31,11 @@ namespace BlackMisc
|
||||
//! \note There is no trailing '/'.
|
||||
//! \warning The normalization rules are implementation specific and could change over time.
|
||||
static const QString &normalizedApplicationDirectory();
|
||||
};
|
||||
|
||||
//! Directory for log files
|
||||
//! \remark In BlackMisc so it can also be used from BlackMisc classes
|
||||
static const QString &getLogDirectory();
|
||||
};
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user