kde Syndicate content

warning: Creating default object from empty value in /www/htdocs/w0065fc9/milianw/modules/taxonomy/taxonomy.pages.inc on line 33.

» Massif Visualizer 0.3 released

Sun, 11/20/2011 - 19:17

Hey all!

I’m happy to announce the release of Massif-Visualizer 0.3. You can download the sources here:


Highlights of this release:

  • translations into 18 different languages
  • basic support for hiding of functions via context menu
  • basic support for custom allocators
  • configurable precision of memory consumption display
  • various optimizations, bug fixes and other improvements. take a look at the changelog for more information
Future Development

It took me much too long to get this release out and hope to do better in the future. Current git master already contains some new patches - try it out! I especially like the improved display of the callgraph which now aggregates the tails of the callgraph tree, i.e. the end of the backtrace which mostly starts main() etc.

If you have ideas for the future, or have any issues with Massif-Visualizer, report a bug on https://bugs.kde.org/ .


I don’t want to waste my time on packaging and instead concentrate on development. So here again a public plead to distributors: Please include Massif-Visualizer in future releases and let users download it seamlessly through your package manager. Starting with this release, Massif-Visualizer releases will follow the usual KDE procedure and the source tarballs will be hosted on the KDE mirrors. Hope this makes it simpler for packagers!

Ubuntu users can use Aurélien Gâteau’s PPA: https://launchpad.net/~agateau/+archive/ppa . ArchLinux users you can get it via AUR, and Gentoo also has an overlay for it it seems. I also think that OpenSUSE has a package for it. Please add infos for $your-distro in the comments below.


» Qt: Tint alphatransparent PNG

Wed, 09/21/2011 - 18:07

Let’s assume you want to display the logo of your company in your Qt app. Most probably that logo has just single color with an alpha channel.But: Having the color hard coded in the image is not nice, there are users (like me!) out there, who use a custom (dark!) color scheme. Meaning: If your logo is black/dark and assumes a bright background and you just embed it blindly in your app, I probably won’t see it since the background will be dark in my case.

Here is a solution for the simple case of a mono-colored PNG with an alpha channel which I came up with:

  1. QLabel* label = new QLabel;
  2. // load your image
  3. QImage img(QString("..."));
  4. // morph it into a grayscale image
  5. img = img.alphaChannel();
  6. // the new color we want the logo to have
  7. QColor foreground = label->palette().foreground().color();
  8. // now replace the colors in the image
  9. for(int i = 0; i < img.colorCount(); ++i) {
  10. foreground.setAlpha(qGray(img.color(i)));
  11. img.setColor(i, foreground.rgba());
  12. }
  13. // display the new logo
  14. label->setPixmap(QPixmap::fromImage(img));
  15. label->show();

This seems to work just fine for me. YMMV.

» VTune and KDE

Fri, 09/09/2011 - 21:09

Hey all,

been some time since I blogged last time. My TODO list is ever increasing and I took my day job at KDAB up again. Among others, I attended a marketing talk by Edmund Preiss. He actually made that marketing talk interesting, not least by his huge knowledge in the business, thanks to ~20 years of working for Intel. Probably the most important info I got out of it is this:

VTune is available free-of-charge under a non-commercial license

Yes, you heard right. Take these links:

  • Intel’s non-commercial offering

    note this entry from the FAQ:

    What does noncommercial mean?
    Non-commercial means that you are not getting compensated in any form for the products and/or services you develop using these Intel® Software Products.

  • Register for free license

  • Register for Download Access

    you’ll need the serial number that gets send to you via email after registering for the license

  • install VTune and profile the hell out of KDE/FOSS software and improve it all!

speeding up KDevelop

Personally I did the latter for KDevelop the last two days, and the results are astonishing. I just tested the results from today and an unscientific time kdevelop -s lotsofprojects - wait until parsing finished - stop showed roughly 50% decrease in time, from ~12min to ~6min. Yes, a whopping 50% - try it out for yourself and see how big the gain is. Don’t forget to whipe the DUChain cache though (i.e. via setting the environment variable CLEAR_DUCHAIN_DIR=1).

