Closed pieper closed 4 years ago
I've tested this and it works on my local mac build.
Awesome! Thanks a lot for these investigations and fixes.
Would this syntax work, too?
QSet<QString> currentSet(currentStrings.begin(), currentStrings.end());
No, it's a constructor so it needs the parens or you get this:
/opt/s/CTKAppLauncherLib/Base/ctkAppLauncherEnvironment.cpp:108:35: error: expected '(' for function-style cast or type construction
auto currentSet = QSet<QString> currentStrings.begin(), currentStrings.end();
~~~~~~~~~~~~~ ^
Would this syntax work, too?
QSet<QString> currentSet(currentStrings.begin(), currentStrings.end());
No, it's a constructor so it needs the parens or you get this:
/opt/s/CTKAppLauncherLib/Base/ctkAppLauncherEnvironment.cpp:108:35: error: expected '(' for function-style cast or type construction auto currentSet = QSet<QString> currentStrings.begin(), currentStrings.end(); ~~~~~~~~~~~~~ ^
Oh, I see what you mean - yes, that's cleaner. Thanks!
Thanks for the fix :pray:
Fixes #116
Each call to
ctkAppLauncherEnvironment::excludeReservedVariableNames
returns a newQStringList
so making a QSet from thebegin()
of one and theend()
of the other led to the crash in theQHash
.Solution is to make temporary variables for the
QStringList
s so that the set is made from matching iterators variables.Also rearranged the code a bit for readability.