user-avatar
Today is Tuesday
May 22, 2012

Category: KDE

March 5, 2009

Support for ‘long double’ in Qt tests.

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , 3 Comments

Qt supports most types for most compilers…… but long double.  I do not know why. When asking on #qt (IRC), people say that nobody seems to care. Well… I do. long double have some use in scientific software at least. If you ever need to use long double in QTest, you will need to add this somewhere in some of your headers used by unit tests.

This is tested with Qt 4.4.2 and 4.5, on linux(gcc 4.3.3) and windows (mingw/gcc 3.4.5).

Once you have this code, you can do things like QCOMPARE() between long double and so on.

namespace QTest {

    template <>

    inline char *toString<long double>(const long double &t)

    {

        char *msg = new char[128];

        ::snprintf(msg, 128, "%.123Lg", t);

        return msg;

    }

    static inline bool qFuzzyCompare(long double p1, long double p2)

    {

        return (qAbs(p1 - p2) <= 0.00000000000001 * qMin(qAbs(p1), qAbs(p2)));

    }

    template <>

    inline bool Q_TESTLIB_EXPORT qCompare<long double>(long double const &t1,

            long double const &t2, const char *actual, const char *expected, const char *file, int line)

    {

        return qFuzzyCompare(t1, t2)

            ? compare_helper(true, "COMPARE()", file, line)

            : compare_helper(false, "Compared long doubles are not the same (fuzzy compare)",

                    toString(t1), toString(t2), actual, expected, file, line);

    }

}

February 12, 2009

First release candidate for Opale

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , Leave a comment

One of my pet projects (A simple bank account manager focused on graphs and planning) is about to reach 1.0. This first release candidate has been tested on several Linux systems and Windows. It can compile against KDE, but Qt is enough. (no, i have not yet tested with KDE/Windows…).

So far, the only big problem with this RC is that translations are broken. This will be fixed in -rc2, to be released soon.

By the way, I could use some help with:

  • getting a logo
  • translations
  • writing an ebuild for gentoo
  • compilation/tests on MacOS X
  • compilation using msvc on Windows

If you feel like you could help me, please contact me.

November 14, 2008

Mercurial bulk update

by Thomas Capricelli — Categories: Admin, Gentoo, KDE — Tags: 6 Comments

I don’t know about you, but I have on a lot of different places a directory called ‘hg’ with lot of different mercurial clones inside. Whether on the home of my several computers for my own projects, or inside other directories for external projects, and so on.

Now, remember one important aspect of distributed source control : your clone is actually both a repository and a working directory. This is why you usually (git and others do the same) have two different commands : one to synchronize the  repository (pull) and one to update the working directory (update).

Updating comes with a risk : you can have conflicts. This is why I never update a svn repository without thinking first (do I have local modifications ?). But pulling is a lot less problematic. And, especially on my laptop, I often want to ‘sync them all’ as soon as I have some internet connection. Until now i had a script syncall with the path of all (svn,unison and) mercurial repositories hardcoded. This does not scale, and I now need that in at least 5 different places. I dont feel like maintaining such scripts.

And now comes the magic alias that made my day. I’m usually lame at shell scripting, so I’m sure there are better ways. But it works, now, on my computer. And this is so useful.

alias hgbulk '\ls */.hg -d | cut -d\/ -f1 | xargs -i bash -c  "(cd {}; hg pull )"'

(yes, I use tcsh, but i’ve tested that in bash too. Don’t ask why I use tcsh.)

November 12, 2008

Full blown kde-aware opale version

by Thomas Capricelli — Categories: KDE — Tags: , 1 Comment
KDE version of opale

KDE version of opale

Since the release of opale-0.9, I have mostly worked on improving the (optional) KDE integration. And now if KDE is available, opale will use things like : KMainWindow, KApplication (session management..), XML GUI, KFileDialog and specific menu entries (Switch application language, configure shortcuts/toolbars, KDE-aware recent files submenu,…).

While I was there, the Qt-only version now also has a ‘recent files’ dialog popping-up at the start if no file is given on the command line (my personal top-missing feature).

Now, some people noticed that I want to port Opale to the Mac. I have an old ibook lying here, but MacOS has died and I need to re-install it before trying qt/Mac (that I have never tested yet).

As an answer to your blog entry, Orville (I guess that’s your first name, right?):

  • The kde version is now really finished, please try if you want.
  • I guess there’s no menu on the screenshot because Mac still has those on the top of the screen, right ?
  • I would be delighted if you could provide testing on the mac. You can find me on freenode as orzel.
  • I’m also interested with hints about the interface, I’m not afraid of you being mean.
  • What’s the problem with my help menu ? Everything’s fine here. Use the ‘report a bug’ entry in the very same menu!
  • Don’t be scared by a photo :-)

