KateModeManager::updateFileType(): validate modes and reload menu of the status…

Authored by nibags on Nov 27 2019, 8:58 AM.

Description

KateModeManager::updateFileType(): validate modes and reload menu of the status bar

Summary:
KateModeManager::updateFileType():

  • Validate modes of katemoderc: In the same way as in D25389, the file katemoderc may contain invalid modes due to custom XML files that are deleted or renamed. Therefore, the existing modes are now verified and then the configuration of the katemoderc file is overwritten.
  • Prevent the Normal mode from being duplicated if the file katemoderc exists.
  • Modes with empty names are skipped. It's understood that the name of a mode shouldn't be empty, since it acts as a unique identifier.
  • Update the list of modes in the status bar menu (class KateModeMenuList) by calling updateFileType(). The menu uses the KateFileType objects to do a file extension search, so it's necessary. To do this, the KateModeMenuList::reloadAll() function is added, which updates the data model of the menu.

Reviewers: KTextEditor, cullmann, dhaumann

Reviewed By: KTextEditor, cullmann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: Kate, Frameworks

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

Details

Committed
cullmannNov 27 2019, 8:58 AM
Reviewer
KTextEditor
Differential Revision
D25390: KateModeManager::updateFileType(): validate modes and reload menu of the status bar
Parents
R39:6055d726226c: Remove unused include
Branches
Unknown
Tags
Unknown