Why VTune rocks

I’m a huge fan of the Valgrind toolsuite, but it is simply too slow for profiling some things. Like opening ten medium to big sized projects in KDevelop and taking a look at the parsing speed. This can easily take a few minutes, but in Valgrind it would take ages. With VTune on the other hand, thanks to it’s sampling based approach, I don’t really notice the performance delay.

Then you might have heard of the new perf profiling utility in the Linux kernel. It is also sampling based, but sadly requires special compile options on 64 Bit (-fno-omit-frame-pointers), and the UI is horrible, I haven’t found anything worthwhile with it so far…

VTune on the other hand has an incredible GUI, which makes profiling a joy. You can look at call stacks top-down or bottom-up, visualize locks and waits, easily find hotspots, … I’m blasted. Especially the utilities to look at multi threaded performance (of e.g. KDevelop) kills every single other performance tool I have ever tested. Oh and did I mention that you can attach to an app at runtime, analyze some thing, and detach again?

Seriously, Intel: You just found a new fan boy in me. Thanks for giving this tool away for free for us “I hack on this tool in my spare time, yet still want it to perform nicely” people :) And kudos to the VTune developers - I’m blown away by it!

I really hope more people in the KDE community will try out VTune and try to improve the performance of our apps, I bet there is lots of potential!


There are some negative aspects to VTune though: First of all it’s UI is sometimes freezing. I wonder if the developers should not maybe spent some time on analyzing the tool itself ;-)

The biggest gripe though is that VTune does not work everywhere. I tried to run it on my Arch box, but sadly Linux 3.0 is not supported by VTune yet. It worked like a charm on two Ubuntu boxes with some 2.6.X kernel though.

This also means that I have no idea if, and how, VTune works on non-Intel CPUs. I think some of it works nicely. I did not install any of the Kernel modules for examples, which would be required for hardcore lowlevel CPU profiling. I think the same feature set I praised so much above, should hence be available on e.g. AMD CPUs. But well, this is left to be tested.

So, I’m now drinking a well deserved beer and look positively into the future of a fast KDevelop/KDE :)


» GSOC: C++2011 Support in KDevelop Part 1

Tue, 06/28/2011 - 14:09

Hey all,

I finally want to write a bit about my work on KDevelop during this year’s GSOC. To make things a bit more interesting for the whole crowd, even for those heretics that don’t use KDevelop, I want to highlight some C++2011 features I got to know in the process. Hence this multipart blog post should be interesting for all KDE hackers, as eventually we will be able to use these shiny new features of what is to be known as C++2011.

For those interested in the full overview of changes in C++2011, take a look at e.g. the C++0x Status Page in GCC 4.6, the wikipedia article on C++0x, or try to get hold of a copy of the C++2011 FDIS spec file. Note that the latter is apparently not freely accessible, see also this stackoverflow discussion. Still, maybe you find someone who can send you a copy…

So, lets get down to business. Following is a not-complete list of C++2011 features I’ve already implemented in KDevelop. If I mess something up in explaining a new feature, or if I forget an important aspect, please add a comment.

Range-Based for

This neat little addition is not so important to most Qt developers. We know and love our foreach macro. C++2011 comes with a similar built-in construct called range-based for. Essentially the syntax goes like this:

  1. QVector<MyType> list;
  2. for(const MyType& item : list) {
  3. // do stuff
  4. }

It’s neat, and very similar in syntax to the oldschool foreach macro. But there is a big difference: Where foreach makes a copy of the container, range-based for does not. This has mainly two implications:

  1. foreach is slow when used with containers that don’t use implicit sharing, most prominently STL containers
  2. range-based for has undefined behavior when you change the list you iterate over inside the loop.

Personally, I think I’ll stick to the foreach macro as it’s known to work well and has no big downsides in most Qt-based applications, as implicit-sharing is widely used throughout Qt.

RValue References / Move Support