Opale homepage

Project page

November 12, 2008

KDE standard aboutbox is kind of close-minded

by Thomas Capricelli — Categories: KDE5 Comments

Back in the days of kde3, while writing a KDE application, I encountered quite a big problem while trying to use the aboutbox stuff from KDE (that means kaboutdata and the now called kaboutapplicationdialog). I talked to some guys on #kde-devel, and I have been told that, yes, this will be changed for KDE4.

Now that I (mostly) use and (rarely) develop for KDE4, I have been hit again by the same problem. Before reporting to the bugtracking system of KDE, I would like to know what people think. Most importantly, do people outside of KDE proper do actually use this ?

Description of the problem

There is a field called  bugsEmailAddress in the constructor of KAboutData, which is used by KAboutApplicationDialog to decide what to display. Using this field, something like

"Please report bugs to <a href=\"mailto:%1\">%2</a>.\n"

will be used to display the link in the about box. What does it mean ? First, it means that it is not possible to have a link to a web bug tracker. You need to provide a mail, and nothing else. Seeing how common are web bugtrackers, this is rather strange.

Though… what about KDE’s own applications ? The default value for bugsEmailAddress is “submit@bugs.kde.org”. So far, it makes perfectly sense. But if you open any KDE application, you’ll see a link to the web page. Why is it so ? look in kdelibs/kdeui/dialogs/kaboutapplicationdialog.cpp :

if ( .. || aboutData->bugAddress() == "submit@bugs.kde.org")
     text = "Please use http://bugs.kde.org..."

I can only guess why this was done this way : probably for some historical reason and then nobody bothered about fixing it. I’m sure they have not done something as ugly on purpose.

So as a conclusion

  • KDE uses a link to their web tracker.
  • You are not allowed to such a luxury and you need to provide an email address.

Toward a fix ?

The obvious fix is to store an URL or linkAddress in KAboutData and use that in the About dialog. Adding a clear sentence to the documentation : “if you want to use an email address, just add mailto: in front of the argument”.

Now, instead of ranting, my first reaction was to go and fix that (I swear, trust me). Even few years ago. But.. then I’m confronted to a problem : probably some people use this, and I would break quite a lot of about boxes, and everybody will hate me. Not something I want of course.. I tried to talk about this on IRC, but nobody is really interested in this. And finally, i did not dare changing this, and wend the old way : I wrote my own about box.

Turn around

Today, I have found a way to turn around the problem : You can use the method setCustomAuthorText() and then, KDE will not do anything and let you decide about what to display in this tab. Hourray :-)

November 11, 2008

Opale ported to qt4 and kde4

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , , , 4 Comments

Opale was an application written using koffice that I use to handle my personal accounts. Long ago I have dropped support for koffice (mainly because of the crappy/undocumented/buggy chart API) and since then opale was a kde-based application.

One year ago, i have started porting it to kde4, and, meanwhile, made it a Qt4 application. Using configuration, you can now have either a qt4 or a kde4 application. Actually, I have to say the kde4 stuff is not thoroughly tested. Anyway, the qt4 port is done and I now have Opale working under windows. Not that I really care, but that can be useful for others.

It was not until few weeks ago that kde4 was good enough for me (copyright me) so I can actually use this version of opale (yes, I know about running kde4 application under kde3, but no, thanks). Now that this version is tested enough, i release it as 0.9.

The roadmap for 0.10 is

  • macintosh version
  • well-tested kde4 application
  • template editing/removing

Opale homepage

Opale project on freehackers’laboratories.

November 2, 2008

Activities gallery

by Thomas Capricelli — Categories: Admin, Django, Gentoo, KDE, Linux kernel — Tags: , , , , , , , 3 Comments

While developing my recently released activity mercurial extension (and here too), I did a lot of tests on some quite famous/big projects. I’ve found the results to be quite interesting and decided to put up this gallery. Are you interested in the history of commits for kde, linux, django, portage(software), and others?

warning : this is just for fun (copyright Linus Torvalds), I’m perfectly aware that the number of commits is a very bad indicator for development.

The gallery : http://labs.freehackers.org/projects/hgactivity/wiki/Gallery

October 31, 2008

Activity extension for mercurial

by Thomas Capricelli — Categories: Admin, Gentoo, KDE — Tags: , , 6 Comments

example : activity of the mercurial "crew" repository

 

example : activity of the mercurial crew repository

This is something i’ve really been missing for long in mercurial : a way to display the activity of a repository. No, ‘hg churn’ is not the right answer, I want an idea of when the peaks of development happened. So I have written this small extension. It is based on matplotlib, so you’ll need that to be installed. It is tested with mercurial 1.0.2 and the current development version of mercurial (so-called mercurial ‘crew’ repository). I’m a big fan of this kind of information, and I’m sure to use this extension regularly, so you can count on it being maintained.

