<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.6(BH)" -->
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Planet Maemo: category &quot;feed:a93f39245539231538463d349e184dd2&quot;</title>
        <description>Blog entries from Maemo community</description>
        <link>http://maemo.org/news/planet-maemo/</link>
        <lastBuildDate>Sun, 24 May 2026 07:48:19 +0000</lastBuildDate>
        <generator>FeedCreator 1.7.6(BH)</generator>
        <language>en</language>
        <managingEditor>planet@maemo.org</managingEditor>
        <item>
            <title>profiling is not understanding</title>
            <link>http://blog.rburchell.com/2014/09/profiling-is-not-understanding.html</link>
            <description><![CDATA[
When software goes slow, generally, the first reaction is to profile. This might be done through system tools (like Instruments on OS X, perf/valgrind/etc on Linux, VTune, etc). This is fine and good, but just because you have the output of a tool does not necessarily correlate to understanding what is going on.<br /><br />This might seem like an obvious distinction, but all too often, efforts at improving performance focus on the small picture ("this thing here is slow") and not the bigger picture ("why is this so slow"). At Jolla, I had the pleasure of running into one such instance of this, together with <a href="http://sletta.org/">Gunnar Sletta</a>, my esteemed colleague, and friend.<br /><br />As those of you who are familiar with Jolla may know, we had been working on upgrading to a newer Qt release. This also involved quite a bit of work for us, both in properly upstreaming work we had done on the hurry to the late-2013 release, and in isolating problems and fixing them properly in newer code (the new scenegraph renderer, and the v4 javascript engine in particular have been an interesting ride to get both at once!).<br /><br />As a part of this work, we noted that touch handling was quite slow (something which we had worked around for our initial release, but now wanted to solve properly). This was due to the touch driver on the Jolla introducing touchpoints faster than the display was updating, that is, while the display might be updating at 57 hz (yes, the Jolla is weird, it doesn't do 60 hz) - we might be getting input events a lot more frequently than that.<br /><br />This was, in turn, causing QtQuick to run touch processing (involving costly item traversals, as well as the actual processing of touch handling) a lot more frequently than the display was updating. As these took so much time, this in turn slowed rendering down, meaning even more touch handling was going on per frame. A really ugly situation.<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-C8a2VW5fZcQ/VBLoexMz5II/AAAAAAAAAPA/ZfwE6eZxbSM/s1600/Skjermbilde%2B2014-09-12%2Bkl.%2B14.34.01.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-C8a2VW5fZcQ/VBLoexMz5II/AAAAAAAAAPA/ZfwE6eZxbSM/s1600/Skjermbilde%2B2014-09-12%2Bkl.%2B14.34.01.png" height="131" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 1: Event tracing inside the Sailfish OS Compositor</td></tr></tbody></table>Figure 1 demonstrates this happening at the compositor level. The bottom slice (titled "QThread") is the event delivery thread, responsible for reading events from evdev The peaks there are - naturally - when events are being read in. The top thread is the GUI thread, and the high peaks there are touch events being processed and delivered to the right QtQuick item (in this case, a Wayland client, we'll get to that later). The middle slice is the compositor's scenegraph rendering (using QtQuick).<br /><br />With the explanation out of the way, let's look at the details a bit more. It's obvious that the event thread is regularly delivering events at around-but-not-quite twice the display update. Our frame preparation on the GUI thread looks good, despite the too-frequent occurrence of event delivery, though, and the render thread is coping too.<br /><br />But this isn't a major surprise - the compositor in this case is dead simple (just showing a fullscreen client). What about the client? Let's take a look at it over the same timeframe...<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-CgnNLQ5RfTs/VBLpxuDDlNI/AAAAAAAAAPI/3G6dph2MSao/s1600/Skjermbilde%2B2014-09-12%2Bkl.%2B14.40.04.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-CgnNLQ5RfTs/VBLpxuDDlNI/AAAAAAAAAPI/3G6dph2MSao/s1600/Skjermbilde%2B2014-09-12%2Bkl.%2B14.40.04.png" height="148" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Figure 2: Event tracing for the client (Silica's component gallery, in this case)</td></tr></tbody></table>Figure 2 focuses on two threads in the client: the render thread (top), and the GUI thread (bottom). Touch events are delivered on the GUI thread, QtQuick processes them there while preparing the next frame for the render thread.<br /><br />Here, it's very clear that touch processing is happening way too often, and worse than that, it's taking a very long time (each touch event's processing is taking ~4ms), not leaving much time for rendering - and this was on a completely unloaded device. In a more complicated client still, this impact would be much, much worse, leading to frame skipping (which we saw, on some other applications).<br /><br />Going back to my original introduction here, if we had used traditional profiling techniques, we'd have seen that touch handling/preparation to render was taking a really long time. And we might have focused on optimizing that. Instead, thanks to some out-of-the-box thinking, we looked at the overall structure of application flow, and were able to see the real problem: doing extra work that wasn't necessary.<br /><br />As an aside to this, I'm happy to announce that <a href="https://qt.gitorious.org/qt/qtdeclarative/commit/6dc8f47bb05a8acb3cbcc697e0dc05356a01d4cf">we worked out a neat solution to this</a>: QtQuick now doesn't immediately process touch events, instead, choosing to wait until it is about to prepare the next frame for display - as well as "compressing" them to only deal with the minimal number of sensible touch updates per frame. This should have no real impact on any hardware where touch delivery was occurring at a sensible rate, but for any hardware where touch was previously delivering too fast, this will no longer be a problem as of Qt 5.4.<br /><br />(Thanks to <a href="http://sletta.org/">Gunnar</a> &amp; myself for the fix, Carsten &amp; Mikko for opening my eyes about performance tooling, and Jolla for sponsoring this work.<br /><br />P.S. If you're looking for performance experts, Qt/QML/etc expertise or all round awesome, <a href="https://www.linkedin.com/profile/view?id=19584333">Gunnar</a> and <a href="http://www.linkedin.com/in/rburchell">myself</a> are currently interested in hearing from you.)<span class="net_nemein_favourites">0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=1e43aa86ea1c8ae3aa811e4bde2a72cbbc10e4b0e4b&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/1e43aa86ea1c8ae3aa811e4bde2a72cbbc10e4b0e4b/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=1e43aa86ea1c8ae3aa811e4bde2a72cbbc10e4b0e4b&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/1e43aa86ea1c8ae3aa811e4bde2a72cbbc10e4b0e4b/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Fri, 12 Sep 2014 18:06:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-1e43aa86ea1c8ae3aa811e4bde2a72cbbc10e4b0e4b</guid>
        </item>
        <item>
            <title>sailing in search of fresh waters</title>
            <link>http://blog.rburchell.com/2014/08/sailing-in-search-of-fresh-waters.html</link>
            <description><![CDATA[
I've had a long, quiet time on this blog over the past few years while I've been frantically helping <a href="http://jolla.com/">Jolla</a> to launch their self-named product: the <a href="http://jolla.com/jolla">Jolla</a>. I've enjoyed (almost) every day I've been there: they really are a great bunch of people and the work has been plentiful and challenging.<br /><br />But as the saying goes, "this too shall pass". Nothing lasts forever, and it's time for a change: after this week, I will be taking a break from Jolla to get some fresh perspective.<br /><br />On the bright side, maybe I'll have some more time for writing now :)<br /><br />If anyone is interested in getting a hold of a <a href="http://rburchell.com/about/">C++/Qt/QML/Linux expert with a focus on performance, expertise on mobile, and a wide range of knowledge across other areas</a>&nbsp;who loves open source, please <a href="http://rburchell.com/contact/">let me know</a>.<span class="net_nemein_favourites">0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=1e422e3393bd89422e311e4a5ae49bc1c2552dd52dd&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/1e422e3393bd89422e311e4a5ae49bc1c2552dd52dd/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=1e422e3393bd89422e311e4a5ae49bc1c2552dd52dd&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/1e422e3393bd89422e311e4a5ae49bc1c2552dd52dd/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Wed, 13 Aug 2014 11:55:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-1e422e3393bd89422e311e4a5ae49bc1c2552dd52dd</guid>
        </item>
        <item>
            <title>Every time you use CONFIG+=ordered, a kitten dies.</title>
            <link>http://blog.rburchell.com/2013/10/every-time-you-configordered-kitten-dies.html</link>
            <description><![CDATA[
QMake users: public service announcement. If you use CONFIG+=ordered,&nbsp;<i>please stop right no</i><i>w. </i>If you don't, I'll hunt you down. I promise to god I will.<br /><br />There is simply no reason to use this, ever. There's two reasons this might be in your project file:<br /><ol><li>you have no idea what you are doing, and you copied it from somewhere else</li><li>you have a target that needs to be built after another target, and you don't know any better</li></ol><div>If you fit into category 1, then I hope you're turning red right now, because by using CONFIG+=ordered, you're effectively screwing over multicore builds of your code. See&nbsp;<a href="https://github.com/rburchell/libresourceqt/commit/4c86922741eee367c194873852de53b44d59754b">a very nice case of this here</a>.</div><div><br /></div><div>If you fit into category 2, then you're doing it wrong. You should specify dependencies between your targets properly like this:</div><div><br /></div><pre>TEMPLATE = subdirs<br />SUBDIRS = src plugins tests docs<br />plugins.depends = src<br />tests.depends = src plugins<br /></pre><br />And then you'll have docs built whenever the build tool feels like it, and the rest built when their dependencies are built.<br /><br />If you have subdirectories involved in this, then you need an extra level of indirection in your project, but it's still not rocket science:<br /><br /><pre>TEMPLATE = subdirs<br />src_lib.subdir = src/lib<br />src_lib.target = sub-src-lib<br /><br />src_plugins.subdir = src/plugins<br />src_plugins.target = sub-plugins<br />src_plugins.depends = sub-src-lib<br /><br />SUBDIRS = src_lib src_plugins<br /></pre><br />For those of you wondering why I sound frustrated about this, I've fixed so many instances of this by now that it's just getting old and tired, frankly. And I still keep running into more. That's countless minutes of wasted build time, all because of laziness boiling down to a single line. Please fix it.<span class="net_nemein_favourites">1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=1e33cba68c2ce663cba11e3819f9ffe054daa9eaa9e&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/1e33cba68c2ce663cba11e3819f9ffe054daa9eaa9e/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=1e33cba68c2ce663cba11e3819f9ffe054daa9eaa9e&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/1e33cba68c2ce663cba11e3819f9ffe054daa9eaa9e/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Thu, 24 Oct 2013 11:36:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-1e33cba68c2ce663cba11e3819f9ffe054daa9eaa9e</guid>
        </item>
        <item>
            <title>writing a layout in QML</title>
            <link>http://blog.rburchell.com/2012/05/writing-layout-in-qml.html</link>
            <description><![CDATA[
Sometimes, for whatever reason, the layouts provided "out of the box" in QML just don't cut it. lately, I've been doing a few rather different things for experimentation and learning purposes that have meant I've run into quite a lot of these cases.<br /><br />when this happens, the first instinct is to fall into despair - but there's really no need for that. writing your own layout really isn't that hard. Here's a small, fairly self contained example doing just that.<br /><br />MyLayout.qml:<br /><blockquote>import QtQuick 2.0<br /><br />Item {<br />&nbsp; &nbsp; id: layout<br /><br />&nbsp; &nbsp; property bool ready: false<br /><br />&nbsp; &nbsp; onChildrenChanged: performLayout()<br />&nbsp; &nbsp; onWidthChanged: performLayout()<br />&nbsp; &nbsp; onHeightChanged: performLayout()<br /><br />&nbsp; &nbsp; /* the meat of the layout */<br />&nbsp; &nbsp; function performLayout() {<br />&nbsp; &nbsp; &nbsp; &nbsp; /* nothing to layout? don't bother then */<br />&nbsp; &nbsp; &nbsp; &nbsp; if (layout.children.length == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; var currentX = 0<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; console.log("DOING LAYOUT FOR " + layout.children.length + " ITEMS")<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; /* first real step of doing anything: go over all the children */<br />&nbsp; &nbsp; &nbsp; &nbsp; for (var i = 0; i &lt; layout.children.length; ++i) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var obj = layout.children[i]<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* in the real world, we'd probably do something a lot more complex,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* but let's just position our children along a row.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log("Positioning at " + currentX + " to " + (currentX + obj.width))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.x = currentX<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currentX += obj.width<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; console.log("LAYOUT DONE")<br />&nbsp; &nbsp; }<br />}</blockquote><br />MyItem.qml:<br /><blockquote>import QtQuick 2.0<br /><br />Rectangle {<br />&nbsp; &nbsp; width: 100<br />&nbsp; &nbsp; height: 50<br />&nbsp; &nbsp; color: "black"<br /><br />&nbsp; &nbsp; Rectangle {<br />&nbsp; &nbsp; &nbsp; &nbsp;width: 90<br />&nbsp; &nbsp; &nbsp; &nbsp;height: 40<br />&nbsp; &nbsp; &nbsp; &nbsp;anchors.centerIn: parent<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;color: "red"<br />&nbsp; &nbsp; }<br />}</blockquote><br />main.qml<br /><blockquote>import QtQuick 2.0<br /><br />Rectangle {<br />&nbsp; &nbsp; width: 1000<br />&nbsp; &nbsp; height: 100<br /><br />&nbsp; &nbsp; MyLayout {<br />&nbsp; &nbsp; &nbsp; &nbsp; MyItem { }<br />&nbsp; &nbsp; &nbsp; &nbsp; MyItem { }<br />&nbsp; &nbsp; &nbsp; &nbsp; MyItem { }<br />&nbsp; &nbsp; &nbsp; &nbsp; MyItem { }<br />&nbsp; &nbsp; &nbsp; &nbsp; MyItem { }<br />&nbsp; &nbsp; &nbsp; &nbsp; MyItem { }<br />&nbsp; &nbsp; &nbsp; &nbsp; MyItem { }<br />&nbsp; &nbsp; }<br />}</blockquote><br />This is obviously very simplified for demonstration purposes, to name a few things that it doesn't do:<br /><ul><li>it omits things like margins, wrapping</li><li>it will break if MyItem is ever anchored</li><li>it doesn't use anchoring (which might make for a more optimal implementation in this particular case - at the least, it wouldn't have to relayout if the width/height of the layout changed)</li><li>it doesn't relayout if the geometry of the children change</li><li>it relayouts whenever properties changes, which isn't optimal if e.g. the layout is animating a change, instead, it should delay a relayout using a Timer</li></ul><br />All of these are left to the reader, but hopefully it's of some help in getting started.<span class="net_nemein_favourites">7 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=c2ed1a68aa5811e18d465981862974b074b0&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/c2ed1a68aa5811e18d465981862974b074b0/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=c2ed1a68aa5811e18d465981862974b074b0&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/c2ed1a68aa5811e18d465981862974b074b0/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Wed, 30 May 2012 13:04:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-c2ed1a68aa5811e18d465981862974b074b0</guid>
        </item>
        <item>
            <title>on the importance of doing nothing</title>
            <link>http://blog.rburchell.com/2012/03/on-importance-of-doing-nothing.html</link>
            <description><![CDATA[
I've been meaning to write about this for a while, but I've only just now been driven over the edge by having to go and basically run sed over code again for no good reason.<br /><br />When you're programming, always make sure you question *why* things are done. Qt provides three functions, helpfully named qMalloc/qRealloc/qFree. Despite the 'q' in front of their names, these functions do absolutely nothing useful, they just wrap around their stdlib friends. This was originally done to enable replacement of the allocator inside Qt (but there are better ways to do that, without getting sidetracked from my central point), but in reality, doesn't have much use. That's why I'm <a href="http://codereview.qt-project.org/#change,11562">trying to deprecate them</a>.<br /><br />Now, you might ask, "what impact could a simple function call have, anyway"? I'm glad you asked. Benchmark time (<i><b>spoiler for the lazy:</b> ~10% extra overhead for small allocation sizes, ~0-5% for larger allocation sizes</i>).<br /><span style="white-space: pre-wrap;">virgin:~/mallocbench% cat main.cpp</span><br /><pre style="white-space: pre-wrap; word-wrap: break-word;">#include &lt;QtCore&gt;<br />#include &lt;qtest.h&gt;<br />#include &lt;qcoreapplication.h&gt;<br />#include &lt;qdatetime.h&gt;<br /><br />class MallocBenchmark : public QObject<br />{<br />Q_OBJECT<br />private slots:<br />    void qtMalloc();<br />    void qtMalloc_data();<br />    void regularMalloc();<br />    void regularMalloc_data();<br />};<br /><br />void MallocBenchmark::qtMalloc_data()<br />{<br />    QTest::addColumn&lt;int&gt;("size");<br />    QTest::newRow("1") &lt;&lt; 1;<br />    QTest::newRow("10") &lt;&lt; 1;<br />    QTest::newRow("100") &lt;&lt; 100;<br />    QTest::newRow("10000") &lt;&lt; 10000;<br />    QTest::newRow("1000000") &lt;&lt; 1000000;<br />    QTest::newRow("10000000") &lt;&lt; 10000000;<br />}<br /><br />void MallocBenchmark::qtMalloc()<br />{<br />    QFETCH(int, size);<br /><br />    QBENCHMARK {<br />        void *p = ::qMalloc(size);<br />        ::qFree(p);<br />    }<br />}<br /><br />void MallocBenchmark::regularMalloc_data()<br />{<br />    qtMalloc_data();<br />}<br /><br />void MallocBenchmark::regularMalloc()<br />{<br />    QFETCH(int, size);<br /><br />    QBENCHMARK {<br />        void *p = malloc(size);<br />        free(p);<br />    }<br />}<br /><br />QTEST_MAIN(MallocBenchmark)<br /><br />#include "main.moc"</pre><br /><br />And now, the results on my machine:<br /><pre style="white-space: pre-wrap; word-wrap: break-word;">********* Start testing of MallocBenchmark *********<br />Config: Using QTest library 5.0.0, Qt 5.0.0<br />PASS   : MallocBenchmark::initTestCase()<br />RESULT : MallocBenchmark::qtMalloc():"1":<br />     0.000059 msecs per iteration (total: 62, iterations: 1048576)<br />RESULT : MallocBenchmark::qtMalloc():"10":<br />     0.000062 msecs per iteration (total: 66, iterations: 1048576)<br />RESULT : MallocBenchmark::qtMalloc():"100":<br />     0.000087 msecs per iteration (total: 92, iterations: 1048576)<br />RESULT : MallocBenchmark::qtMalloc():"10000":<br />     0.000083 msecs per iteration (total: 88, iterations: 1048576)<br />RESULT : MallocBenchmark::qtMalloc():"1000000":<br />     0.0043 msecs per iteration (total: 72, iterations: 16384)<br />RESULT : MallocBenchmark::qtMalloc():"10000000":<br />     0.0063 msecs per iteration (total: 52, iterations: 8192)<br />PASS   : MallocBenchmark::qtMalloc()<br />RESULT : MallocBenchmark::regularMalloc():"1":<br />     0.000053 msecs per iteration (total: 56, iterations: 1048576)<br />RESULT : MallocBenchmark::regularMalloc():"10":<br />     0.000051 msecs per iteration (total: 54, iterations: 1048576)<br />RESULT : MallocBenchmark::regularMalloc():"100":<br />     0.000082 msecs per iteration (total: 86, iterations: 1048576)<br />RESULT : MallocBenchmark::regularMalloc():"10000":<br />     0.000076 msecs per iteration (total: 80, iterations: 1048576)<br />RESULT : MallocBenchmark::regularMalloc():"1000000":<br />     0.0043 msecs per iteration (total: 71, iterations: 16384)<br />RESULT : MallocBenchmark::regularMalloc():"10000000":<br />     0.0060 msecs per iteration (total: 99, iterations: 16384)<br />PASS   : MallocBenchmark::regularMalloc()<br />PASS   : MallocBenchmark::cleanupTestCase()<br />Totals: 4 passed, 0 failed, 0 skipped<br />********* Finished testing of MallocBenchmark *********</pre><br />Around 10% extra time per iteration on smaller allocation sizes, 0-5% on larger sizes (most likely explained by glibc falling back to using mmap for larger allocations, which is going to take an awful long time compared to a single function call). These, obviously, aren't huge numbers.&nbsp;But remember: this is overhead you're taking for<b><i> no reason at all</i></b>. Don't do it. Your CPU cycles will thank me.<span class="net_nemein_favourites">6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=185f26dc737511e197ebed3edc8f306b306b&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/185f26dc737511e197ebed3edc8f306b306b/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=185f26dc737511e197ebed3edc8f306b306b&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/185f26dc737511e197ebed3edc8f306b306b/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Wed, 21 Mar 2012 16:18:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-185f26dc737511e197ebed3edc8f306b306b</guid>
        </item>
        <item>
            <title>Qt 5.1, aka: when QFileSystemWatcher might not be so useless</title>
            <link>http://blog.rburchell.com/2012/03/qt-51-aka-when-qfilesystemwatcher-might.html</link>
            <description><![CDATA[
<br />With 5.0 now being feature frozen, I thought I'd turn myself towards something I've been meaning to do (and talking about doing) for a very long time. Back before the Qt Project launched, even before Qt Contributors Summit 2011, in fact. I thought I'd make QFileSystemWatcher more useful.<br /><br />Let's review what QFileSystemWatcher offers: a way to add and remove paths for monitoring directories and files, a directoryChanged(path) and a fileChanged(path) signal. That's it. If you think about this for a moment, you realise just how broken the semantics of the signals are: what _is_ a 'change' anyway? I guess this is one of the reasons that QFileSystemWatcher has been called 'deprecated' (I fixed one of the others, a performance issue, <a href="http://blog.rburchell.com/2012/01/qfilesystemwatcher-internals-in-qt-5.html">a while back</a>).<br /><br /><a href="http://codereview.qt-project.org/#change,19274">So I've been working on making the signals a bit less useless</a>. In the longer run, I plan to call fileChanged and directoryChanged deprecated. They'll still be emitted (of course) to keep existing code working, but in addition, you'll have (subject to review):<br /><br /><b>pathCreated(path)</b> - emitted when something is created inside a directory you are monitoring, or if something that didn't exist that you were monitoring for is created (more on this later)<br /><b>pathDeleted(path)</b> - emitted when something is deleted inside a directory you were monitoring, or something that you _were_ monitoring was deleted<br /><b>fileModified(path)</b> - emitted when a file you were monitoring is modified (attributes or contents)<br /><br />I also have early plans to introduce a pathMoved(oldLocation, newLocation), but that one has a lot of caveats: it might only work on certain platforms, in certain phases of the moon, and only if you're very lucky - on many platforms, it will likely continue to be synthesised as a pathDeleted(oldPath) and pathCreated(newPath) (if you're watching the new location).<br /><br />I<i>&nbsp;also</i>&nbsp;have vague ideas about introducing more syntactically friendly API over the top of this, something like:<br /><br />QPathMonitor pathMonitor(myPath);<br />connect(&amp;pathMonitor, SIGNAL(deleted()), SLOT(watchedPathDeleted()));<br />... etc ...<br /><br />but that's a bit farther away in that I haven't really thought it through, yet.<br /><br />In working on the new signals on Windows, I stumbled across <a href="https://bugreports.qt-project.org/browse/QTBUG-2331">QTBUG-2331</a>, which sort of proves just how useless the existing signals were: deleting a watched directory on Windows essentially never removed the watch, because it didn't notice the deletion. <a href="http://codereview.qt-project.org/#change,20385">Hopefully, it will be fixed soon</a>, because it's going to block the work on the new signals: otherwise, pathDeleted will never be emitted on a watched path on Windows, and that makes my unit tests sad.<br /><br />I noted earlier that I have plans to emit pathCreated when you monitor a non-existent path, well, that's correct - I intend to allow just that. None of the native APIs (that I know of) allow for recieving events when you monitor a non-existent path, which is a bit sad, as it means we'll need to fall back to polling on a timer for those cases, but it's certainly much better than nothing.<br /><br />Oh, and if you're curious, it seems like Linux has the best filesystem monitoring API, in the form of <a href="http://linux.die.net/man/7/inotify">inotify</a>. OS X/BSD comes in second with kqueue (though having to open file descriptors to do the actual monitoring is a bit crap, and not being able to get any sort of real fine-grained notifications on _what_ was added/removed in a directory is also painful). Windows is also incredibly painful due to running into many stupid limitations (like only some ~60 paths being able to be monitored per thread, so the backend spawns loads of threads if you monitor a lot of paths), and not being able to get even remotely useful signals without a lot of extra legwork. Not to mention the above bug, where signals are emitted before deletion.<br /><br />OS X may get more love in the future, as there is talk about another contributor revisiting the state of the FSEvents backend (which has been disabled for a very long time, and the code removed in Qt 5, due to being massively buggy and unmaintained).<br /><br />For Windows, ReadDirectoryChangesW might improve the situation, somewhat, but I certainly don't have the time to investigate it for 5.1, and I also lack the motivation, not being a Windows user myself. Contributions welcome?<span class="net_nemein_favourites">4 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=37812d8471eb11e1904d679ff26525442544&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/37812d8471eb11e1904d679ff26525442544/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=37812d8471eb11e1904d679ff26525442544&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/37812d8471eb11e1904d679ff26525442544/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Mon, 19 Mar 2012 17:10:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-37812d8471eb11e1904d679ff26525442544</guid>
        </item>
        <item>
            <title>QFileSystemWatcher internals in Qt 5</title>
            <link>http://blog.rburchell.com/2012/01/qfilesystemwatcher-internals-in-qt-5.html</link>
            <description><![CDATA[
Just thought I'd share some details on some of the recent changes I've pushed to Qt 5 a few weeks ago. (Yes, this post is rather overdue, I've been a bit slack with writing it). If you were in Tampere when I gave a short, completely underprepared Q&amp;A on Qt 5 a few days ago, this won't be news to you, but I will go into a bit more detail.<br /><div><br /><b>tl;dr</b>, all in all, a lot of code was deleted, and things still function more or less the same, except a bit better. That's quite a common story for Qt 5, I hope... :)<br /><br /></div><div>First of all, platform support: as with Qt 5 itself, Symbian support is no longer a goal. Since I wanted to make some changes to internals, and wasn't able to even remotely come close to building the Symbian code, it was removed.<br /><br />On Linux, the (ancient, and no longer used by default) dnotify backend also met its maker. Since inotify has been around for some 6-7 years, it was about time, especially as the dnotify backend had some interesting bugs in behaviour.<br /><br />The OS X FSEvents backend (also unused for quite some time, due to bugs, and not being a recommended way of working apparently) joined to make for a trinity of dead implementations. OS X's watching is survived by kqueue, which it shares with BSD platforms.<br /><br />The currently supported backends are:<br /><ul><li>inotify (on Linux)</li><li>kqueue (on BSD and OS X)</li><li>WaitForMultipleObjects on Windows, which I need to become more familiar with. Not having a Windows machine has meant that I'm not really able to do much here...</li></ul><div>Aside from backend support, there were some more 'fun' changes which went in. First, some detail on implementation. Each QFileSystemWatcher has an 'engine' associated with it, which is backend-specific, and does the actual monitoring. The backend is responsible for communicating changes to the 'frontend' QFileSystemWatcher, which then sends the notifications to the API user.</div><div><br />In the past, QFileSystemWatcher engines used to be run in a thread. I'm not sure why this was done originally, but it pretty much never made much sense - monitoring file changes is not a particularly intensive operation, so this is just a waste of resources (thread stack, time to start the thread, etc) - which was compounded by this being a thread <b>per engine</b>, meaning that if you have a few different libraries monitoring files, they'd each start their own thread.</div><div><br /></div><div>Another nasty side effect of this thread was resource consumption caused by monitoring. If you monitored a large number of paths, but couldn't consume events faster than the OS was throwing them at you, then that engine thread would happily sit there and keep on reading them and turning them into Qt signals for the QFileSystemWatcher/user code. But because that code was on a different thread, and unable to keep up, you'd just keep getting more, and more, and more signals, and memory usage would keep growing and growing.</div><div><br />This thread has now been removed, so changes are implicitly rate-limited to the thread the QFileSystemWatcher lives in, meaning that all of these are no longer a problem. Kudos should also go to Bradley Hughes for fixing a few issues which I missed on platforms other than Linux after it was integrated.</div><br />Brad also took this work a step further: QFileSystemWatcher has never been documented as being thread-safe, but the engines may have happened to be more or less thread-safe thanks to living on a different thread to the QFileSystemWatcher, through mutexing. One part inside Qt itself actually needed this for autotests to function correctly, too: QFileSystemModel. He fixed this requirement, and was thus able to remove the mutexes from the engines. Thanks!<br /><br />I'd also like to thank Brad, João Abecasis, and anyone I've forgotten for helping to review these changes and get them integrated.<br /><br />(One thing I neglected to mention above - the thread story is a little more complicated on Windows. Windows still has threads inside the engine (although the engine <i>itself</i> is no longer a thread, so there's still one less). This is necessary because WaitForMultipleObjects can only process up to MAXIMUM_WAIT_OBJECT handles at a time, unless you use multiple threads to do the monitoring, so that's exactly what it does. It spawns multiple threads on-demand as soon as it can't find a thread with a spare slot. But this is nothing new.)</div><span class="net_nemein_favourites">6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=63a32f1044f611e1953d496db41a5b545b54&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/63a32f1044f611e1953d496db41a5b545b54/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=63a32f1044f611e1953d496db41a5b545b54&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/63a32f1044f611e1953d496db41a5b545b54/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Sun, 22 Jan 2012 11:42:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-63a32f1044f611e1953d496db41a5b545b54</guid>
        </item>
        <item>
            <title>why I avoid QRegExp in Qt 4 and so should you</title>
            <link>http://blog.rburchell.com/2011/12/why-i-avoid-qregexp-in-qt-4-and-so.html</link>
            <description><![CDATA[
A few times, when I've been working on something performance-critical, I've had people suggest (or ask me to review code) using QRegExp. I usually tell them that "this is a bad idea, QRegExp is slow/unmaintained", but I never actually sat down to do benchmarks. Well, in Qt 5, the subject of replacing QRegExp <a href="http://lists.qt-project.org/pipermail/development/2011-November/000423.html">has been discussed a bit</a>, and we have a volunteer:&nbsp;<a href="mailto:dangelog@gmail.com">Giuseppe D'Angelo</a>,&nbsp;a Qt hacker and italian student living in the UK (looking for work, by the way!).<br /><br />One of the first steps he has taken has been to quantify the performance of two of our leading candidates for replacements: PCRE, and ICU's regex engine. He also took the liberty of benchmarking Qt's existing QRegExp - here's the results:<br /><br />(Caveat: Giuseppe has asked for someone more familiar with ICU to&nbsp;<a href="http://qtl.me/cjL.txt">look over the code</a>&nbsp;there to make sure the results aren't negatively impacted.)<br /><br /><br />RESULT : REBenchmark::PCREBenchmark():"URI":<br />&nbsp; &nbsp; &nbsp;1,123 msecs per iteration (total: 1,123, iterations: 1)<br />RESULT : REBenchmark::PCREBenchmark():"Email":<br />&nbsp; &nbsp; &nbsp;1,798 msecs per iteration (total: 1,798, iterations: 1)<br />RESULT : REBenchmark::PCREBenchmark():"Date":<br />&nbsp; &nbsp; &nbsp;99 msecs per iteration (total: 99, iterations: 1)<br />RESULT : REBenchmark::PCREBenchmark():"URI|Email":<br />&nbsp; &nbsp; &nbsp;2,650 msecs per iteration (total: 2,650, iterations: 1)<br /><br />RESULT : REBenchmark::ICUBenchmark():"URI":<br />&nbsp; &nbsp; &nbsp;11,674 msecs per iteration (total: 11,674, iterations: 1)<br />RESULT : REBenchmark::ICUBenchmark():"Email":<br />&nbsp; &nbsp; &nbsp;17,056 msecs per iteration (total: 17,056, iterations: 1)<br />RESULT : REBenchmark::ICUBenchmark():"Date":<br />&nbsp; &nbsp; &nbsp;392 msecs per iteration (total: 392, iterations: 1)<br />RESULT : REBenchmark::ICUBenchmark():"URI|Email":<br />&nbsp; &nbsp; &nbsp;30,552 msecs per iteration (total: 30,552, iterations: 1)<br /><br />RESULT : REBenchmark::QRegExpBenchmark():"URI":<br />&nbsp; &nbsp; &nbsp;21,579 msecs per iteration (total: 21,579, iterations: 1)<br />RESULT : REBenchmark::QRegExpBenchmark():"Email":<br />&nbsp; &nbsp; &nbsp;55,426 msecs per iteration (total: 55,426, iterations: 1)<br />RESULT : REBenchmark::QRegExpBenchmark():"Date":<br />&nbsp; &nbsp; &nbsp;1,357 msecs per iteration (total: 1,357, iterations: 1)<br />RESULT : REBenchmark::QRegExpBenchmark():"URI|Email":<br />&nbsp; &nbsp; &nbsp;77,224 msecs per iteration (total: 77,224, iterations: 1)<br /><br />(These tests were run on:&nbsp;Ubuntu 10.04 LTS 32 bit, Core(TM)2 Duo CPU&nbsp;P9600 &nbsp;@ 2.66GHz, 4GB RAM, GCC 4.4.3, Qt 4.7.4, PCRE 8.20, ICU 4.8.1.1)<br /><br />As we see from these results, PCRE is the clear winner, probably thanks to its use of JIT in evaluating the expressions. We see ICU showing decent results, and getting second place (see the caveat above). Leading the rear of the pack, we see QRegExp, 10x-30x slower than PCRE - and these are hardly complicated regular expressions.<br /><br />In conclusion, for now, if you want performance, you should probably steer clear of QRegExp, and find other ways to do what you want, either using QString directly if it's a simple job, or looking into a light shim around another regex engine until Qt 5, when hopefully, your problems will go away with a shiny new class.<br /><span class="net_nemein_favourites">4 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=b28074201c5c11e1a61943b71b5e23572357&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/b28074201c5c11e1a61943b71b5e23572357/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=b28074201c5c11e1a61943b71b5e23572357&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/b28074201c5c11e1a61943b71b5e23572357/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Thu, 01 Dec 2011 18:59:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-b28074201c5c11e1a61943b71b5e23572357</guid>
        </item>
        <item>
            <title>Avoiding graphics flicker in Qt / QML</title>
            <link>http://blog.rburchell.com/2011/11/avoiding-graphics-flicker-in-qt-qml.html</link>
            <description><![CDATA[
It's very common when writing QML applications to write a small stub, something like the following:<br /><br /><br />int main(int argc, char **argv)<br />{<br />&nbsp; &nbsp; QApplication application(argc, argv);<br />&nbsp; &nbsp; QDeclarativeView view;<br />&nbsp; &nbsp; view.setSource(QUrl("qrc:/qml/main.qml"));<br />&nbsp; &nbsp; view.showFullScreen();<br />&nbsp; &nbsp; return a.exec();<br />}<br /><div><br /></div><div>What's wrong with this? It's a very subtle problem. I'll give you a moment to think about it, and a video to see if you notice the problem. Make sure you don't cheat.</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><object width="320" height="266" class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/aXWZF-SLQFU/0.jpg"><param name="movie" value="http://www.youtube.com/v/aXWZF-SLQFU?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><embed width="320" height="266"  src="http://www.youtube.com/v/aXWZF-SLQFU?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash"></embed></object></div><div style="text-align: center;">(demonstrating removal of flicker in QML)</div><div><br /></div><div>Back already? Have you figured it out? That's right, it flickers. Horrifically.</div><div><br /></div><div>So what causes this? By default, QWidgets are drawn parent first, with parents drawing children. When a widget is drawn, first, it draws its background, then it draws the actual content. That background proves to be a problem, in this case.</div><div><br /></div><div>If we add the following lines to the above example, the flicker goes away, and my eyes no longer want to bleed:</div><div>&nbsp; &nbsp; view.setAttribute(Qt::WA_OpaquePaintEvent);<br />&nbsp; &nbsp; view.setAttribute(Qt::WA_NoSystemBackground);<br />&nbsp; &nbsp; view.viewport()-&gt;setAttribute(Qt::WA_OpaquePaintEvent);<br />&nbsp; &nbsp; view.viewport()-&gt;setAttribute(Qt::WA_NoSystemBackground);<br /><br />NB: I'm not completely sure that adding it to both the view, and the viewport is completely necessary, but it can't harm at least. Make sure to re-set it if you change viewports.</div><div><br /></div><div>For completeness, here's the full, fixed example:</div><div><br /></div><div>int main(int argc, char **argv)<br />{<br />&nbsp; &nbsp; QApplication application(argc, argv);<br />&nbsp; &nbsp; QDeclarativeView view;<br />&nbsp; &nbsp; view.setSource(QUrl("qrc:/qml/main.qml"));<br />&nbsp; &nbsp; view.setAttribute(Qt::WA_OpaquePaintEvent);<br /><br /><div>&nbsp; &nbsp; view.setAttribute(Qt::WA_NoSystemBackground);<br />&nbsp; &nbsp; view.viewport()-&gt;setAttribute(Qt::WA_OpaquePaintEvent);<br />&nbsp; &nbsp; view.viewport()-&gt;setAttribute(Qt::WA_NoSystemBackground);</div><br />&nbsp; &nbsp; view.showFullScreen();<br />&nbsp; &nbsp; return a.exec();<br />}<br /><br />(If you're curious, Qt::WA_OpaquePaintEvent basically implies that you'll repaint everything as necessary yourself (which QML is well behaved with), and Qt::WA_NoSystemBackground tells Qt to nicely not paint the background.)<br /><br />NB: on Harmattan (and Nemo Mobile) at least, make sure you always use QWidget::showFullScreen(). The compositor in use there unredirects fullscreen windows (meaning no compositor in the way), so you get faster drawing performance, and every frame counts.<br /><br /><span class="Apple-style-span" style="font-size: xx-small;">(obligatory thanks to Daniel Stone of X and Collabora fame, for telling me to stop blaming X, and start blaming the crappy toolkits ☺)</span></div><span class="net_nemein_favourites">7 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=01199bda161c11e1b17eaf721118ee38ee38&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/01199bda161c11e1b17eaf721118ee38ee38/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=01199bda161c11e1b17eaf721118ee38ee38&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/01199bda161c11e1b17eaf721118ee38ee38/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Wed, 23 Nov 2011 20:02:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-01199bda161c11e1b17eaf721118ee38ee38</guid>
        </item>
        <item>
            <title>Fast UI with Qt 4 on mobile</title>
            <link>http://blog.rburchell.com/2011/11/fast-ui-with-qt-4-on-mobile.html</link>
            <description><![CDATA[
For device manufacturers, and those&nbsp;targeting&nbsp;device manufacturers like us in the&nbsp;<a href="http://wiki.merproject.org/">Mer</a>¹&nbsp;and&nbsp;<a href="http://wiki.merproject.org/wiki/Nemo">Nemo Mobile</a>².communities, we need a performant base, and Qt's default configuration on Linux is ..not really that performant. It uses what is known as the 'native' graphics system, which uses X (and XRender) to do a lot of the grunt work. Unfortunately, XRender <a href="http://developers.slashdot.org/story/03/08/16/0034235/hardware-based-xrender-slower-than-software-rendering">isn't exactly what you'd call speedy</a>&nbsp;in many cases, and making loads of round trips to ask X to draw things probably doesn't help either.<br /><br />There's another option in the 'raster' graphics system, which does all rendering client-side in your application using (as you'd expect) Qt's software rasterizer, which is adequate enough for performance on most desktops, but still not quite optimal on desktops: hardware acceleration is the missing goodie.<br /><br />Qt as of 4.8 also includes what's known as the MeeGo graphics system - as the name implies, it's used on the Nokia N9. It uses hardware acceleration (plus some additional EGL extensions) to perform absolute magic and make your pixels (especially QML :)) fly, so if you're working on getting a device together using Qt 4, I'd highly recommend you look at it.<br /><br />Because no blog post is complete without a video, here's one:<br /><div class="separator" style="clear: both; text-align: center;"><object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/9PROBPzM45Q/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/9PROBPzM45Q?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /> <param name="bgcolor" value="#FFFFFF" /> <embed width="320" height="266"  src="http://www.youtube.com/v/9PROBPzM45Q?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash"></embed></object></div><div style="text-align: center;">(comparing the performance of raster and MeeGo graphics systems on a Lenovo S10-3t)</div><br />This sounds great, but there's one caveat. If you're on certain types of graphics hardware (SGX in particular), then you'll probably not to just want to enable the MeeGo graphics system for everything, because you'll end up with a lot of GL contexts allocated, which is not good for two reasons; they're scarce resources, and they take up a large chunk of RAM (something in the order of 5-10mb, depending on your PVR configuration file. I never actually looked).<br /><br />There is good news at hand, though! Qt has *another* graphics system, specifically designed to proxy everything through another system, and allow for runtime switching back to raster. In our case, obviously, we want it to use MeeGo's graphics system by default, but fall back to raster to avoid taking extra resources when not needed.<br /><br />There's also some bad news: it didn't work out of the box with Qt 4.8 RC1.<br /><br />But some more good news: I fixed it (and yes, I upstreamed the patches)!<br /><a href="http://qt.gitorious.org/qt/qt/commit/a7c77bd46ef85bae624e829cb2a02110ec60b318">http://qt.gitorious.org/qt/qt/commit/a7c77bd46ef85bae624e829cb2a02110ec60b318</a><br />and<br /><a href="http://qt.gitorious.org/qt/qt/commit/0ceab866c76e0d9eb17bc1f3d42af06c0033560b">http://qt.gitorious.org/qt/qt/commit/0ceab866c76e0d9eb17bc1f3d42af06c0033560b</a><br />are the two commits you'll want.<br /><br />After that, configure Qt with -graphicssystem runtime, and -runtimegraphicssystem meego (or set QT_DEFAULT_RUNTIME_SYSTEM=meego), and it'll work beautifully, provided your system has the required GL extensions.<br /><br />Alternatively, you can use <a href="http://wiki.merproject.org/">Mer</a>, which already includes these patches right now, and, as of this week, has this beautiful magic enabled by default on the Nokia N900/N950/N9 hardware ports, where this is really needed (and works well). I'm working on getting it enabled by default on other systems that can support it, too, like the Lenovo S10-3t, as time permits.<span class="net_nemein_favourites">7 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=6f606820161311e19a92d9735ff2ea85ea85&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/6f606820161311e19a92d9735ff2ea85ea85/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=6f606820161311e19a92d9735ff2ea85ea85&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/6f606820161311e19a92d9735ff2ea85ea85/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Wed, 23 Nov 2011 19:14:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-6f606820161311e19a92d9735ff2ea85ea85</guid>
        </item>
        <item>
            <title>MeeGo Reconstructed - a plan of action and direction for MeeGo</title>
            <link>http://blog.rburchell.com/2011/10/meego-reconstructed-plan-of-action-and.html</link>
            <description><![CDATA[
A few days ago, I posted MeeGo <a href="http://blog.rburchell.com/2011/09/beauty-of-open-source.html">not being dead</a> until the fat lady sings. Now, the reason why I was being so cagey is out in the open: <a href="http://lists.meego.com/pipermail/meego-dev/2011-October/484215.html">Mer is alive again, and aiming for MeeGo 2.0</a>.<br /><br />This isn't just a continuation of MeeGo, of course - nobody in the MeeGo community proper would argue that there is a need for change, and we've got a few lined up, such as an easier porting story to other devices and architectures (and a much friendlier community atmosphere to such projects), complete meritocracy, and many more.<br /><br />To get one thing out in the open: this is just the core OS, a Linux distribution. There is no UI, and hardware adaptations are seperate from that core OS. It's an extremely slim Linux vehicle for making products out of. What you put on top is entirely your business - it's just a tool.<br /><br />The idea being that you can then take it, drop a hardware reference for a device you love quite a bit, drop a UX in on top (either one you write yourself, or one from the greater community, like the MeeGo handset UX), and you have a product. Plasma Active is another example of what could be dropped in as a UX. The MeeGo handset community edition will most likely be looking to rebase on top of Mer in the near future.<br /><br />In terms of the app stories available: Qt is available on Mer, so for developers seeking to target Qt, look to install Mer derivatives on your devices. This doesn't stop other toolkits or technologies, of course - all are welcome to come and base around Mer.&nbsp;We also have high hopes that we can achieve some base sharing with Tizen, and ideally, easily atain Tizen compliance. It is HTML5, after all.<br /><br />I look forward to running a MeeGo handset UX on top of a Mer core on my n900 soon, and what can be accomplished in the future.<br /><br />If you'd like to talk with us, pop onto #mer on freenode <a href="http://webchat.freenode.net/?channels=Mer">or use the webchat</a>. We also have threads on both <a href="http://forum.meego.com/showthread.php?p=32654">the MeeGo</a> and <a href="http://talk.maemo.org/showthread.php?t=78462">maemo.org forums</a>, should you be a fan of those.<span class="net_nemein_favourites">13 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=140c1642ed9411e0b39379bc858ac608c608&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/140c1642ed9411e0b39379bc858ac608c608/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=140c1642ed9411e0b39379bc858ac608c608&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/140c1642ed9411e0b39379bc858ac608c608/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Mon, 03 Oct 2011 07:17:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-140c1642ed9411e0b39379bc858ac608c608</guid>
        </item>
        <item>
            <title>the beauty of open source...</title>
            <link>http://blog.rburchell.com/2011/09/beauty-of-open-source.html</link>
            <description><![CDATA[
...is that it just doesn't die because somebody says so.<br /><br />A lot of noise has been made about Intel closing up the MeeGo shop and heading for new waters, but predictably, a lot of people aren't very happy with this move, both individuals and companies who have products based around MeeGo.<br /><br />I won't rehash the story any more than that, except to say this: MeeGo, or the ideals of it - an open mobile-oriented platform featuring Qt is still very much valid and needed, and it's not going away. There's <a href="http://lists.meego.com/pipermail/meego-dev/2011-September/484156.html">some discussion already</a>&nbsp;going on on the MeeGo lists about <a href="http://lists.meego.com/pipermail/meego-dev/2011-September/484164.html">how best to continue</a>, already.<br /><br />Watch this space. MeeGo (in some form or other) is not dead, and neither is Qt.<span class="net_nemein_favourites">6 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=deacc9b2eacb11e098be4dc3666881a881a8&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/deacc9b2eacb11e098be4dc3666881a881a8/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=deacc9b2eacb11e098be4dc3666881a881a8&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/deacc9b2eacb11e098be4dc3666881a881a8/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Thu, 29 Sep 2011 18:46:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-deacc9b2eacb11e098be4dc3666881a881a8</guid>
        </item>
        <item>
            <title>on conferences, part #2</title>
            <link>http://blog.rburchell.com/2011/07/on-conferences-part-2.html</link>
            <description><![CDATA[
<a href="http://blog.rburchell.com/2011/07/on-conferences.html">Also late</a>, but at least it's only a few weeks late, I also attended the first Qt Contributors summit, in Berlin in June. Berlin seemed like a fairly typical european city , at least to me, although my experience admittedly isn't that broad yet. I had a few problems with some unfriendly locals making my trip a little more hasslesome than it would perhaps have been otherwise, but all in all, I quite enjoyed it. I don't think my friend <a href="http://blog.dereferenced.net/">John</a> did, though, as he lost his luggage. :)<br /><br />Meeting so many Qt folks was great, the content of the discussions was intriguing, and I'm sure that some solid work has been laid for the future. I know that I got quite a few ideas for my current pet project, poking at the guts of QFileSystemWatcher to make it much more useful, and hopefully less resource intensive (in most situations) by means of not using a thread internally for no good reason. But that's material for another day.<span class="net_nemein_favourites">5 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=7057ba22a40211e094269b6cc080426d426d&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/7057ba22a40211e094269b6cc080426d426d/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=7057ba22a40211e094269b6cc080426d426d&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/7057ba22a40211e094269b6cc080426d426d/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Fri, 01 Jul 2011 16:35:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-7057ba22a40211e094269b6cc080426d426d</guid>
        </item>
        <item>
            <title>on conferences</title>
            <link>http://blog.rburchell.com/2011/07/on-conferences.html</link>
            <description><![CDATA[
Just a short post, as I'm by now fashionably late for this.<br /><br />I attended <a href="http://sf2011.meego.com/">MeeGo Conference</a> in San Francisco in May, my greatest thanks to my excellent employer, Collabora Ltd for sponsoring my trip. It was a pretty intense week for a lot of reasons, one of which being that the week before my visit, I was asked to demonstrate some software I have been working on, a sort of mesh synchronised object store.<br /><br />I showed off a simple contacts application synchronising contacts across three devices, but my real plans for that are a lot more - but that is content for another post, perhaps, another day. I think the show went pretty well, certainly, the reception of some parts of the keynote was a bit mixed.<br /><br />It was also the first time I have visited the US before, and it was certainly a different experience to practically anywhere I have been before. San Francisco was an interesting place in particular to visit, with extreme contrast (people living on the streets with obvious mental issues, while there are villas in the background etc.) and typical cultural differences, some of which I found quite strange, like mandatory tipping. All in all, I think I'd visit again, though.<br /><br />The conference itself was quite excellent, lots of interesting talks going on, and as usual, meeting all the familiar faces - and making new friends - was fantastic. I only wish I had been less frantically busy and jetlagged (or tired after being busy) to make more of the experiences. By the time I had recovered from everything, the conference was almost over. Though thankfully, I spent an extra two days wandering the streets of the city seeing some sights.<span class="net_nemein_favourites">5 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=6f9a4c44a40211e094269b6cc080426d426d&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/6f9a4c44a40211e094269b6cc080426d426d/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=6f9a4c44a40211e094269b6cc080426d426d&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/6f9a4c44a40211e094269b6cc080426d426d/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Fri, 01 Jul 2011 16:29:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-6f9a4c44a40211e094269b6cc080426d426d</guid>
        </item>
        <item>
            <title>on travels and travails</title>
            <link>http://blog.rburchell.com/2011/05/on-travels-and-travails.html</link>
            <description><![CDATA[
I'm not someone who likes to travel. But I honestly don't seem to be able to avoid it, especially these days.<br /><br />I moved from Australia when I was 19, to move to the United Kingdom, both because of my <a href="http://kbremeraunet.blogspot.com/">significant other</a> and because I had been offered work. Thanks to her, I travel to Norway an awful lot, too, seeing as that's where she's from. We're planning on moving there this summer, too.<br /><br />In addition to that, I occasionally travel places for work (I've been to Finland once this year), and various conferences, which is the 'meat' of this post. I'm attending MeeGo Conference in two weeks time, in San Francisco, and I've just booked my tickets for the Qt Contributors summit in Berlin in June.<br /><br />All in all, we're only in the first half of the year, and I've already visited (or planned to visit):<br /><br /><ul><li>Norway</li><li>United Kingdom</li><li>Amsterdam (as a stopover)</li><li>Germany</li><li>United States</li><li>Finland</li></ul><div>So, as someone who dislikes travel, can I please stop doing it now? ☺</div><span class="net_nemein_favourites">1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=1746e58678e511e0a74af513f15a67af67af&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/1746e58678e511e0a74af513f15a67af67af/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>2 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=1746e58678e511e0a74af513f15a67af67af&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/1746e58678e511e0a74af513f15a67af67af/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Sat, 07 May 2011 19:29:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-1746e58678e511e0a74af513f15a67af67af</guid>
        </item>
        <item>
            <title>daily hack: library dependency trees</title>
            <link>http://blog.rburchell.com/2011/02/daily-hack-library-dependency-trees.html</link>
            <description><![CDATA[
<s>Many a time</s>, ok, well, quite frequently at least I've needed to see what is bringing a dependency into an application or a library I'm working on. At the moment, I'm working on removing some useless dependencies for performance and misc reasons, so I'm finding information like that <i>very</i>&nbsp;helpful.<br /><br />So, <a href="https://github.com/rburchell/scripts/blob/master/genlibtree.rb">scripting to the rescue</a>.<br /><br />Use is simple:<br /><br /><pre>burchr@virgin:~/code/scripts(master+)% genlibtree.rb /usr/lib/libQtCore.so<br />Dependency tree for /usr/lib/libQtCore.so<br /> /usr/lib/libQtCore.so<br />* /usr/lib/libpthread.so.0<br />* /usr/lib/libz.so.1<br />* /usr/lib/libdl.so.2<br />* /usr/lib/libgthread-2.0.so.0<br />** /usr/lib/libglib-2.0.so.0<br />** /usr/lib/librt.so.1<br />** /usr/lib/libc.so.6<br />* /usr/lib/libstdc++.so.6<br />** /usr/lib/libm.so.6<br />** /usr/lib/ld-linux.so.2<br />** /usr/lib/libgcc_s.so.1<br /></pre><br />There's a few gotchas in that it won't list repeated dependencies, only searches /usr/lib, etc - but it more or less works. Patches welcome. I hope you find it useful in your quest to remove unneeded dependencies - it is worthwhile running it over your work, at least, to see what bloat you're pulling in.<br /><br />(Much thanks to many folks, but especially Thiago Macieria of Qt and other fame, for giving me a bit of a crash course in some of how shared libraries work under the hood.)<br /><br /><b>edit</b>: I should probably note that this may not necessarily provide a full picture. Shared objects may still be loaded at runtime, and in the case of QtGui, are in the form of things like image plugins and other things. It's still useful, though.<br /><br /><b>edit 2</b>: since I've had a few people point out that it is horrific ruby, I'd just like to note that yes, I am not in fact a perfectionist when it comes to throwaway tools I write in five minutes. Patches welcome. ;)<span class="net_nemein_favourites">5 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=746085543e1d11e095e0cb070d0a04700470&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/746085543e1d11e095e0cb070d0a04700470/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=746085543e1d11e095e0cb070d0a04700470&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/746085543e1d11e095e0cb070d0a04700470/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Mon, 21 Feb 2011 23:45:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-746085543e1d11e095e0cb070d0a04700470</guid>
        </item>
        <item>
            <title>the bomb has hit...</title>
            <link>http://blog.rburchell.com/2011/02/bomb-has-hit.html</link>
            <description><![CDATA[
...now we need to let the dust settle.<br /><br />So, unless you've been living in a cave, you've probably heard about <a href="http://www.engadget.com/2011/02/11/nokia-and-microsoft-enter-strategic-alliance-on-windows-phone-b/">the</a> <a href="http://www.engadget.com/2011/02/11/nokia-notifies-developers-that-qt-is-out-for-windows-phone-devel/">Nokia</a> <a href="http://www.engadget.com/2011/02/11/stephen-elop-there-will-be-substantial-reductions-in-employmen/">news</a> by now. I of course have thoughts and opinions about this, not all of them clear. So I'll just stick with what I think about the future for Qt and MeeGo for now.<br /><br />A lot of people around the Qt development community (some users, some contributors, and some Nokians) have been worrying. There have also been a few people asking about forking, and to them, I would say: not yet. Let the dust settle. Right now, Qt themselves <a href="http://twitter.com/qtbynokia/status/36012807392591872">don't know exactly what the future holds</a>, but I would expect this to be clarified in the near future. Thiago has also <a href="http://lists.qt-labs.org/public/opengov/2011-February/000283.html">clarified that open governance of Qt is still an ongoing project</a>.<br /><br />I don't personally see too much changing here, because despite news of Symbian's perhaps timely death, MeeGo still needs Qt, and I don't think MeeGo is in any imminent danger. Here's why.<br /><br /><ul><li>MeeGo is not just Nokia<br /><br />Intel is also involved in MeeGo, and in addition to that, there are other partners and OEMs.<br /><br />This will not change.<br /></li><li>MeeGo is open<br /><br />This means that anyone who wants to continue the work and contribute, can. There's no barriers, no licensing fees, and no patent worries. This is attractive to hardware manufacturers. Thanks to (trying) to reuse upstream components, it's also a less expensive alternative than Android.<br /><br />This will not change.<br /></li><li>Nokia did, right at the outset of the announcement say, they are continuing work on it<br /><br />Yes, it is true that they also announced that they are reducing their R&amp;D spending on it, but perhaps this isn't such a bad thing. Perhaps lower spending will enable them to spend on what really matters, and focus on getting something out the door.</li></ul><div>That's not that I think today's news is great, or even good - but I'd like to encourage calmness. Let's all have some time to digest the information and think about what exactly it means.</div><div><br /></div><div>I might write more about this once I've had a chance to collect my own opinions a little more. I'm certainly concerned, and interested, but there is no need to panic.</div><span class="net_nemein_favourites">10 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=4b2fa95635f511e08b98a5cd89c990c790c7&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/4b2fa95635f511e08b98a5cd89c990c790c7/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>1 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=4b2fa95635f511e08b98a5cd89c990c790c7&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/4b2fa95635f511e08b98a5cd89c990c790c7/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Fri, 11 Feb 2011 15:24:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-4b2fa95635f511e08b98a5cd89c990c790c7</guid>
        </item>
        <item>
            <title>Some thoughts on GNOME 3</title>
            <link>http://blog.rburchell.com/2011/01/some-thoughts-on-gnome-3.html</link>
            <description><![CDATA[
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">I stumbled across a website talking about&nbsp;<a href="http://gnome3.org/">GNOME 3</a>&nbsp;today, with a few screenshots. It's not really my first exposure to gnome-shell and friends, but it's the first time I sat down and really looked at it, and imagined myself trying to work with it.</div><br />(<b>Disclaimer</b>: I haven't actually tried GNOME 3 as a user yet. Thus, quite a lot of my opinions might be completely off the mark, but I'm not going to be biased by having actually used it.<br /><br /><b>Disclaimer #2</b>:&nbsp;I decided to write down my immediate thoughts, to offer ideas to people working on UI things as much as possible. I like to think that my ideas and points are good ones, but they are, at the end of the day, <b>opinions</b>.&nbsp;Please respect that.<br /><br /><b>Disclaimer #3</b>: I'm syndicating this entry on the basis that UI design is an interesting topic that doesn't get discussed all that often, please don't shoot me for going off-topic a little.)<br /><br />First of all, let's take a look at the 'banner' image.<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://gnome3.org/img/desktop.png"><img border="0" height="266" src="http://gnome3.org/img/desktop.png" width="640" /></a></div><br /><b>Good:</b><br /><ul><li>Visually appealing</li><li>Nice contrasting colours</li><li>Fairly consistent icons styling</li><li>Appealing widget styling</li></ul><div><b>Bad:</b></div><div><ul><li>The 'inactive' window isn't so visible. It needs to be subtle to not grab attention, but at the same time, not difficult to read.<br /></li><li>The icon under 'Image Viewer' is just weird. Why is it zoomed in? It's also, I imagine, going to be really bad for contrast. I would just remove that (and the "Image Viewer" text) from the bar entirely, it seems out of place.<br /></li><li>Why is the wifi icon not monochrome, like the rest? Use colours, or don't. Mixing them just leads to a mess.</li></ul><div>Next up, the overview image:</div></div><div class="separator" style="clear: both; text-align: center;"><a href="http://gnome3.org/img/overview-big.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="358" src="http://gnome3.org/img/overview-big.png" width="640" /></a></div><div><br /><b>Good:</b><br /><br /><ul><li>Pervasive search is a useful feature</li><li>Easy to see what windows are open</li><li>Distinctive use of contrast, very visually appealing</li></ul><div><b>Bad:</b></div><div><ul><li>Why is there a wifi icon up the top, and another (or at least, what looks like one) down the bottom?<br /></li><li>Why does the search box have a caret visible with no text entered? That looks ugly.<br /><br />Websites get this right: guide text when nothing entered, not explicitly focused - but grab text if needed. Clear guide text when text is grabbed, or when focus is explicitly granted, add caret.<br /></li><li>What are the three boxes (two mostly transparent) at the bottom center?<br /><br />I presume this is some kind of pagination thing but that isn't immediately clear.<br /></li><li>Why does the central view have a scrollbar?<br /><br />Typical users don't have that many windows open; while I understand the need to scale to power users (the people presumably developing the environment), I don't think scrolling is a very nice mechanism to do it with.<br /></li><li>The left pane is&nbsp;appalling. So many ellipses.<br /><br />One thing that many modern UI implementations have done away with is text from the&nbsp;task bar, dock, whatever you want to call it, and this is a very good example of <i>why</i>&nbsp;that isn't such a bad idea.<br /><br />It's hard enough fitting the text in on a horizontal panel, but a vertical one has even less horizontal real-estate for horizontal text.<br /></li><li>"Windows" and "Applications" look like they are made to switch state, but it isn't immediately obvious what they do. Will they function like tabs, and change the content of the center panel?<br /></li><li>"Activities" in top left seems to be a state switcher. I'm unsure if the naming is very descriptive of what it does. It could also use some mechanism to stand out more, if it will be used to switch windows a lot as this appears.<br /></li><li>The size of the captions of the windows seems to have a bug. Notice "Spiral_by_firas.jpg" has a lot more room on the right hand side than the left.<br /></li><li>The bottom right hand icon (next to the wifi icon) is really, really hard to figure out just by looking at.</li></ul><div>Next up, instant messaging.</div></div><div class="separator" style="clear: both; text-align: center;"><a href="http://gnome3.org/img/chat-big.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="358" src="http://gnome3.org/img/chat-big.png" width="640" /></a></div><div><br /></div><div><b>Good:</b></div><div><ul><li>I love integrated IM. It is one thing I adore about my <a href="http://maemo.nokia.com/">Nokia N900</a>, apart from <a href="http://qt.nokia.com/">Qt</a>.</li><li>The use of gradients to differentiate sender is intriguing, subtle, and I like it</li><li>The scrollbar is gentle, and beautiful</li></ul><div><b>Bad:</b></div></div><div><ul><li>Why is the icon in Vincent's chat window the same as on the bar at the bottom? Why not use Vincent's avatar, or something.<br /></li><li>Why is there a large chunk of empty space on the left side of the chat dialog? I think it's quite unbalancing.<br /></li><li>The effect of having a zoomed icon (under "File Manager") still looks weird.<br /></li><li>The purpose of the bottom right is now more clear: it's a replacement for the system tray?<br /><br />Okay, I can go with that. Splitting system and applications makes some sense.<br /><br />I'm not sure if this is the best way to position and display it, though, and to me, I think IM almost belongs as part of the system, not in the application 'systray'.<br /></li><li>Lack of timestamps on the IM dialog is a little anoying.<br /><br />One interesting effect to minimise effect on dialog space might be to only timestamp conversations after a reasonable (&gt;1-2 minute) delay with no conversation.</li></ul><div>And last, but by no means least...</div></div><div class="separator" style="clear: both; text-align: center;"><a href="http://gnome3.org/img/search-big.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="358" src="http://gnome3.org/img/search-big.png" width="640" /></a></div><div><br /></div><div><b>Good:</b></div><div><ul><li>Nifty integration of different types of things</li><li>Good demonstration of search</li></ul></div><div><b>Bad:</b></div><div><ul><li>The problem of using text as opposed to icons once again rears its ugly head. This really needs fixing. So many ellipses.<br /></li><li>Searching for other things here might be nice. Open windows? A document I've been working on? My web history? People I talk to?<br /></li><li>How are items sorted? Alphabetically? Not sure that's a great idea.<br /><br />Giving them in some form of contextual usage (most often used, most recently used) would be a lot more useful. At least a favourite/'pin' option like the <a href="http://www.meego.com/">MeeGo</a> netbook UI.<br /></li><li>Why on earth is 'wo' matching 'Chess', etc?<br /></li><li>Showing the number of items: reasonable.<br /><br />Displaying them on the right hand side of the screen, as far away from everything else as possible isn't so reasonable.<br /><br />I'd just not display it at all. It doesn't convey useful information that the user cannot distil by looking at the icons, if they really need to know how many items are in their boxes.</li></ul></div></div><span class="net_nemein_favourites">2 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=ac7d60ea242f11e0b01a35e2272d2c842c84&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/ac7d60ea242f11e0b01a35e2272d2c842c84/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>4 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=ac7d60ea242f11e0b01a35e2272d2c842c84&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/ac7d60ea242f11e0b01a35e2272d2c842c84/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Thu, 20 Jan 2011 00:51:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-ac7d60ea242f11e0b01a35e2272d2c842c84</guid>
        </item>
        <item>
            <title>Qt: users of qmake, rejoice!</title>
            <link>http://blog.rburchell.com/2011/01/qt-users-of-qmake-rejoice.html</link>
            <description><![CDATA[
Those of you who have used qmake to build projects for any length of time on Linux will have probably come across the PKGCONFIG feature by now.<br /><br />For those of you who haven't, here's a quick recap:<br /><blockquote>CONFIG += link_pkgconfig # enable the PKGCONFIG feature<br />PKGCONFIG += glib-2.0 # link against glib-2.0</blockquote>While this looks simple, it has two small problems which aren't all that fun.<br /><br />Firstly, it had what was really quite easily arguably a bug in that it didn't halt the qmake process if a requested package didn't exist. It would happily tell you it didn't exist, and then continue as if nothing had gone wrong, a very annoying problem in large projects:<br /><blockquote><b>$ cat test.pro</b><br />CONFIG += link_pkgconfig<br />PKGCONFIG += foobar<br /><br /><b>$ qmake test.pro:</b><br />Package foobar was not found in the pkg-config search path.<br />Perhaps you should add the directory containing `foobar.pc'<br />to the PKG_CONFIG_PATH environment variable<br />No package 'foobar' found<br /><br /><b>$ echo $?</b><br />0</blockquote><br />Secondly, it wasn't possible to (easily) check for optional dependencies and enable/disable functionality depending on the result of that check.<br /><br />This has now changed! Thanks to Oswald for merging <a href="http://qt.gitorious.org/qt/qt/merge_requests/1022">merge request 1022</a> into Qt, PKGCONFIG will, in the future, stop on error, and (even more fun) - we can now use the shiny new qmake packagesExist() test function to detect whether a library is installed:<br /><blockquote>CONFIG += link_pkgconfig<br /><br />packagesExist(glib-2.0) {<br />&nbsp;&nbsp;&nbsp;&nbsp;DEFINES += HAS_GLIB<br />&nbsp;&nbsp;&nbsp;&nbsp;PKGCONFIG += glib-2.0<br />}<br /><br />// and in the code:<br />#ifdef HAS_GLIB<br />&nbsp;&nbsp;&nbsp;&nbsp;// use glib here<br />#endif</blockquote>Much thanks to <a href="http://blog.barisione.org/">Marco</a> for prompting me to finally try fix this (I've eternally been annoyed by it, but someone else being frustrated by it made me leap into action), as well as to Oswald, Marius and&nbsp;<a href="http://blog.exys.org/">Arvid</a> for their review and comments during writing, and finally to <a href="http://www.murrayc.com/blog/">Murray</a> and <a href="http://taschenorakel.de/mathias/">Mathias</a> for respectively <a href="http://bugreports.qt.nokia.com/browse/QTBUG-11418">reporting</a> and <a href="http://qt.gitorious.org/qt/qt/merge_requests/689">trying to patch</a> the first issue in this post, a fact I only became aware of *after* finishing my patch. Great minds think alike, it seems!<span class="net_nemein_favourites">8 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=38595aa0228311e0af5e7d096f1c058b058b&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/38595aa0228311e0af5e7d096f1c058b058b/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=38595aa0228311e0af5e7d096f1c058b058b&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/38595aa0228311e0af5e7d096f1c058b058b/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Mon, 17 Jan 2011 18:37:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-38595aa0228311e0af5e7d096f1c058b058b</guid>
        </item>
        <item>
            <title>Coding antipatterns: excessive nesting</title>
            <link>http://blog.rburchell.com/2010/11/coding-antipatterns-excessive-nesting.html</link>
            <description><![CDATA[
<span class="Apple-style-span" style="font-size: xx-small;">With apologies to <a href="http://dneary.free.fr/">Dave Neary</a> for stealing his excellent word, 'antipatterns', from his talk at <a href="http://meego.com/">MeeGo</a> Conference.</span><br /><br />This is an opinion piece. Feel free to skip it if you already know what you're doing when writing code.<br /><br />We all have things we dislike in code, sometimes it's indentation, sometimes it's a bit less trivial. One of my current pet hatreds is excessive nesting.<br /><br />For those of you that don't know what I mean, if you see something like this:<br /><pre>void foo(bool bar, bool lol, bool hax, bool meep)<br />{<br />    if (bar) {<br />        if (lol || hax) {<br />            if (meep) {<br />                // do something<br />            }<br />        }<br />    }<br />}<br /></pre><br />Then you're probably a victim of excessive nesting.<br /><br />If you're writing code like this then all I can say is you're probably <i>doing it wrong.</i><br /><br />That above example might be written better like so:<br /><pre>void foo(bool bar, bool lol, bool hax, bool meep)<br />{<br />    if (!bar)<br />        return;<br /><br />    if (!lol &amp;&amp; !hax)<br />        return;<br /><br />    if (!meep)<br />        return;<br /><br />    // do something<br />}<br /></pre><br />Generally speaking, you want your code to be like a river: to flow from one point to another, and branch off gracefully, but still continue flowing nonetheless.<br /><br />In more technical terms, this makes it a lot easier to take appropriate actions at any of those junctions (if, say someone wants logging added for all of those returns in future) and makes your code a lot easier to read.<br /><br />Please stop and think about what you're doing, and refactor if necessary rather than blindly adding another conditional. It might be easier to add another level of nesting, but you'll suffer in the long term. Think about it.<br /><br />As a general rule of thumb, I personally think if you have more than three levels of nesting, you might need to think whether you need a new method, or whether you need to rethink your code's flow.<span class="net_nemein_favourites">12 <a href="http://maemo.org/news/?net_nemein_favourites_execute=fav&net_nemein_favourites_execute_for=8279225afcc211dfa8835bb58712a371a371&net_nemein_favourites_url=https://maemo.org/news/favorites//json/fav/midgard_article/8279225afcc211dfa8835bb58712a371a371/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-favorite.png" style="border: none;" alt="Add to favourites" title="Add to favourites" /></a>0 <a href="http://maemo.org/news/?net_nemein_favourites_execute=bury&net_nemein_favourites_execute_for=8279225afcc211dfa8835bb58712a371a371&net_nemein_favourites_url=https://maemo.org/news/favorites//json/bury/midgard_article/8279225afcc211dfa8835bb58712a371a371/" class="net_nemein_favourites_create"><img src="http://static.maemo.org:81/net.nemein.favourites/not-buried.png" style="border: none;" alt="Bury" title="Bury" /></a></span>]]></description>
            <author>Robin Burchell &lt;viroteck@viroteck.net&gt;</author>
            <category>feed:a93f39245539231538463d349e184dd2</category>
            <pubDate>Tue, 30 Nov 2010 20:04:00 +0000</pubDate>
            <guid>http://maemo.org/midcom-permalink-8279225afcc211dfa8835bb58712a371a371</guid>
        </item>
    </channel>
</rss>
