Thursday, June 24, 2010

A Flashback of Kate in Gitorious

Back in February, I blogged about Kate's move to gitorious. The main reason for this move was to make building Kate as easy as possible. If you want to build Kate as part of KDE, (as of now) you have to compile kdesupport, phonon, dbusmenu-qt, kdelibs, kdepimlibs, kdebase for kwrite and kdesdk for the kate application. Getting all this done is a huge effort, especially if you are new to KDE development (I very well remember my own times spending weeks to get everything going. Be aware of new contributors might now close to nothing about KDE and all the dependencies!).
As getting new contributors is essential for keeping a project alive, the barrier to get involved should be as low as possible. And exactly this was achieved by moving all pieces to one place (this was gitorious for us). Building Kate is so simple right now that we can even make bug reporters build Kate out of the box. This helps a lot, and even results in patches from time to time. We also got quite some merge requests.
There were several voices at that time that considered moving "away from KDE" was very bad. However, this is not the case, as Christoph is synchronizing all the changes in KDE's subversion and gitorious almost every day. This is certainly not optimal, but looking back at the last months, we can say it was worth it.
KDE is moving to git.kde.org in the near future. This also raises the discussion about how KDE's source code will be organized. Speaking for Kate, we certainly want to have all of Kate's code in one place, just as it is now with gitorious, no matter what :) I hope we can find a solution the KDE community can live with. To be discussed, maybe in Tampere in two weeks? :)

Saturday, June 19, 2010

Kate: Debugging with Qt-Creator

Let's have a quick look at how to debug Kate and KWrite with Qt-Creator. First, make sure you meet the requirements:
  1. build Kate according to this tutorial
  2. install Qt-Creator (in my case this is version 2.0.0rc1)
Setup the Kate project Qt-Creator once like this
  1. start Qt-Creator: ~/kde/run.sh /path/to/qtcreator/bin/qtcreator
  2. invoke File > Open File or Project and choose ~/kde/kate/CMakeLists.txt
  3. Build Location: choose ~/kde/build
  4. Run CMake arguments: choose ../kate -DCMAKE_BUILD_TYPE=debugfull -DCMAKE_INSTALL_PREFIX=~/kde/usr
  5. click the button "Run CMake" and then "Finish"
Start debugging like this
  1. click the "hammer" icon button on the very bottom left to compile Kate
  2. click the "computer" icon button (3 icons above the hammer icon) and choose "kate" (or "kwrite") in the Run combo box
  3. choose the "Debug" icon in the left pane
  4. invoke "Debug > Start Debugging (F5)", now Kate starts
  5. open part/document/katedocument.cpp in the file tree view on the left
  6. go to the line "KateDocument::insertText" and click "Debug > Toggle Breakpoint (F9)"
  7. now if you type a character in Kate, Qt-Crator will halt in KateDocument::insertText
  8. chose "Debug > Step Opver (F10)" (and "Debug > Stip Into (F11)") to step through the code
  9. click on "Locals and Watchers" in the debugging pane on the bottom and you see the values of local variables
Happy debugging :)

Thursday, June 10, 2010

Kate: Code Folding Crash

We still have a crash in Kate's code folding code; no one was able to find a proper fix, yet. So if you want to get your hands dirty, just build Kate, find a fix and be the hero of all Kate developers :)

Update: Fixed by Stefan Schenk in this commit for KDE 4.5. Awesome! :)