This feature is a more advanced topic and mainly interesting for library developers who want to implement move semantics and/or achieve perfect forwarding, resulting in much better performance under certain conditions. Take a look at the Brief Introduction to RValue References, or the associated spec changes. From the syntax POV it’s just a matter of using && for rvalue references compared to the single & for normal lvalue references.

Defaulted and Deleted functions

This addition to the C++ spec is very welcome to me as it makes some code much more readable and also can be used to prevent hard-to-debug bugs or to improve performance. I’m talking about defaulted and deleted functions. E.g. from the wikipedia article:

  1. struct NonCopyable {
  2. NonCopyable & operator=(const NonCopyable&) = delete;
  3. NonCopyable(const NonCopyable&) = delete;
  4. NonCopyable() = default;
  5. };
  6. struct NoInt {
  7. void f(double i);
  8. void f(int) = delete;
  9. };

This shows the syntax of how to use this new feature. The advantages:

  • You can explicitly mark functions as deleted: Before you had to move these functions into private section of a class and not provide an implementation. When (accidentally) trying to use such a function you used to get unintuitive compile or linker errors. Now you get a nice message about usage of an explicitly deleted function.
  • You can prevent unwanted conversions: Using deleted functions is also useful when you want to prevent some function to be called with a different type that can be implicitly converted to your function’s wanted argument type.
  • Performance with defaulted functions: Compilers tend to write highly optimized code where possible. Implicitly defined constructors or assignment operators e.g. are one of these cases. But as soon as you use inheritance you (mostly) cannot use the implicit versions. Thanks to the new defaulted functions you can do that again. Furthermore it’s possible to change the access policy of an implicitly defined function (which are usually public) using the default syntax.
Variadic Templates

I confess that this is one of the more esoteric features of C++2011 for me. I never really did any serious template meta programming, and variadic templates are just as complicated as the other template programming. Yet I do see the advantages if people start to use it.

Anyhow, I implemented the required parser changes into KDevelop, but proper code completion and DUChain integration might need some time and brain effort :)


Now back to simpler things, yet definitely welcome and useful ones. One example are static assertions, i.e. compile-time assertions. The document I linked to contains a list of examples which should show how useful this feature is. Note that we Qt-users know and love the Q_ASSERT macro, but it is a runtime check. Boost users have had a BOOST_STATIC_ASSERT macro for some time, now we will finally be able to use it as well.

STL updates

Ah, before I forget it: Since KDevelop parses the STL includes, you should be able to use all new STL features already. If you spot a serious parser error in one of the include files of GCC 4.6 or 4.7, please notify me.

much much more

These are only some of the new features which I’ve added support for in KDevelop. I’ll try to sit down later today to write part 2, otherwise I’ll do that after I come back from the Fusion festival next week. Anyways, you can stay tuned for features like constexpr, opaque-enum-declarations, class-enums, improved right-shift token handling in nested templates, etc. pp.

» KDevelop 4.2.3 Released

Mon, 06/27/2011 - 02:05

Hey all!

I wanted to quickly notify you all about the availability of KDevelop 4.2.3, you can download it here:


Most people should be fine with waiting for updated packages from their distributor though.

To read the full release notes and take a look at the changelog, please visit the project website:


Many thanks to the contributors, for making this release possible

» KDevelop: Randa and GSOC 2011

Thu, 06/09/2011 - 15:59

Yawn. Hello everyone!

After two nights of backporting sleep in my RL branch to fix the deficiency I built up during Randa, I feel somewhat normal again. Time to blog, eh?


Lets begin with Randa. It was not only my first time there, but also my first time ever to be in the Swiss Alps. And furthermore it was the first time for me to be in the Alps without crying out loud about the lack of snow as I didn’t intend to go snowboarding. You can imagine it was a very pleasant experience for me. I definitely want to come back to go on some more serious hiking trips uphill. But I diverge ;-)

Randa as place for a sprint was simply awesome: Secluded hence no real distractions. Great environment to clean your head, get fresh air and stay focused and productive. Good food, nice people, … I could go on here :) The only negative things I noticed where the unstable networking and the dormitories.

KDevelop Sprint

