diff --git a/README.md b/README.md index f5255d9..53c7f85 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Nero's been confirmed to build and work on the following: - Arch Linux (btw), w/ Qt 5.15.16 - Linux Mint 22, Qt 6.4 -For Arch users, Nero can be installed from the AUR @ `[nero-umu](https://aur.archlinux.org/packages/nero-umu)` with your favorite helper app. For others, see building steps below (don't worry, it's not that hard!). +For Arch users, Nero can be installed from the AUR @ [`nero-umu`](https://aur.archlinux.org/packages/nero-umu) with your favorite helper app. For others, see building steps below (don't worry, it's not that hard!). ## Building Requirements for building Nero from source: @@ -92,6 +92,8 @@ The backend tool that Nero relies on, *umu,* is *allegedly* based around a cooki ## TODOs (to do): - Add built-in downloader without external curl use ([#12](https://github.com/SeongGino/Nero-umu/issues/12)) - Add `dxvk.conf` configuration dialog in shortcut settings. + - Make process force-shutdown in runner more reliable + - Since umu can't shut down the processes it spawns, Nero invokes a wineboot end command manually in the prefix, but sometimes the process is still running for some reason and needs external process killing) - Add favorites system - Add shortcuts list sorting system (currently only does ascending alphabetical) - Import shortcuts for newly installed applications to prefix Shortcuts list? diff --git a/src/nerofs.cpp b/src/nerofs.cpp index a71600e..b11ae36 100644 --- a/src/nerofs.cpp +++ b/src/nerofs.cpp @@ -94,7 +94,7 @@ QStringList NeroFS::GetPrefixes() return prefixes; } -void NeroFS::CreateUserLinks(QString prefixName) +void NeroFS::CreateUserLinks(const QString &prefixName) { QDir prefixDir(NeroFS::GetPrefixesPath().path() + '/' + prefixName); if(prefixDir.exists()) { @@ -221,7 +221,7 @@ QString NeroFS::GetWinetricks(const QString &runner) } } -void NeroFS::SetCurrentPrefix(const QString prefix) +void NeroFS::SetCurrentPrefix(const QString &prefix) { currentPrefix = prefix; @@ -243,7 +243,7 @@ QSettings* NeroFS::GetCurrentPrefixCfg() } } -bool NeroFS::SetCurrentPrefixCfg(const QString group, const QString key, const QVariant value) +bool NeroFS::SetCurrentPrefixCfg(const QString &group, const QString &key, const QVariant &value) { GetCurrentPrefixCfg(); if(prefixCfg != nullptr) { @@ -273,7 +273,7 @@ QMap NeroFS::GetCurrentPrefixSettings() return settingsMap; } -void NeroFS::AddNewPrefix(const QString newPrefix, const QString runner) +void NeroFS::AddNewPrefix(const QString &newPrefix, const QString &runner) { prefixes.append(newPrefix); SetCurrentPrefix(newPrefix); @@ -310,7 +310,7 @@ void NeroFS::AddNewPrefix(const QString newPrefix, const QString runner) currentPrefix.clear(); } -void NeroFS::AddNewShortcut(const QString newShortcutHash, const QString newShortcutName, const QString newAppPath) { +void NeroFS::AddNewShortcut(const QString &newShortcutHash, const QString &newShortcutName, const QString &newAppPath) { SetCurrentPrefixCfg("Shortcuts", newShortcutHash, newShortcutName); SetCurrentPrefixCfg(QString("Shortcuts--%1").arg(newShortcutHash), "Name", newShortcutName); SetCurrentPrefixCfg(QString("Shortcuts--%1").arg(newShortcutHash), "Path", newAppPath); @@ -343,7 +343,7 @@ void NeroFS::AddNewShortcut(const QString newShortcutHash, const QString newShor SetCurrentPrefixCfg(QString("Shortcuts--%1").arg(newShortcutHash), "PostRunScript", {""}); } -QMap NeroFS::GetShortcutSettings(const QString shortcutHash) +QMap NeroFS::GetShortcutSettings(const QString &shortcutHash) { GetCurrentPrefixCfg(); if(!prefixCfg->group().isEmpty()) prefixCfg->endGroup(); @@ -395,7 +395,7 @@ QMap NeroFS::GetCurrentShortcutsMap() return shortcutsMap; } -bool NeroFS::DeletePrefix(const QString prefix) +bool NeroFS::DeletePrefix(const QString &prefix) { prefixes.removeOne(prefix); if(QDir(prefixesPath.path() + '/' + prefix).removeRecursively()) @@ -403,7 +403,7 @@ bool NeroFS::DeletePrefix(const QString prefix) else return false; } -void NeroFS::DeleteShortcut(const QString shortcutHash) +void NeroFS::DeleteShortcut(const QString &shortcutHash) { GetCurrentPrefixCfg(); if(!prefixCfg->group().isEmpty()) prefixCfg->endGroup(); diff --git a/src/nerofs.h b/src/nerofs.h index f156960..0a2d7ea 100644 --- a/src/nerofs.h +++ b/src/nerofs.h @@ -55,13 +55,13 @@ class NeroFS static QStringList GetCurrentPrefixShortcuts(); static QMap GetCurrentPrefixSettings(); static QMap GetCurrentShortcutsMap(); - static QMap GetShortcutSettings(const QString); + static QMap GetShortcutSettings(const QString &); static QSettings GetManagerCfg() { return QSettings(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/Nero-UMU.ini", QSettings::IniFormat); } - static void CreateUserLinks(const QString); - static void AddNewPrefix(const QString, const QString); - static void AddNewShortcut(const QString, const QString, const QString); - static bool DeletePrefix(const QString); - static void DeleteShortcut(const QString); + static void CreateUserLinks(const QString &); + static void AddNewPrefix(const QString &, const QString &); + static void AddNewShortcut(const QString &, const QString &, const QString &); + static bool DeletePrefix(const QString &); + static void DeleteShortcut(const QString &); static QSettings* GetCurrentPrefixCfg(); @@ -70,9 +70,9 @@ class NeroFS static QString GetUmU(); static QString GetWinetricks(const QString & = ""); - static void SetCurrentPrefix(const QString); - static bool SetCurrentPrefixCfg(const QString, const QString, const QVariant); - static void AddNewShortcutSetting(const QString shortcutHash, const QString key, const QVariant value) { + static void SetCurrentPrefix(const QString &); + static bool SetCurrentPrefixCfg(const QString &, const QString &, const QVariant &); + static void AddNewShortcutSetting(const QString &shortcutHash, const QString &key, const QVariant &value) { SetCurrentPrefixCfg(QString("Shortcuts--%1").arg(shortcutHash), key, value); } }; diff --git a/src/neromanager.cpp b/src/neromanager.cpp index 538919b..c7232ad 100644 --- a/src/neromanager.cpp +++ b/src/neromanager.cpp @@ -33,7 +33,6 @@ #include #include #include -#include NeroManagerWindow::NeroManagerWindow(QWidget *parent) : QMainWindow(parent) @@ -267,7 +266,7 @@ void NeroManagerWindow::RenderPrefixList() } } -void NeroManagerWindow::CreatePrefix(const QString newPrefix, const QString runner, QStringList tricksToInstall) +void NeroManagerWindow::CreatePrefix(const QString &newPrefix, const QString &runner, QStringList tricksToInstall) { QProcess umu; QMessageBox waitBox(QMessageBox::NoIcon, @@ -282,7 +281,7 @@ void NeroManagerWindow::CreatePrefix(const QString newPrefix, const QString runn env.insert("WINEPREFIX", NeroFS::GetPrefixesPath().path() + '/' + newPrefix); env.insert("GAMEID", "0"); env.insert("PROTONPATH", NeroFS::GetProtonsPath().path() + '/' + runner); - env.insert("UMU_RUNTIME_UPDATE", "0"); + //env.insert("UMU_RUNTIME_UPDATE", "0"); umu.setProcessEnvironment(env); umu.setProcessChannelMode(QProcess::MergedChannels); @@ -393,7 +392,7 @@ void NeroManagerWindow::CheckWinetricks() } } -void NeroManagerWindow::AddTricks(QStringList verbs, const QString prefix) +void NeroManagerWindow::AddTricks(QStringList verbs, const QString &prefix) { QProcess umu; QMessageBox waitBox(QMessageBox::NoIcon, @@ -407,14 +406,13 @@ void NeroManagerWindow::AddTricks(QStringList verbs, const QString prefix) QMap settingsMap = NeroFS::GetCurrentPrefixSettings(); - env.insert("WINEPREFIX", QString("%1/%2").arg(NeroFS::GetPrefixesPath().path(), prefix)); + env.insert("WINEPREFIX", NeroFS::GetPrefixesPath().path() + '/' + prefix); env.insert("GAMEID", "0"); - env.insert("PROTONPATH", QString("%1/%2").arg(NeroFS::GetProtonsPath().path(), settingsMap["CurrentRunner"].toString())); - env.insert("UMU_RUNTIME_UPDATE", "0"); + env.insert("PROTONPATH", NeroFS::GetProtonsPath().path() + '/' + settingsMap["CurrentRunner"].toString()); + //env.insert("UMU_RUNTIME_UPDATE", "0"); umu.setProcessEnvironment(env); umu.setProcessChannelMode(QProcess::MergedChannels); - verbs.prepend("winetricks"); umu.start(NeroFS::GetUmU(), verbs); verbs.removeFirst(); diff --git a/src/neromanager.h b/src/neromanager.h index 555b086..ceba133 100644 --- a/src/neromanager.h +++ b/src/neromanager.h @@ -142,8 +142,8 @@ private slots: void CheckWinetricks(); void RenderPrefixes(); void RenderPrefixList(); - void CreatePrefix(const QString newPrefix, const QString runner, QStringList tricksToInstall = {}); - void AddTricks(QStringList verbs, const QString prefix); + void CreatePrefix(const QString &, const QString &, QStringList tricksToInstall = {}); + void AddTricks(QStringList, const QString &); void RenderShortcuts(); void CleanupShortcuts(); void StartBlinkTimer();