I'd used a std::set with a compare function, so that the profiles are always
sorted by name ...etc, but that is wrong, as the Key type in the set is a
QExplicitlySharedDataPointer, if the QESDP is copied, its own address is
going to change, but the address of of the object it's managing (Profile)
is the same, that's why QESDP internally overloads operator== to compare
the address of its d pointer (the one returned by data()).
That meant that multiple QESDP could exist in the set, not good... (a QSet
worked because it uses a hash which is based on the address of the object
returned by data()).
So, use a vector, that is sorted by profile name (we only need to sort it
when allProfiles() is called, and when a profile name is changed).
This fixes an assert in ProfileManager::setDefaultProfile(); to test open
the profile manager and select the built-in profile and click "set default".
Add a unit test.
This test currently is bogus, as soon as I reflow the Screen
object, the data is not correct. If anyone can check what I'm
doing wrong here it's appreciated.
The idea is that I pass a large string "aaa bbb ccc ddd" then
force a reflow for:
"aaa bbb
ccc ddd"
then I could copy only the column
bbb
ddd
Because the setSize did not work for that, the test is bogus.
but it's a start.
Those Classes are not QObject, so most of it's pointers could be changed
to smart pointers with no problems.
Problem found when using QList<std::unique_ptr>: it wasn't possible to
use it. I'm using std containers instead.
Unlimited to Fixed Size must have the fixed size information preserved.
Fixed Size to Unlimited must have all the information preserved.
All types to None all information must be erased.
While testing I found a bug in CompactHistoryScroll add function, it
should append before check the vector size and not after, it was
returning a Size > Max Size, not equal.
Another Bug found in fixed size history scroll, it was not properly
reflowing the last line, a position problem when adding and removing
lines to keep a fixed size.
Some improvements in calculations and safeguards when changing
cursor position, using defined value in Vt102Emulation.cpp to
protect the integers.
Added cursor position tests to ScreenTest.
Vt102Emulation MAX_ARGUMENT calculation wasn't correct, it was
sending an argument bigger than max argument.
This pulls in ECM 5.38 which requires a change of add_test()s
This update is needed to port from KToolInvocation::kdeinitExec to
KIO::CommandLauncherJob
This also allowed me to remove a few includes of Profile.h
around the codebase, that used Profile::Ptr. now the compilation
is a bit faster and also does not recompile things as often.
Move a KeyboardTranslatorReader class to a new files, KeyboardTranslatorReader.h and KeyboardTranslatorReader.cpp
Move a KeyboardTranslatorWriter class to a new files, KeyboardTranslatorWriter.h and KeyboardTranslatorWriter.cpp
New unit test, triggers faulty code in `Screen::copyLineToStream`
which goes outside `Character` array boundaries, overwriting
memory of other objects.
Compiling the code with address-sanitizer makes the fault
visible when running those new UTs.
This will allow % in URLs; also sync test code with actual code.
Previously the tests were using toUtf8(); however fromPercentEncoding
seems better.
BUG: 420791
Differential Revision: https://phabricator.kde.org/D29322