[nostalgia] Address CLion warnings

This commit is contained in:
2021-02-27 02:40:59 -06:00
parent 70168286ab
commit 936c922c1e
24 changed files with 63 additions and 124 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ void Editor::setUnsavedChanges(bool uc) {
emit unsavedChangesChanged(uc);
}
bool Editor::unsavedChanges() noexcept {
bool Editor::unsavedChanges() const noexcept {
return m_unsavedChanges;
}
+1 -1
View File
@@ -55,7 +55,7 @@ class NOSTALGIASTUDIO_EXPORT Editor: public QWidget {
*/
void setUnsavedChanges(bool);
[[nodiscard]] bool unsavedChanges() noexcept;
[[nodiscard]] bool unsavedChanges() const noexcept;
/**
* Returns the undo stack holding changes to the item being edited.
-4
View File
@@ -19,10 +19,6 @@ QVector<WizardMaker> Module::importWizards(const Context*) {
return {};
}
QWidget *Module::makeEditor(QString, const Context*) {
return nullptr;
}
QVector<EditorMaker> Module::editors(const Context*) {
return {};
}
+1 -3
View File
@@ -31,9 +31,7 @@ class Module {
virtual QVector<WizardMaker> importWizards(const Context *ctx);
virtual QWidget *makeEditor(QString path, const class Context *ctx);
virtual QVector<EditorMaker> editors(const class Context *ctx);
virtual QVector<EditorMaker> editors(const class Context *ctx);
};
+1 -2
View File
@@ -25,8 +25,7 @@ Project::Project(QString path): m_fs(path.toUtf8()) {
m_path = path;
}
Project::~Project() {
}
Project::~Project() = default;
void Project::create() {
QDir().mkpath(m_path);
+2 -2
View File
@@ -43,9 +43,9 @@ class NOSTALGIASTUDIO_EXPORT Project: public QObject {
mutable ox::PassThroughFS m_fs;
public:
Project(QString path);
explicit Project(QString path);
~Project();
~Project() override;
void create();
+2 -6
View File
@@ -58,7 +58,7 @@ void WizardSelect::initializePage() {
emit completeChanged();
}
void WizardSelect::addOption(WizardMaker wm) {
void WizardSelect::addOption(const WizardMaker &wm) {
m_options[wm.name] = {wm.make, wm.onAccept};
m_listWidget->addItem(wm.name);
}
@@ -82,7 +82,6 @@ void WizardSelect::itemSelected(int row) {
w->addPage(p);
}
w->setAccept(o.onAccept);
// for some reason the continue button only appears correctly after remove runs
w->removePage(w->addPage(new QWizardPage()));
}
@@ -96,9 +95,6 @@ WizardConclusionPage::WizardConclusionPage(QString msg, QVector<QString> fields)
setLayout(new QVBoxLayout(this));
}
WizardConclusionPage::~WizardConclusionPage() {
}
void WizardConclusionPage::initializePage() {
QString msg = m_baseMsg;
for (auto field : m_fields) {
@@ -126,7 +122,7 @@ void WizardFormPage::Field::setDisplayText(QString text) {
}
}
QString WizardFormPage::Field::getDisplayText() {
QString WizardFormPage::Field::getDisplayText() const {
auto le = dynamic_cast<QLineEdit*>(this->valueControl);
auto cb = dynamic_cast<QComboBox*>(this->valueControl);
if (le) {
+3 -3
View File
@@ -61,7 +61,7 @@ class NOSTALGIASTUDIO_EXPORT WizardSelect: public QWizardPage {
public:
WizardSelect();
void addOption(WizardMaker wm);
void addOption(const WizardMaker &wm);
void initializePage() override;
@@ -84,7 +84,7 @@ class NOSTALGIASTUDIO_EXPORT WizardFormPage: public QWizardPage {
void setDisplayText(QString text);
QString getDisplayText();
QString getDisplayText() const;
};
QLabel *m_errorMsg = nullptr;
QGridLayout *m_layout = nullptr;
@@ -129,7 +129,7 @@ class NOSTALGIASTUDIO_EXPORT WizardConclusionPage: public QWizardPage {
public:
WizardConclusionPage(QString msg, QVector<QString> field);
virtual ~WizardConclusionPage();
~WizardConclusionPage() override = default;
void initializePage() override;
};