The KDevelop sprint at Randa was very successful and productive. Here is a group picture of those who attended:

Randa 2011 KDevelop Group Picture
KDevelop Hackers at Randa 2011

from left to right: Sven Brauch (Python Support), Laszlo Papp (Gluon), Milian Wolff (…), Niko Sams (PHP, GDB, …), Aleix Pol (CMake, …), Alexander Dymo (UI, Ruby, …)

Aleix already blogged about what he did, so I won’t reiterate that. Instead let me point you to the incomplete log of our discussions on Techbase. Here are my personal highlights of the sprint:

  • We/I will setup a continous/nightly build- and regression-testing machine for KDevplatform/KDevelop and related plugins. Thanks already for the kind offers for hosting. More on this later
  • some more plugins from e.g. Quanta will see a released soon. Due to lack of manpower we cannot wait for a stable Quanta release, but some plugins in there are already stable and usable.
  • we will have some “welcome to kdevelop” page eventually, based on Aleix’s work with the Plasma Dashboard
  • Niko’s “Browser Like Tabs” mode will be merged eventually, try it out now and give us feedback!
  • Alexander merged a partial rewrite of the UI framework in KDevelop, bringing lots of new features and less bugs as well as reducing our codebase!
  • Sven attended his first KDE sprint and continued to work on a kick-ass python language support for KDevelop! Rock on!

I could go on and on here, we really did lots of stuff. It was great meeting you all again, hope to see you soon (at the Desktop Summit?).


To finish this already long blog off, here a few notes on my GSOC. As you might have heard, I work on bringing C++2011 (aka C++0x) support to KDevelop. I’ve already pushed some changes to my branch which adapt our parser to support the range-based for loop syntax as well as RValue references and variadic templates. Proper DUChain integration is pending, yet it already makes working with C++2011 features much more bearable! Stay tuned for a more in-depth report.

» The End Is Nigh

Wed, 05/25/2011 - 16:35

No I’m not a nutjob who talks about the rapture (epic fail btw.). Instead, I’m talking about my time as a bachelor student. I’ve just handed in my thesis after weeks of work on it. You might have noticed by my recent absence from KDE hacking. But rest assured. Now I’m back again :)

First of all the GSOC hack time started officially this week. I got a slot again, and am a few days behind schedule yet am confident to fetch up. I’ll be working on bringing C++0x or now C++2011 support to KDevelop. You can read my proposal online.

Secondly next week I’ll be at Randa for the KDevelop sprint (among others). I’m really looking forward to it, so many nice people to meet again — awesome!

So expect more from my side again. I’ll also start to go through the bug reports of the last weeks which I have not yet attended to. Stay tuned and welcome back :)

» Why can I not clone myself yet?

Sun, 01/30/2011 - 01:54

Saturday night and I’m not going out. What the hell is wrong with me — you (and I) ask?

Sad truth is: I’m swamped with work currently. Today I sat down and finished the last protocol of a university lab course, so at least that is done for now.

Bachelor Thesis

I’m not a slacker (even though I’d like to be one!) so I also recently started working on my Bachelor thesis. I’m doing something on EPR simulations, esp. pulse EPR with “big” molecules. It’s actually pretty interesting and I already learned tons of stuff. Most notably I could finally try out Eigen. It’s as good as I imagined, and probably even better ;-) My mentor at the university, who used BLAS up to now, is amazed by the readability of code you write. It is often nearly a one-to-one mapping of a mathematical formula to code. Since I personally never learned the BLAS interface, and find it’s API hideous, I’m very pleased to be able to use Eigen from the start. Thanks to Gael and Benoit (and the others) for writing it. Since I like living on the edge, I use Eigen 3 already and - to give something back - started to update the benchmarks for them.

Anyways, back to my thesis. If anyone is interested in the code and would like to give feedback, you can find it here: https://github.com/milianw/bachelor

I really enjoy to get to know yet another different world in programming. As you might know, I started as a web developer back then. Server backend PHP programming is totally different from user interface JavaScript programming is totally different from Desktop application programming using Qt/KDE/C++… And now there is computational science… So far I never had to care about rounding errors in code I write. Nor did I estimate memory consumptions in dozens of GigaBytes or thought about how many hours my app would need to crunch the numbers on hundreds of CPU cores. It really is quite an experience.

