Posts 

Kate Meeting: Day 0

Friday, 11 April 2008 | Dominik Haumann
Finally it all begins: Anders and Joseph arrived at basysKom and we’ve started to discuss some things we want to do for KDE 4.1. Later, we are going to meet with the rest of the attendees in a restaurant to get to know each other. The official start of the meeting is tomorrow morning. If you are interested in contributing to Kate, just join #kate on irc.libera.chat. I’m looking forward to the next two days :)

Kate Developer Sprint 2008

Tuesday, 25 March 2008 | Christoph Cullmann
In April there will be a Kate Developer Sprint, similar to previous sprints for Decibel, Akonadi, KDevelop and others. This is a great opportunity as developers interested in development of KDE’s text editor will discuss what to do to make Kate the best text editor on earth. This also means lots of polishing so that Kate in KDE 4.1 will shine even more! The meeting will take place from 2008-04-11 till 2008-04-13. Read More

Encapsulation is not Information Hiding

Friday, 21 December 2007 | Dominik Haumann
As food for thought and in reply to Why Encapsulation is a Good Thing it’s interesting to take a closer look. What does encapsulation mean exactly, and what can you do with it? Maybe what you really want is Information Hiding? …and encapsulation is just a way of possibly achieving it? If you are interested in the details/differences, read the article Encapsulation is not Information Hiding.

Memory Leak Continued

Thursday, 22 November 2007 | Dominik Haumann
There was some confusion with regard to my last blog about leaking memory. Suppose the ui_mywidget.h files looks like this: class Ui_Widget { public: QGridLayout *gridLayout; QGroupBox *groupBox; QGridLayout *gridLayout1; QListWidget *listWidget; QSpacerItem *spacerItem; QPushButton *pushButton; void setupUi(QWidget *Widget); void retranslateUi(QWidget Widget); }; Of course, those 6 QObject derived classes are deleted. But the sizeof(Ui_Widget) = 6 * sizeof(void) = 24 bytes are not deleted. As Ui_Widget is not QObject derived those 24 bytes leak. Read More

Memory leak: Ui files and direct approach

Wednesday, 21 November 2007 | Dominik Haumann
The KDE codebase often uses a forward declaration in the .h-file to speedup compilation. The code often looks like this: // header file namespace Ui { class MyWidget; } class MyDialog : public KDialog { // ... private: Ui::MyWidget *ui; }; The impl looks like this: // source file #include "mydialog.h" #include "ui_mywidget.h" MyDialog::MyDialog() : KDialog() { QWidget *w = new QWidget(this); setMainWidget(w); ui = new Ui::MyWidget(); // allocation ui->setupUi(w); // ui->. Read More

Kate Highlighting Power

Wednesday, 12 September 2007 | Dominik Haumann
Kate’s highlighting capabilities are amazing. If you want you can highlight really complex syntax, without having to hardcode rules in C++. As an example, we’ll take a look at how Lua comments can be realized: –[=[ starts a multiline comment (the ‘=’ chars are optional) ]=] ends the multiline comment the number of ‘=’ chars in ]=] must match the number of –[=[ That means: When the highlighting processor matches the end of a multiline comment, it has to know how many ‘=’ chars started the comment. Read More

Extending Kate by Scripts

Saturday, 21 July 2007 | Dominik Haumann
We have seen how scripting basically works for indentation. It’s also possible to register commandline functions (The command line is bound to F7 by default, or invoke View > Switch to Command Line). We will consider a small example again: sort the selected text. / kate-script name: unused author: foo bar license: LGPL version: 1 kate-version: 3.0 functions: sorter / function sorter () {     if (view.hasSelection()) {         var start = view.startOfSelection().line;         var end = view.endOfSelection().line;         var text = document.textRange(start, 0, end, document.lineLength(end));         var lines = text.split(“\n”);         lines.sort();         text = lines.join(“\n”);         view.clearSelection();         document. Read More

Kate: More on Indentation Scripting

Friday, 20 July 2007 | Dominik Haumann
My last blog was about the theory of how indentation works by using javascripts. Now we will look at a concrete example: a LISP-style indenter. (LISP indentation is easy, that’s why it’s a good example). The rules: comments starting with ;;; always have indentation 0 comments starting with ;; should be aligned with the next line comments starting with ; should only appear behind code, so they are simply ignored every ‘(‘ indents and every ‘)’ unindents lisp. Read More

Kate Scripting: Indentation

Wednesday, 18 July 2007 | Dominik Haumann
Kate Part in KDE4 supports the ECMAScript (JavaScript) language by using kjs. In KDE3 we had several hard-coded indenters in C++, the idea is to let scripts do all the indentation in KDE4. How does it work? It is similar to vim: You simply create a script in the directory $KDEDIR/share/apps/katepart/jscript. An indentation script has to follow several rules: it must have a valid script header (the first line must include the string kate-script and indentation scripts must have the type: indentation) it must define some variables and functions Whenever the user types a character, the flow in Kate Part works like this Read More

API documentation & refactored kdelibs/kdeui

Wednesday, 27 December 2006 | Dominik Haumann
During the last weeks/days the directory structure of especially kdelibs/kdeui got a major overhaul: in KDE 3 all files of a module were in the same directory which was more or less a mess as you did not know immediately which files belonged to the same category. kdelibs/kdeui in KDE4 has a rather clean structure now (similar to the one in Qt) by using subfolders like actions dialogs widgets xmlgui several others… Compare this to KDE3’s kdelibs/kdeui structure. Read More