To use is, grab a copy :

hg clone http://sources.freehackers.org/hgactivity/

and add a line in your ~/.hgrc under [extensions] with the full path to the activity.py (example on my computer, please adapt to your actual path:)

activity=/home/orzel/hg/hgactivity/activity.py

To use it, just do from inside a repository:

hg activity

The first example shows the activity for the mercurial.crew repository, and here’s another one representing the activity of the the ‘kdebase’ module from kde (I have a local mercurial mirror):

Activity of kdebase in the last month

Activity of kdebase during the last month

Homepage of the project: http://labs.freehackers.org/wiki/hgactivity

September 26, 2008

KDE 4.1.2 tagged, gentoo land frozen

by Thomas Capricelli — Categories: Gentoo, KDE26 Comments

I’m not a gentoo fan. Mainly because I don’t like the idea of being a ‘fan’. Being a fan in the Free Software world usually means being an extremist and i hate extremism.

I nonetheless use almost exclusively Gentoo on all computers, laptops, servers and other divx boxes I have or maintain. That means a lot of them and it makes my Debian friends laugh. Who cares ? I use Gentoo and Free Software because I find this convenient, and I like the ideas behind them.

Yet I don’t share the optimism of people who think that gentoo is growing. On July 29th, KDE 4.1, the first almost-usable KDE version since the 3.5 branch, has been released, and since then, guess what have happened in the gentoo-KDE land ? Nothing. By nothing I mean first that not a single ebuild, even masked, even hard masked, has reached the official portage tree, and secondly, that despite the huge KDE user base in Gentoo, not a single official statement has been done concerning this issue. Because, believe me or not, there is an actual issue. Nothing was said on the main Gentoo page, almost nothing on gentoo planet (only one post focused on whether KDE should install in a different place or not). In the gentoo land, everybody speaks about everything but KDE in gentoo. Has the meaning of ‘g’ in gentoo recently changed ?

When you try to know a little bit more about this, it’s getting worse. Rumors are that developers have fought each others and the KDE team is just no more. It’s a new KDE team that is here for whatever reason (to which, by the way, I send my very best support, for the development of new ebuilds, for being put under such light/pressure, and for being sent in this lion’s cage that seems to be gentoo devs). I don’t know anything about this, but it’s not the first time I hear about huge tensions between gentoo developers, and this worries me a lot.

I don’t want politics, I want developers, I want Free Software developers. If I wanted politics, I would have gone for Debian, which, by the way, have had packages for KDE 4.1 and 4.1.1 for long.

Growing is not something easy to handle. It seems to me that KDE has managed to do this very well : a lot of work has been done in the few last years to ‘scale up’ and I think they managed to do this hugely needed step. Gentoo still has to improve a lot in this area. As a user, my expectations are the same as what you can read everywhere : transparency, transparency and transparency.

I love gentoo, i can understand a lot of things, I can wait, I can deal with human resource shortage, I could even help. I’m used with all of that because that is so common in Free Software and that is part of the deal. But I can’t bear darkness and closeness.

I will not conclude by threatening to leave for another distribution. I’m most than happy with gentoo as a distribution and I will keep on using it as long as it is possible. I have a KDE checkout anyway on my main computer. If things are going worse though, I’m not sure I will dare trying to work on the ebuilds.

I’m ready to ignore the “If you’re not happy with gentoo leave it” type of comments.

September 13, 2008

Konqueror web shortcut for gentoo packages

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , , 9 Comments

You’re going to think that I’m some kind of web shortcut maniac, but I really think I’m not.

I’m using http://packages.larrythecow.org a lot, and only today did I think about creating a konqueror web shortcut to get there faster. I’ve called it ‘gt’ (for gentoo, yes, i’m that lazy), and the magic url thinguy is

http://packages.larrythecow.org/?v=search&s=\{@}

Now I can type “gt:kdebase-meta” in konquy or alt-f2 and feel ashamed in front of my debian friends whom I’ve been laughing at so much in the past because debian is slow to catch up with kde releases.

Today, several weeks after KDE 4.1 has been released, and 10 days after KDE 4.1.1 has been released, there is still no official ebuilds for the kde 4.1 branch. I know there are overlays, there are some heated bug-reports, blogs and even some unofficial status page about it, but still, kde 4.1 is not in gentoo, and it makes me feel really sad.

Yes, I know, it’s free software and I can do it myself. And then?

© 2012 Thomas Capricelli All rights reserved - Wallow theme v0.46.5 by ([][]) TwoBeers - Powered by WordPress - Have fun!