I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

So, between two days working for KDAB (which I greatly enjoy) to earn some money, and three days of - interesting - thesis reasearch, and the usual real life, where is the time for KDevelop? It’s diminished, I have to admit. Today I finally got around to at least get the release announcement for KDevelop 4.2 finished and handed it to the Dot editors. But other than the occasional commit reviewing or bug triaging, I did not do much these past weeks.

This makes my really sad, as I’m passionate about KDevelop. One more reason to look forward to FOSDEM 2011, as I’ll do a lightening talk on KDevelop this time. And of course I hope to get some first grade hacking time in Brussels :) Oh this reminds me, I should get my talk prepared until tomorrow - hm :)

Anyways, I bet I’m not the only one who would like to clone himself to get more finished. Sadly it’s not possible yet (and the waiting list for people-to-be-cloned in KDE is quite long, and dominated by names like David Faure and Dario Andres anyways ;-) ). So take my ramblings with a grain of salt :)

» KDevelop 4.2 Available

Wed, 01/26/2011 - 22:41

Hey all!

I wanted to quickly notify you all about the availability of KDevelop 4.2.0 final, you can download it here: http://download.kde.org/download.php?url=stable/kdevelop/4.2.0/src/ . Most people should be fine with waiting for updated packages from their distributor though.

This is a feature release with lots of shiny improvements and fixes. And - which is why I announce it now - it is required for users of the new KDE 4.6. So if you happen to use that, make sure you update to KDevelop 4.2 as well. Stay tuned for a full blown release announcement on the Dot soon. If you are interested in the changes now, take a look at this, this, and that. Thanks to all contributors who made this release possible, especially I would like to emphasize the contributions by new people - welcome!

Changes since KDevelop 4.2.0 RC1
  1. ChangeLog for kdevplatform v1.2.0
  2. =================================
  4. * Milian Wolff: set version to 1.2.0 in preparation of release
  5. * Milian Wolff: remove warning that is triggered whenever the cleanup asserts for a proper removal
  6. * Adam Pigg: Save the status of the 'Use lower case filenames' checkbox for next time. Defaults to ticked as before.
  7. * Aleix Pol: Rehash every time, we can change the repository between calls, so it has to be calculated every time.
  8. * Aleix Pol: Don't display all commits in the OutputView. Makes the process considerably faster
  9. * Milian Wolff: don't add infinite number of rows of output, instead limit to 50k lines and only keep the most recent ones
  10. * David Nolden: Make sure that working sets are unique to the patch-review area before changing them.
  11. * David Nolden: Only try creating one parse-job at a time. If more parse-jobs need to be created, queue an event to re-try.
  12. * David Nolden: Delete the view _after_ emitting "viewRemoved(..)". This fixes a possible crash.
  13. * David Nolden: Also use the cache if the cached list is "empty", it means that no mimetype could be determined.
  1. ChangeLog for kdevelop v4.2.0
  2. =============================
  4. * Milian Wolff: set version to 4.2.0 and look for kdevplatform 1.2.0 in preparation of release
  5. * David Nolden: Fix a very rare crash
  6. * David Nolden: Fix code-completion within incomplete function-macros, like "Q_ASSERT("
  7. * David nolden: Properly skip hexadecimal numbers in pp_skip_number.
  8. * Aleix Pol: Applied Valentyn Pavliuchenko patch to fix GLOB_RECURSIVE behaviour.
  1. ChangeLog for php v1.2.0
  2. ========================
  4. * Milian Wolff: set version to 1.2.0 and look for same versioned kdevplatform in preparation of release
  5. * Milian Wolff: fix test logic
  6. * Milian Wolff: only take encountered declarations into account when checking for redeclarations
  7. * Milian Wolff: don't report use for same range as declaration of parent-namespace, happens with nested namespaces, fixes test
  8. * Milian Wolff: properly pass topducontext to update along
  9. * Milian Wolff: force updated range when encountering variable declaration
  10. * Milian Wolff: prevent explicitlyGlobal import identifiers for namespace alias declaration, fixes assert
  11. * Milian Wolff: prevent crash when visiting encapsed variables in class context

