src/demo.cpp

changeset 21
99225eac33ba
parent 20
a5457405cc9b
child 22
2fe0b7e0da7b
equal deleted inserted replaced
20:a5457405cc9b 21:99225eac33ba
35 // ----------------------------------------------------------------------------- 35 // -----------------------------------------------------------------------------
36 str uncolorize (const str& in) { 36 str uncolorize (const str& in) {
37 str out; 37 str out;
38 int skip = 0; 38 int skip = 0;
39 39
40 for (const qchar& c : in) { 40 for (const QChar& c : in) {
41 if (skip-- > 0) 41 if (skip-- > 0)
42 continue; 42 continue;
43 43
44 if (c == QChar ('\034')) { 44 if (c == QChar ('\034')) {
45 skip = 1; 45 skip = 1;
65 } 65 }
66 66
67 // ============================================================================= 67 // =============================================================================
68 // ----------------------------------------------------------------------------- 68 // -----------------------------------------------------------------------------
69 static bool isKnownVersion (str ver) { 69 static bool isKnownVersion (str ver) {
70 for (const var& it : getVersions()) 70 for (const QVariant& it : getVersions())
71 if (it.toString() == ver || it.toString() + 'M' == ver) 71 if (it.toString() == ver || it.toString() + 'M' == ver)
72 return true; 72 return true;
73 73
74 return false; 74 return false;
75 } 75 }
83 // Cannot just return an empty string here since that'd trigger 83 // Cannot just return an empty string here since that'd trigger
84 // another error prompt - skip ahead and exit. 84 // another error prompt - skip ahead and exit.
85 exit (9); 85 exit (9);
86 } 86 }
87 87
88 for (const var& it : cfg::wadpaths) { 88 for (const QVariant& it : cfg::wadpaths) {
89 str fullpath = fmt ("%1/%2", it.toString(), name); 89 str fullpath = fmt ("%1/%2", it.toString(), name);
90 QFile f (fullpath); 90 QFile f (fullpath);
91 91
92 if (f.exists()) 92 if (f.exists())
93 return fullpath; 93 return fullpath;

mercurial