Fix KActionSelectorPrivate::insertionIndex()
ClosedPublic

Authored by antonanikin on Apr 7 2017, 9:42 AM.

Details

Summary

Old version ignores InsertionPolicy::AtBottom enum value and produce behavior same as for InsertionPolicy::AtTop.

Diff Detail

Repository
R236 KWidgetsAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
antonanikin created this revision.Apr 7 2017, 9:42 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 7 2017, 9:42 AM
antonanikin edited the summary of this revision. (Show Details)Apr 7 2017, 9:46 AM
aacid added a subscriber: aacid.Apr 8 2017, 4:17 PM

Is this really needed?

Without your code it defaults to
index = -1;
what is the same as appending that is the same as atBottom, no?

Is this really needed?
Without your code it defaults to
index = -1;
what is the same as appending that is the same as atBottom, no?

Yes, it needed - see here about negative index http://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/itemviews/qlistwidget.cpp#n108

aacid accepted this revision.Apr 10 2017, 8:15 AM

Right.

Would be nice to have an autotest for this but since there's no autotest for KActionSelector at all that i can see i'm not going to block you on that :)

This revision is now accepted and ready to land.Apr 10 2017, 8:15 AM
This revision was automatically updated to reflect the committed changes.