Sort returned formats in Definition::formats() by id

Authored by dhaumann on Aug 10 2018, 1:39 PM.

Description

Sort returned formats in Definition::formats() by id

Summary:
Sorting the formats() by id results in the same order as the
itemDatas are defined in the xml file. This is required for
several reasons:

  • KTextEditor currently uses the first format if no format was explicitly specified (which typically is "Normal Text")
  • Fonts & Colors will list the itemDatas in correct order
  • Printing the syntax guide is sorted correctly as well

Test Plan: make && make test

Reviewers: vkrause, cullmann

Reviewed By: cullmann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: Kate, Frameworks

Differential Revision: https://phabricator.kde.org/D14730