Category Archives: Events

KTextEditor on Frameworks 5: Timing is everything

This is a follow-up to Aaron’s blog Frameworks 5: Timing is everything, put into the perspective of Kate and the KTextEditor interfaces. In short, Aaron suggests application developers the following:

When Frameworks 5 has a firm release schedule, then it makes sense to start coordinating application releases targets with that and syncing up development cycles.

I agree with this entirely, provided it’s really about applications. In the context of Kate, this is not the case, since the term ‘Kate’ usually also refers to the ‘KTextEditor’ interfaces along with its implementation ‘Kate Part’.

In essence, the KTextEditor interfaces together with Kate Part provide a text editor in a library that can be used by applications, or more to the point, KTextEditor+Kate Part build a framework.

In fact, about a week ago, the KTextEditor interfaces and Kate Part were split out of the kate.git repository. So from now on, kate.git contains the Kate and KWrite applications. The ktexteditor.git module contains the KTextEditor interfaces and Kate Part.

ktexteditor.git is is a tier3 framework and meanwhile officially part of the frameworks initiative: if you want so, KDE now provides 58 frameworks instead of the previously announced 57!

Why timing is everything

Now what about timing? Started on November 28th 2013, Christoph pushed the first compiling version of Kate into the frameworks branch. This was very good timing, since the split of kdelibs into all the frameworks was more or less just finished at that time. Or to put it the other way round: Christoph started porting Kate pretty much as early as the KF5 initialive allowed us – cool!

Around that time by coincidence, Michal started to work on Kate in the master branch and committed lots of cool features. However, since Kate was already rudimentary ported to Qt5 and KF5, the code base diverged more and more, so merging got more complicated. Therefore, Michal started to work in Kate’s frameworks branch. And within only a week (!), Kate, KWrite, the KTextEditor interfaces and Kate Part build without a single warning, meaning that the code was completely free of Qt4 and kde4support – wow! :-)

Again, a month before would have been too early – so this was perfect timing. The result was a pretty stable and mostly bug-free Kate in mid of December.

Well, not completely free of porting bugs. For instance, file saving did not work correctly, ending up in data corruption. It turned out that this was an issue in the framework karchive, which David Faure was able to reproduce and fix. This is good timing in the sense that without Kate’s usage of karchive, the bug would have probably ended up in the technical preview TP1. But it didn’t – yay! :-)

Last but not least, the Kate and KDevelop developers planned already months ago to have a joint Kate/KDevelop sprint from 18th to 26th of January, 2014. Given the current state of Kate and KTextEditor, this again is perfect timing, since most of the KTextEditor cleanup are already done. So the Kate developers can focus on the needs of e.g. KDevelop, on fine-tuning and implementing interfaces, etc. So in about two weeks, when our developer sprint will have ended, Kate will most probably shine as it never did before. And this is the case already now, even before a firm release date of Plasma 2 exists.

This is great news for Kate and all applications that use the KTextEditor interfaces, as Kate/KTextEditor already now reached a maturity that they never had before.

And this is so awesome! I cannot think of better timing :-) Thanks to all who made this happen!

Akademy 2013

So Akademy 2013 is nearing and this time it takes place at Bilbao, Spain. As it happens, Bilbao is located quite near to the beach as well as very close to the mountains. So I stumbled over a page with several hiking trails starting in Bilbao ranging from easy to hard. For instance, this route starts in a nearby village and then goes from about 65 meters in height up to 1000 (this is the point where you stop to hack on KDE, of course), and then down to 30 in Bilbao again. Anyone? :-)

PS: Maybe there are any locals who know the place around and can recommend a hiking track?

 

Kate in KDE 4.10

According to our release schedule, KDE SC 4.10.0 will be available to the public in early February 2013. Following Kate in KDE 4.7, Kate in KDE 4.8 and Kate in KDE 4.9, this blog post highlights what’s new in Kate in KDE 4.10.

New Features

News in the Plugins World

  • Kate’s Pate plugin now provides several new plugins by default, with Python 3 support.
  • Kate gained a new and very powerful Project plugin with ctags code completion. It is tightly integrated with the Search & Replace plugin as well as the GDB Plugin and the Quick Open feature.
  • Kate Search & Replace plugin gained find-as-you-type support.

Improvements

Bug Fixes

Most of the following work was done during the yearly KDE conference and especially the joint Kate/KDevelop meeting this October in Vienna. A massive bug database cleanup was performed mainly by Christoph, so we closed several hundreds of bug reports, where ~280 are really fixed. So we are down to a total of 400 reports (only 70 of these 400 reports are bugs), where we initially had > 800 open issues. This also is reflected in the Kate bug charts:

Thanks to all contributors to make yet another release rock! :-) And as always: We are happy for every contribution, so check out the Kate sources and send us patches! We hope you enjoy using Kate as much as we enjoy its development :-)

Using the Projects Plugin in Kate

Introducing the Projects Plugin for KDE SC 4.10

The basic idea of the Projects plugin is to have a structured list of files belonging to the  project with the following properties:

  1. provide a structured view of the files
  2. make it easy and very fast to open and switch projects
  3. support search & replace for a project
  4. provide simple auto completion
  5. make it simple to quickly open files in the project
  6. support for building the project

We’re going to address all these points now.

1. Provide a Structured View of the Files

Once the “Projects Plugin” is loaded in the Kate config page, a sidebar appears that lists all projects as well as the projects files as follows:

As you can see, the currently active project is “Kate”, and it’s contents is listed in the tree view. Clicking on files in the tree view opens the file in the editor. Further, a context menu is provided with which you can open files with other applications, such as a .ui file with Qt Designer.

2. Switching Projects

The idea is that you never have to open a project manually, this is even not supported at all. Hence, what happens if you open a file, the Project Plugin quickly scans the folder and its parent folders for a .kateproject file. If found, the project is automatically loaded. Very simple and efficient.

Further, if you open another document in Kate, that belongs to another project, the Project plugin automatically switches the current project. So intuitively, always the correct project is active. Of course, you can also switch the currently active project through the combo box.

3. Search & Replace in Projects

Kate has a “Search & Replace” plugin that shows up in the bottom sidebar. If a project is loaded and you open the “Search & Replace” sidebar, it automatically switches to the mode to search & replace in the current project, which usually is exactly what you want:

4. Simple Auto Completion

With the knowledge of all files belonging to a project, the Project plugin provides simple auto completion facilities based on ctags. If a project is initially opened, ctags parses all project files in a background thread and saves the ctags information to /tmp. This file then is used to populate the auto completion popup in Kate. In contrast, without this auto completion, Kate was only capable of showing auto completion items based on the words in the current file. So the auto completion provided by the Project plugin is much more powerful.

If ctags is missing, a passive popup warns you about this. It is also noteworthy, that the ctags file in /tmp is cleaned up when Kate exists, so you the plugin does not pollute any folder with unwanted files.

5. Quick Opening Files

As clicking on files in the tree view is not the fastest way to open a file, Kate provides a built-in quick open mechanism you can activate with CTRL+ALT+o. What you the get is a list like this:

You can filter by typing parts of the file name you are looking for, and you can also navigate with the arrow keys and page up/down through the list. Hitting enter activates the selected file, while escape hides the quick open view again.

Further, the quick open remembers the previous file. So when you change to the quick open view the previously activated  file is automatically selected and you just need to hit enter, which comes very handy at times.

6. Support for Building the Project

Another feature is to have support in the Build plugin, so that it automatically is configured correctly.

Creating Projects

Currently, creating a project requires some manual work, although it is really not much. You just have to create a .kateproject file in the root folder of the project. For instance, the Kate .kateproject file looks like this:

{
  "name": "Kate"
, "files": [ { "git": 1 } ]
}

As you may have noted, this is JSON syntax (because there is a nice jason library for Qt to parse this). The project name is “Kate”, and the files contained in should be read from git.

What’s also supported instead of “git” is subversion through “svn” and mercurial through “hg” (btw, it would be nice to have support for other version control systems as well *hint*). If you do not want to read from a version control system, you can tell it to recursively load files from directories as follows:

{
  "name": "Kate"
, "files": [ { "directory": "kate", "filters": ["*.cpp", "*.h", "*.ui", "CMakeLists.txt", "Find*.cmake"], "recursive": 1 } ]
}

Here, subfolders and filters define what’s part of the project. You can also mix version control and files based on filters.

If you want to add support for the Build plugin, you could write a .kateconfig like this:

{
  "name": "Kate"
, "files": [ { "git": 1 } ]
, "build": {
    "directory": "build"
  , "build": "make all"
  , "clean": "make clean"
  , "install": "make install"
  }
}

Hopefully, these examples help you to setup your own project.

Kudos

Kudos go to Christoph, he implemented all the features in here. The Project plugin will be shipped with  KDE SC 4.10, and you should really try it out :-)