mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-21 20:27:45 +00:00
Small code changes to quiet analyzer
This commit is contained in:
parent
3b77932211
commit
98760624a5
14 changed files with 25 additions and 28 deletions
|
@ -55,11 +55,11 @@ public:
|
|||
physis_Repositories repositories;
|
||||
const char* bootVersion;
|
||||
|
||||
bool isGameInstalled() const {
|
||||
[[nodiscard]] bool isGameInstalled() const {
|
||||
return repositories.repositories_count > 0;
|
||||
}
|
||||
|
||||
bool isWineInstalled() const {
|
||||
[[nodiscard]] bool isWineInstalled() const {
|
||||
return !wineVersion.isEmpty();
|
||||
}
|
||||
|
||||
|
@ -102,12 +102,12 @@ public:
|
|||
/*
|
||||
* Sets a value in the keychain. This function is asynchronous.
|
||||
*/
|
||||
void setKeychainValue(QString key, QString value);
|
||||
void setKeychainValue(const QString& key, const QString& value) const;
|
||||
|
||||
/*
|
||||
* Retrieves a value from the keychain. This function is synchronous.
|
||||
*/
|
||||
QString getKeychainValue(QString key);
|
||||
QString getKeychainValue(const QString& key) const;
|
||||
};
|
||||
|
||||
struct AppSettings {
|
||||
|
@ -142,7 +142,7 @@ class LauncherCore : public QObject {
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(SquareBoot* squareBoot MEMBER squareBoot)
|
||||
public:
|
||||
LauncherCore(bool isSteam);
|
||||
explicit LauncherCore(bool isSteam);
|
||||
|
||||
// used for qml only, TODO: move this to a dedicated factory
|
||||
Q_INVOKABLE LoginInformation* createNewLoginInfo() {
|
||||
|
@ -159,7 +159,7 @@ public:
|
|||
}
|
||||
|
||||
int getProfileIndex(const QString& name);
|
||||
Q_INVOKABLE QList<QString> profileList() const;
|
||||
Q_INVOKABLE [[nodiscard]] QList<QString> profileList() const;
|
||||
int addProfile();
|
||||
int deleteProfile(const QString& name);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
Patcher(QString baseDirectory, GameData* game_data);
|
||||
Patcher(QString baseDirectory, BootData* game_data);
|
||||
|
||||
void processPatchList(QNetworkAccessManager& mgr, QString patchList);
|
||||
void processPatchList(QNetworkAccessManager& mgr, const QString& patchList);
|
||||
|
||||
signals:
|
||||
void done();
|
||||
|
@ -21,7 +21,7 @@ signals:
|
|||
private:
|
||||
void checkIfDone();
|
||||
|
||||
bool isBoot() const {
|
||||
[[nodiscard]] bool isBoot() const {
|
||||
return boot_data != nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ public:
|
|||
|
||||
void setLauncherMode(bool isLauncher);
|
||||
|
||||
bool isDeck() const;
|
||||
[[nodiscard]] bool isDeck() const;
|
||||
|
||||
private:
|
||||
LauncherCore& core;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <QDir>
|
||||
#include <QFormLayout>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QLineEdit>
|
||||
#include <QMenuBar>
|
||||
#include <QNetworkAccessManager>
|
||||
|
@ -647,7 +646,7 @@ QString LauncherCore::getDefaultGamePath() {
|
|||
void LauncherCore::addRegistryKey(const ProfileSettings& settings, QString key, QString value, QString data) {
|
||||
auto process = new QProcess(this);
|
||||
process->setProcessEnvironment(QProcessEnvironment::systemEnvironment());
|
||||
launchExecutable(settings, process, {"reg", "add", std::move(key), "/v", value, "/d", data, "/f"}, false, false);
|
||||
launchExecutable(settings, process, {"reg", "add", std::move(key), "/v", std::move(value), "/d", std::move(data), "/f"}, false, false);
|
||||
}
|
||||
|
||||
void LauncherCore::readGameData(ProfileSettings& profile) {
|
||||
|
@ -698,14 +697,14 @@ bool LauncherCore::autoLogin(ProfileSettings& profile) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void ProfileSettings::setKeychainValue(QString key, QString value) {
|
||||
void ProfileSettings::setKeychainValue(const QString& key, const QString& value) const {
|
||||
auto job = new QKeychain::WritePasswordJob("Astra");
|
||||
job->setTextData(value);
|
||||
job->setKey(name + "-" + key);
|
||||
job->start();
|
||||
}
|
||||
|
||||
QString ProfileSettings::getKeychainValue(QString key) {
|
||||
QString ProfileSettings::getKeychainValue(const QString& key) const {
|
||||
auto loop = new QEventLoop();
|
||||
|
||||
auto job = new QKeychain::ReadPasswordJob("Astra");
|
||||
|
|
|
@ -5,22 +5,23 @@
|
|||
#include <QNetworkRequest>
|
||||
#include <QStandardPaths>
|
||||
#include <physis.hpp>
|
||||
#include <utility>
|
||||
|
||||
Patcher::Patcher(QString baseDirectory, BootData* boot_data) : boot_data(boot_data), baseDirectory(baseDirectory) {
|
||||
Patcher::Patcher(QString baseDirectory, BootData* boot_data) : boot_data(boot_data), baseDirectory(std::move(baseDirectory)) {
|
||||
dialog = new QProgressDialog();
|
||||
dialog->setLabelText("Checking the FINAL FANTASY XIV Updater/Launcher version.");
|
||||
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
Patcher::Patcher(QString baseDirectory, GameData* game_data) : game_data(game_data), baseDirectory(baseDirectory) {
|
||||
Patcher::Patcher(QString baseDirectory, GameData* game_data) : game_data(game_data), baseDirectory(std::move(baseDirectory)) {
|
||||
dialog = new QProgressDialog();
|
||||
dialog->setLabelText("Checking the FINAL FANTASY XIV Game version.");
|
||||
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
void Patcher::processPatchList(QNetworkAccessManager& mgr, QString patchList) {
|
||||
void Patcher::processPatchList(QNetworkAccessManager& mgr, const QString& patchList) {
|
||||
if (patchList.isEmpty()) {
|
||||
dialog->hide();
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include "steamapi.h"
|
||||
#include "launchercore.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#ifdef ENABLE_STEAM
|
||||
#include <steam/steam_api.h>
|
||||
#endif
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*/
|
||||
class DesktopInterface {
|
||||
public:
|
||||
DesktopInterface(LauncherCore& core);
|
||||
explicit DesktopInterface(LauncherCore& core);
|
||||
|
||||
private:
|
||||
LauncherWindow* window = nullptr;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
class LauncherWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LauncherWindow(LauncherCore& core, QWidget* parent = nullptr);
|
||||
explicit LauncherWindow(LauncherCore& new_headline, QWidget* parent = nullptr);
|
||||
|
||||
ProfileSettings& currentProfile();
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QSpinBox>
|
||||
#include <QToolTip>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <QDebug>
|
||||
#include <QDesktopServices>
|
||||
#include <utility>
|
||||
|
||||
BannerWidget::BannerWidget() : QLabel() {
|
||||
setCursor(Qt::CursorShape::PointingHandCursor);
|
||||
|
@ -13,5 +14,5 @@ void BannerWidget::mousePressEvent(QMouseEvent* event) {
|
|||
}
|
||||
|
||||
void BannerWidget::setUrl(QUrl newUrl) {
|
||||
this->url = newUrl;
|
||||
this->url = std::move(newUrl);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <QToolTip>
|
||||
|
||||
#include "launchercore.h"
|
||||
#include "launcherwindow.h"
|
||||
|
||||
GamescopeSettingsWindow::GamescopeSettingsWindow(ProfileSettings& settings, LauncherCore& core, QWidget* parent)
|
||||
: QDialog(parent) {
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <QScrollBar>
|
||||
#include <QTimer>
|
||||
#include <QTreeWidgetItem>
|
||||
#include <utility>
|
||||
|
||||
#include "aboutwindow.h"
|
||||
#include "assetupdater.h"
|
||||
|
@ -325,8 +326,8 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo
|
|||
QCoreApplication::quit();
|
||||
});
|
||||
|
||||
getHeadline(core, [&](Headline headline) {
|
||||
this->headline = headline;
|
||||
getHeadline(core, [&](Headline new_headline) {
|
||||
this->headline = std::move(new_headline);
|
||||
reloadNews();
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QDir>
|
||||
|
||||
#include "../launcher/tablet/include/tabletinterface.h"
|
||||
#include "cmdinterface.h"
|
||||
|
@ -87,5 +86,5 @@ int main(int argc, char* argv[]) {
|
|||
#endif
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
return QApplication::exec();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
class TabletInterface {
|
||||
public:
|
||||
TabletInterface(LauncherCore& core);
|
||||
explicit TabletInterface(LauncherCore& core);
|
||||
|
||||
private:
|
||||
QQmlApplicationEngine* applicationEngine = nullptr;
|
||||
|
|
Loading…
Add table
Reference in a new issue