use proper names QVariant and QChar instead of ambigous/dumb "var" and "qchar"

Sun, 08 Sep 2013 16:53:31 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 08 Sep 2013 16:53:31 +0300
changeset 21
99225eac33ba
parent 20
a5457405cc9b
child 22
2fe0b7e0da7b

use proper names QVariant and QChar instead of ambigous/dumb "var" and "qchar"

src/config.cpp file | annotate | diff | comparison | revisions
src/demo.cpp file | annotate | diff | comparison | revisions
src/misc.cpp file | annotate | diff | comparison | revisions
src/types.cpp file | annotate | diff | comparison | revisions
src/types.h file | annotate | diff | comparison | revisions
--- a/src/config.cpp	Sun Sep 08 16:14:58 2013 +0300
+++ b/src/config.cpp	Sun Sep 08 16:53:31 2013 +0300
@@ -84,10 +84,10 @@
 	m_releaseLayout = new QFormLayout (ui->zandronumVersions);
 	m_testLayout = new QFormLayout (ui->betaVersions);
 	
-	for (const var& ver : cfg::devBuildNames)
+	for (const QVariant& ver : cfg::devBuildNames)
 		addVersion (ver.toString(), false);
 	
-	for (const var& rel : cfg::releaseNames)
+	for (const QVariant& rel : cfg::releaseNames)
 		addVersion (rel.toString(), true);
 }
 
@@ -118,12 +118,12 @@
 void ConfigBox::initFromSettings() {
 	ui->wad_pathsList->clear();
 	
-	for (const var& it : cfg::wadpaths)
+	for (const QVariant& it : cfg::wadpaths)
 		addPath (it.toString());
 	
 	int i = 0;
 	
-	for (const var& ver : getVersions())
+	for (const QVariant& ver : getVersions())
 		m_zanBinaries[i++]->setText (cfg::binaryPaths[ver.toString()].toString());
 	
 	ui->noDemoPrompt->setChecked (cfg::noprompt);
@@ -141,7 +141,7 @@
 	cfg::noprompt = ui->noDemoPrompt->isChecked();
 	
 	int i = 0;
-	for (const var& ver : getVersions())
+	for (const QVariant& ver : getVersions())
 		cfg::binaryPaths[ver.toString()] = m_zanBinaries[i++]->text();
 	
 	cfg::save();
--- a/src/demo.cpp	Sun Sep 08 16:14:58 2013 +0300
+++ b/src/demo.cpp	Sun Sep 08 16:53:31 2013 +0300
@@ -37,7 +37,7 @@
 	str out;
 	int skip = 0;
 	
-	for (const qchar& c : in) {
+	for (const QChar& c : in) {
 		if (skip-- > 0)
 			continue;
 		
@@ -67,7 +67,7 @@
 // =============================================================================
 // -----------------------------------------------------------------------------
 static bool isKnownVersion (str ver) {
-	for (const var& it : getVersions())
+	for (const QVariant& it : getVersions())
 		if (it.toString() == ver || it.toString() + 'M' == ver)
 			return true;
 	
@@ -85,7 +85,7 @@
 		exit (9);
 	}
 	
-	for (const var& it : cfg::wadpaths) {
+	for (const QVariant& it : cfg::wadpaths) {
 		str fullpath = fmt ("%1/%2", it.toString(), name);
 		QFile f (fullpath);
 		
--- a/src/misc.cpp	Sun Sep 08 16:14:58 2013 +0300
+++ b/src/misc.cpp	Sun Sep 08 16:53:31 2013 +0300
@@ -44,9 +44,9 @@
 	cfg::binaryPaths[name] = binaryPath;
 	
 	if (isRelease)
-		cfg::releaseNames << var (name);
+		cfg::releaseNames << QVariant (name);
 	else
-		cfg::devBuildNames << var (name);
+		cfg::devBuildNames << QVariant (name);
 	
 	cfg::save();
 }
--- a/src/types.cpp	Sun Sep 08 16:14:58 2013 +0300
+++ b/src/types.cpp	Sun Sep 08 16:53:31 2013 +0300
@@ -40,7 +40,7 @@
 StringFormatArg::StringFormatArg (const str& v)    { m_val = v; }
 StringFormatArg::StringFormatArg (const char& v)   { m_val = v; }
 StringFormatArg::StringFormatArg (const uchar& v)  { m_val = v; }
-StringFormatArg::StringFormatArg (const qchar& v)  { m_val = v; }
+StringFormatArg::StringFormatArg (const QChar& v)  { m_val = v; }
 StringFormatArg::StringFormatArg (const float& v)  { m_val = str::number (v); }
 StringFormatArg::StringFormatArg (const double& v) { m_val = str::number (v); }
 StringFormatArg::StringFormatArg (const char* v)   { m_val = v; }
--- a/src/types.h	Sun Sep 08 16:14:58 2013 +0300
+++ b/src/types.h	Sun Sep 08 16:53:31 2013 +0300
@@ -25,8 +25,6 @@
 #include <QVariant>
 
 typedef QString str;
-typedef QChar qchar;
-typedef QVariant var;
 template<class T> using list = QList<T>;
 typedef unsigned int uint;
 typedef unsigned short ushort;
@@ -60,7 +58,7 @@
 	StringFormatArg (const str& v);
 	StringFormatArg (const char& v);
 	StringFormatArg (const uchar& v);
-	StringFormatArg (const qchar& v);
+	StringFormatArg (const QChar& v);
 	
 #define NUMERIC_FORMAT_ARG(T,C) \
 	StringFormatArg (const T& v) { \

mercurial