Simplify ZandronumVersion structure

Sun, 28 Nov 2021 23:53:23 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 28 Nov 2021 23:53:23 +0200
changeset 66
c68545f1aecb
parent 65
e679dd5cd159
child 67
c34057d3c94e

Simplify ZandronumVersion structure

commonlib/types.h file | annotate | diff | comparison | revisions
config/configwindow.cpp file | annotate | diff | comparison | revisions
launcher/prompts.cpp file | annotate | diff | comparison | revisions
--- a/commonlib/types.h	Sun Nov 28 23:47:55 2021 +0200
+++ b/commonlib/types.h	Sun Nov 28 23:53:23 2021 +0200
@@ -24,17 +24,9 @@
 
 struct ZandronumVersion
 {
-	ZandronumVersion (QString name, bool isRelease, QString binaryPath) :
-		name (name),
-		binaryPath (binaryPath),
-		isRelease (isRelease) {}
-
-	ZandronumVersion() :
-		isRelease (false) {}
-
 	QString name;
 	QString binaryPath;
-	bool isRelease;
+	bool isRelease = false;
 };
 
 inline QDataStream& operator<< (QDataStream& out, const ZandronumVersion& version)
--- a/config/configwindow.cpp	Sun Nov 28 23:47:55 2021 +0200
+++ b/config/configwindow.cpp	Sun Nov 28 23:53:23 2021 +0200
@@ -202,7 +202,7 @@
 
 ZandronumVersion VersionGuiEntry::toNonGuiVersion() const
 {
-	return ZandronumVersion (m_name, m_isRelease, m_pathItem->text());
+	return {m_name, m_pathItem->text(), m_isRelease};
 }
 
 //
--- a/launcher/prompts.cpp	Sun Nov 28 23:47:55 2021 +0200
+++ b/launcher/prompts.cpp	Sun Nov 28 23:53:23 2021 +0200
@@ -69,7 +69,7 @@
 
 void UnknownVersionPrompt::addBinary()
 {
-	ZandronumVersion version (m_binaryString, m_isRelease, ui->m_binaryPath->text());
+	const ZandronumVersion version {m_binaryString, ui->m_binaryPath->text(), m_isRelease};
 	QList<QVariant> versions = Config::get ("versions").toList();
 	QVariant var;
 	var.setValue (version);

mercurial