Simplify KateDocManager::openUrl

Review Request #112187 - Created Aug. 21, 2013 and submitted

Information
Dominik Haumann
kate
master
319354
Reviewers
kate
cullmann
Currently, KateDocManager::openUrl() reuses the untitled unmodified document to load a new file. This, however, leads to i) code duplication and ii) two different code paths for opening documents. In case the existing untitled document is replaced, a new view is not created, and therefore View::readSessionConfig() is not called.

This patch simplifies opening a new url by simply always creating a new Document. If applicable, the untitled unmodified document is then deleted afterwards.

This has the slight disadvantage of flickering, but flickering also exists for each additional file you open anyway, so this problem is not really new.

The isTempFile option is now moved behind loading the file, it was at a different location before. Hope this is still correct.
Opening a file now always restores the cursor position.
Michal Humpula
Michal Humpula
Commit Hook
Dominik Haumann
Review request changed

Status: Closed (submitted)

Loading...