Sorry for not having a proper Dot announcement on time, I hope to do better for the next release…

» KDevelop 4.2 RC1 released

Fri, 01/14/2011 - 18:03

Good news everyone, part 2 for today:

I’m happy to announce the immediate availability of KDevelop 4.2 RC1. This is a pure bug fix release over the last beta in the 4.2 branch. Anyone using the 4.2 branch is urged to upgrade to this new version as soon as possible. Furthermore any new testers are welcome and feedback appreciated. Report it on the bugtracker on bugs.kde.org. Keep in mind that if you are using KDE 4.6 or higher, you need this release, as 4.1 only works up to KDE 4.5. If all goes according to plan, there will be another RC soon and a final release together with KDE 4.6.


You can grab the source tarballs at the usual location: http://download.kde.org/download.php?url=unstable/kdevelop/4.1.90/src/

Packagers will hopefully update the testing repositories of their distribution.

  1. ChangeLog for KDevPlatform v1.1.90
  2. =============================
  3. * Milian Wolff: fix compilation for some compilers
  4. * David Nolden: backport from master: Don't care about navigation tooltips when a context-browser view is visible, the view will handle this alone
  5. * David Nolden: backport from master: regression fixes to context browser plugin refactor
  6. * David Nolden: backport from master: Clear the file-modification cache instantly when the user has saved the file in the editor.
  7. * David Nolden: backport from master: Don't completely ignore the retrieved top-context if it is still flagged to require an update. Instead, simply show a warning message on the status bar. (TODO: Find out why the update flag is not correct)
  8. * David Nolden: backport from master: Exclude the "." when extracting the extension
  9. * David Nolden: backport from master:
  10. * Nicolás Alvarez: Move qHash of {Cursor,Range}InRevision into the KDevelop NS too.
  11. * Nicolás Alvarez: Move qHash overload for SimpleRange and SimpleCursor into the KDevelop NS.
  12. * Milian Wolff: make sure we generate colors in the ctor (undelayed)
  13. * Milian Wolff: Introduce a fallback cache based on the file extension for LanguageController::languagesForUrl
  14. * Milian Wolff: use full canonical file path for urls in duchainify, required for isLocalFile checks to succeed
  15. * Milian Wolff: append _STATIC to macros in appendedlist_static.h to prevent clash with appendedlist.h, should fix compilation in KDE4_ENABLE_FINAL=ON mode
  16. * Dmitry Risenberg: Do not mess with other active working sets when calling for a review. BUG: 260663
  17. * Milian Wolff: properly emitResult when internal SVN job failed, prevents indefinite wait in isVersionControlled on invalid URLS
  18. * Nicolás Alvarez: Simplify code in DUContextDynamicData assertion.
  1. ChangeLog for KDevelop v4.1.90
  2. ==============================
  4. * Dmitry Risenberg: Fix duplicate brackets insertion when executing completion for a function.
  5. * Nicolás Alvarez: CMakeDUChainTest: store ranges in QSet instead of std::set.
  6. * Milian Wolff: minor: fix style/indentation
  7. * Floris Ruijter: fixes the cmakeduchaintest: a list of uses is checked too see if they're all there, that's a set operation, the test failed, because the lists where in the `wrong' order
  8. * Floris Ruijter: this test contains a c++ error, it isn't too bad(the test passes with it), but it's probably not meant
  9. * Floris Ruijter: Fix token-names for GeneratorTest
  10. * Aleix Pol: Don't look for kdevelop in gitorious anymore.
  11. * Nicolás Alvarez: Ignore the 'build' directory.
  12. * Aleix Pol: Don't add to the tree unexisting directories.
  1. ChangeLog for KDevelop PHP v1.1.90
  2. ========================
  4. * Milian Wolff: Allow null as type for class constants.