Snippets: Fix the keyboard shortcuts for new snippets not working
ClosedPublic

Authored by thomassc on Jul 7 2019, 2:12 PM.

Details

Summary

After creating a new snippet with an assigned keyboard shortcut, this shortcut did not work directly. This was because the snippet QActions are added to a widget by a rowsInserted() signal, but the new snippet's QAction did not exist yet at this time. This change ensures that the new snippet's QAction is created in time.

Test Plan

I tested it manually.

Diff Detail

Repository
R40 Kate
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
thomassc created this revision.Jul 7 2019, 2:12 PM
Restricted Application added a project: Kate. · View Herald TranscriptJul 7 2019, 2:12 PM
Restricted Application added a subscriber: kwrite-devel. · View Herald Transcript
thomassc requested review of this revision.Jul 7 2019, 2:12 PM
cullmann accepted this revision.Jul 7 2019, 2:22 PM
cullmann added a subscriber: cullmann.

Makes sense, too. Not sure why the actions are not created on demand during the rowInserted handling, but perhaps that is intentional.

This revision is now accepted and ready to land.Jul 7 2019, 2:22 PM
This revision was automatically updated to reflect the committed changes.

Thanks for reviewing. No idea whether there is a good reason for the action not being created during the rowInserted handling; if not, that seems like the cleaner solution indeed.