mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 19:57:45 +00:00
Move logs to data directory
This commit is contained in:
parent
06704728b7
commit
f3c46d3a3b
7 changed files with 17 additions and 43 deletions
|
@ -8,7 +8,6 @@
|
|||
|
||||
namespace Utility
|
||||
{
|
||||
QDir stateDirectory();
|
||||
QString toWindowsPath(const QDir &dir);
|
||||
void printRequest(const QString &type, const QNetworkRequest &request);
|
||||
void createPathIfNeeded(const QDir &dir);
|
||||
|
|
|
@ -63,7 +63,6 @@ void GameRunner::beginDalamudGame(const QString &gameExecutablePath, Profile &pr
|
|||
|
||||
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||
const QDir configDir = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||
const QDir stateDir = Utility::stateDirectory();
|
||||
const QDir dalamudDir = dataDir.absoluteFilePath(QStringLiteral("dalamud"));
|
||||
|
||||
const QDir dalamudConfigDir = configDir.absoluteFilePath(QStringLiteral("dalamud"));
|
||||
|
@ -76,7 +75,7 @@ void GameRunner::beginDalamudGame(const QString &gameExecutablePath, Profile &pr
|
|||
// so we need to match typical XIVQuickLauncher behavior here. Why? I have no clue.
|
||||
const QDir dalamudPluginDir = dalamudUserPluginDir.absoluteFilePath(QStringLiteral("installedPlugins"));
|
||||
|
||||
const QString logDir = stateDir.absoluteFilePath(QStringLiteral("log"));
|
||||
const QString logDir = dataDir.absoluteFilePath(QStringLiteral("log"));
|
||||
Utility::createPathIfNeeded(logDir);
|
||||
|
||||
const QDir dalamudRuntimeDir = dalamudDir.absoluteFilePath(QStringLiteral("runtime"));
|
||||
|
@ -241,7 +240,8 @@ void GameRunner::launchExecutable(const Profile &profile, QProcess *process, con
|
|||
// env.insert(QStringLiteral("VK_LAYER_RENDERDOC_Capture"), QStringLiteral("VK_LAYER_RENDERDOC_Capture"));
|
||||
// env.insert(QStringLiteral("ENABLE_VULKAN_RENDERDOC_CAPTURE"), QString::number(1));
|
||||
|
||||
const QString logDir = Utility::stateDirectory().absoluteFilePath(QStringLiteral("log"));
|
||||
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||
const QString logDir = dataDir.absoluteFilePath(QStringLiteral("log"));
|
||||
|
||||
env.insert(QStringLiteral("DXVK_LOG_PATH"), logDir);
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,8 @@ public:
|
|||
|
||||
void initialize()
|
||||
{
|
||||
const QDir logDirectory = Utility::stateDirectory().absoluteFilePath(QStringLiteral("log"));
|
||||
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||
const QDir logDirectory = dataDir.absoluteFilePath(QStringLiteral("log"));
|
||||
Utility::createPathIfNeeded(logDirectory);
|
||||
|
||||
// Sort them from highest to lowest (4, 3, 2, 1, 0)
|
||||
|
|
|
@ -23,9 +23,6 @@ using namespace Qt::StringLiterals;
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
initializeLogging();
|
||||
setup_physis_logging();
|
||||
|
||||
QtWebView::initialize();
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
@ -67,6 +64,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
KAboutData::setApplicationData(about);
|
||||
|
||||
initializeLogging();
|
||||
setup_physis_logging();
|
||||
|
||||
QCommandLineParser parser;
|
||||
about.setupCommandLine(&parser);
|
||||
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
#include "processlogger.h"
|
||||
#include "astra_log.h"
|
||||
#include "utility.h"
|
||||
#include <QStandardPaths>
|
||||
|
||||
ProcessLogger::ProcessLogger(QProcess *process)
|
||||
{
|
||||
const QDir logDirectory = Utility::stateDirectory().absoluteFilePath(QStringLiteral("log"));
|
||||
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||
const QDir logDirectory = dataDir.absoluteFilePath(QStringLiteral("log"));
|
||||
|
||||
m_file.setFileName(logDirectory.absoluteFilePath(QStringLiteral("ffxiv.log")));
|
||||
m_file.open(QIODevice::WriteOnly | QIODevice::Unbuffered);
|
||||
|
|
|
@ -9,18 +9,6 @@
|
|||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
QDir Utility::stateDirectory()
|
||||
{
|
||||
if (qEnvironmentVariableIsSet("XDG_STATE_HOME")) {
|
||||
return qEnvironmentVariable("XDG_STATE_HOME");
|
||||
}
|
||||
|
||||
const QDir homeDir = QStandardPaths::standardLocations(QStandardPaths::HomeLocation)[0];
|
||||
const QDir localDir = homeDir.absoluteFilePath(QStringLiteral(".local"));
|
||||
const QDir stateDir = localDir.absoluteFilePath(QStringLiteral("state"));
|
||||
return stateDir.absoluteFilePath(QStringLiteral("astra"));
|
||||
}
|
||||
|
||||
QString Utility::toWindowsPath(const QDir &dir)
|
||||
{
|
||||
return QStringLiteral("Z:") + dir.absolutePath().replace('/'_L1, '\\'_L1);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
app-id: zone.xiv.astra
|
||||
runtime: org.kde.Platform
|
||||
runtime-version: '6.6'
|
||||
cruntime-version: '6.6-kf6preview'
|
||||
sdk: org.kde.Sdk
|
||||
sdk-extensions:
|
||||
- org.freedesktop.Sdk.Extension.rust-stable
|
||||
|
@ -24,7 +24,7 @@ finish-args:
|
|||
- --device=all
|
||||
- --allow=devel
|
||||
modules:
|
||||
- flatpak/kf6.json
|
||||
#- flatpak/kf6.json
|
||||
- flatpak/kirigami-addons.json
|
||||
- name: unshield
|
||||
buildsystem: cmake-ninja
|
||||
|
@ -33,7 +33,8 @@ modules:
|
|||
url: https://github.com/twogood/unshield.git
|
||||
branch: main
|
||||
- name: unshield
|
||||
buildsystem: meson
|
||||
cleanup:
|
||||
- /bin
|
||||
config-opts:
|
||||
- -Dmanpage=false
|
||||
- -Dvapi=false
|
||||
|
@ -49,6 +50,8 @@ modules:
|
|||
- name: libsecret
|
||||
- stable-only: true
|
||||
- name: qtkeychain
|
||||
cleanup:
|
||||
- /bin
|
||||
buildsystem: cmake-ninja
|
||||
config-opts:
|
||||
- -DBUILD_WITH_QT6=ON
|
||||
|
@ -59,11 +62,6 @@ modules:
|
|||
- type: git
|
||||
url: https://github.com/frankosterfeld/qtkeychain.git
|
||||
branch: main
|
||||
- name: quazip
|
||||
buildsystem: cmake-ninja
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/stachenov/quazip.git
|
||||
- name: steamwrap
|
||||
buildsystem: simple
|
||||
build-commands:
|
||||
|
@ -80,20 +78,6 @@ modules:
|
|||
- type: file
|
||||
url: https://xiv.zone/distrib/steamwrap/libsteam_api.so
|
||||
sha256: b50b9d313eb554792216762f5cc0b972cfae14149f720440e0f0d6c4563c951f
|
||||
- name: qcoro
|
||||
buildsystem: cmake-ninja
|
||||
config-optios:
|
||||
- -DQCORO_BUILD_EXAMPLES=OFF
|
||||
- -DBUILD_TESTING=OFF
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://github.com/danvratil/qcoro/archive/refs/tags/v0.7.0.tar.gz
|
||||
sha256: 23ef0217926e67c8d2eb861cf91617da2f7d8d5a9ae6c62321b21448b1669210
|
||||
x-checker-data:
|
||||
- type: anitya
|
||||
project-id: 236236
|
||||
stable-only: true
|
||||
url-template: https://github.com/danvratil/qcoro/archive/refs/tags/v$version.tar.gz
|
||||
- name: qt6-qtwebview
|
||||
buildsystem: cmake-ninja
|
||||
cleanup-platform:
|
||||
|
|
Loading…
Add table
Reference in a new issue