;;;;;;;;;;;;;;;; exists for bug report
lccommand: gist /name="some_file.txt" /desc="test of command line gist" sel
somePos: 5 after searching for /na
somePos: -1 after searching for /NA
somePos: 27 after searching for /des
somePos: -1 after searching for /DES
;;;;;;;;;;;;;;;; end bug report
If Qt::CaseInsensitive was actually working all four calls should succeed. Due to case sensitive file names, etc. one cannot just force the input to upper or lower case without changing the behavior. Prior to my January merge, Qt::CaseInsensitive used to work. Will have to go back and retest a whole bunch of code now.
;;;;;;;;;;;;;;;; exists for bug report
lccommand: gist /name="some_file.txt" /desc="test of command line gist" sel
somePos: 5 after searching for /na
somePos: 5 after searching for /na via regex
somePos: -1 after searching for /NA
somePos: 5 after searching for /NA via regex
somePos: 27 after searching for /des
somePos: 27 after searching for /des via regex
somePos: -1 after searching for /DES
somePos: 27 after searching for /DES via regex
;;;;;;;;;;;;;;;; end bug report
We took another look at this and I noticed you are missing the second parameter. The API shows three parameters with the second and third having default values. If you want to pass Qt::CaseInsensitive for the third parameter you must pass 0 (default value) for the second parameter.
When all three parameters are provided everything passes our new unit tests.
Should be an enum class so this cannot compile. Yes, I looked again, you are correct. The documentation is mushed together so it is difficult to see for people wearing glasses, but if the project really is pushing C++17 then all of the enums should have long ago been replaced by enum classes. The fact is this compiled and ran incorrectly because everything masks back to an int.
Putting my new "workspace progressive" lenses back in their case and digging out my older "standard" computer glasses.
CopperSpice currently requires C++17 and we are moving to C++20 this year. We are continually migrating the code base to a more modern version of the language. However, our team is careful when making changes which will affect our user base. I can assure you we have changed some enums to enum classes and some enums now specify an underlying integer type.
What you may not have realized if we change enums like this one to an enum class it would break a lot of user code, including yours. Every place in your code would need to be modified as shown.
// new syntax
text.indexOf( "findThis" , 0, Qt::CaseSensitivity::CaseInsensitive )
The API from our predecessor did not change so we have maintained source compatibility. A much better solution for code like this is simply to add an overload which takes the first and third parameters.