Archive for the ‘kde’ Category

Previous weekend in Debian KDE land

Tuesday, August 10th, 2010

3 interesting small things happened in the weekend.

Due to the hard work of mostly Florian Reinhard and George Kiagiadakis, Bluedevil is now available. Bluedevil is a new and improved bluetooth handling thing targetted the KDE Workspaces.

The Debconf people have uploaded the Qt Debconf frontend that I blogged about a while ago, so now it should be available.

Last, but not least, applications now has more accurate data for if they are online or not, by using the ntrack library. This was especially problematic for people having some interfaces defined in /etc/network/interfaces, and other interfaces managed by NetworkManager.
This feature will be committed to upstream KDE whenever Will gets around to do it.

As a added bonus, KDEBindings in Debian has seen a release critical bugfix (python plugins, e.g. plasma widgets, related), and the brokenness of Konsole (libkpty) on the kFreeBSD-arches have been tracked down to a libc issue and a patch has been made.

All of this is expected to be part of next stable Debian release, codename Squeeze.

Transport data easily to mobile phones

Thursday, July 29th, 2010

I guess we all have the challenge of how to easily get a link or a phone number or some other strings of data from the computer to the mobile phone.

With the help of mobile barcodes and klipper, this is now possible in KDE Trunk to do easily. Place some data in clipboard, click on klipper and select Show barcode.

show barcode option in klipper menu

Mobile barcode in klipper

To read it, open the barcode app in your phone (mBarcode on n900 for example) and point it to your monitor.

debconf kde frontend

Saturday, July 24th, 2010

I wrote another blog post a while back talking about Debconf kde frontend.

I spend some days at akademy looking at it, and then refined it a bit when I got home.
Results:

  • perlqt is in unstable and soon in testing.
  • debconf kde frontend works.
  • object oriented perl is weird

debconf kde frontend in action.

hopefully, the debconf people will accept it soon.

The Debian-KDE specific things II

Tuesday, May 18th, 2010

I wrote a bit ago a blog post about what debian kde is missing of distribution specific things

Some of the more important things includes:

  • A Qt based debian installer
  • Tools to manage 3rd party modules and firmware and such
  • Debconf frontend that fits in
  • Report bug interface

Installer
I don’t think it is the most important thing. Wether or not the graphical installer is using gtk or qt is not that important. I would love to see it happen, but it is not something I feel like putting my time in. Others are most welcome.
It will give the advantage of giving the installer the possibility to use the framebuffer directly.

Modules and firmwares and such
Someone is saying that ubuntu has something called jockey that does this exact thing, with a KDE and a Gnome frontend. Unfortunately, it is python, so it is something I will really avoid. I’m hoping that me mentioning it here will make someone into python&debian pick it up and bring it to debian.
It is apparantly some nice magic around discover-data.

Debconf frontend that fits
A lot of work has been put into proper perl-qt bindings and they will hopefully be ready for kde4.5, which is unfortunately a series too late for Squeeze :/. But when that has happened, we just need some perl guy to adapt the old frontend to debconf.

Reportbug interface
There is already a tool called reportbug-ng that is a qt interface to reporting bugs.

All in all, it looks like we are quite far already. We just need to get the last bits put together. Someone: pickup jockey.

And note that the comment field isn’t a place to report bugs. They will be removed.

The Debian-KDE specific things ?

Tuesday, May 11th, 2010

So. I was wondering, which nice distro specific tools do exist in debian/gnome or in $other/kde that debian/kde is missing?

We have kalternatives for managing alternatives, we have a update notifier frontend in progress and after google summer of code, hopefully a package management frontend, aptitude-qt. (Made by Piotr).

But what other distribution specific tools are we missing for Debian-KDE ?

Debian Qt/KDE Maintainers bugs

Wednesday, April 7th, 2010

A while ago, something happened to the bugs reported against KDE in debian. It is best illustrated like this:

eckhart slope

I’ve chosen to name it Eckhart slope. Thanks.

For full graphs, see http://alioth.debian.org/~pusling-guest/pkg-kde-buggraphs/

A Qt frontend to aptitude as a GSoC project?

Sunday, April 4th, 2010

I’m currently trying to convince (and hopefully succeeding) Daniel Burrows to co-mentor a Qt frontend for aptitude.

But for that a student is needed. http://wiki.debian.org/SummerOfCode2010/Aptitude-Qt for first draft of project.

http://wiki.debian.org/gsoc for information about GSoC and debian
and #debian-soc on irc.debian.org if you prefer that communication media.

for my irc fans

Tuesday, March 2nd, 2010

-!- You’re now known as svuorela

Toying with maemo and rotating apps

Monday, February 1st, 2010

I have been playing a bit around with Maemo and writing Qt apps for n900. I ended up needing a rotation aware QMainWindow a couple of times, so I ended up abstracting it away in my own MaemoMainWindow, which I just wanted to share. It has enough ifdefs to also build against ‘normal’ Qt, outside Maemo.

Have fun. Available under any license.

maemomainwindow.h:

#ifndef MAEMOMAINWINDOW_H
#define MAEMOMAINWINDOW_H                                          

#include <QMainWindow>

class MaemoMainWindow : public QMainWindow
{
  Q_OBJECT
  public:
    MaemoMainWindow (QWidget* parent = 0, Qt::WindowFlags flags = 0);
    virtual ~MaemoMainWindow();
  protected:
    virtual bool event (QEvent* event);
  Q_SIGNALS:
    void orientationChanged(Qt::Orientation newOrientation);
  private Q_SLOTS:
    void orientationChangedSlot(const QString& newOrientation);
  private:
    Qt::Orientation m_orientation;
};                                                                   

#endif // MAEMOMAINWINDOW_H

maemomainwindow.cpp:

#include "maemomainwindow.h"                                         

#ifdef Q_WS_MAEMO_5
#include <mce/mode-names.h>
#include <mce/dbus-names.h>
#endif                     

#ifdef Q_WS_MAEMO_5
#include <QDBusConnection>
#include <QDBusMessage>
#include <QEvent>
#endif

MaemoMainWindow::MaemoMainWindow (QWidget* parent, Qt::WindowFlags flags) : QMainWindow (parent, flags) {
#ifdef Q_WS_MAEMO_5
  QDBusConnection::systemBus().connect(QString(), MCE_SIGNAL_PATH, MCE_SIGNAL_IF,
                                       MCE_DEVICE_ORIENTATION_SIG,
                                       this,
                                       SLOT(orientationChangedSlot(QString)));
#endif
}

MaemoMainWindow::~MaemoMainWindow() {

}

void MaemoMainWindow::orientationChangedSlot (const QString& newOrientation) {
#ifdef Q_WS_MAEMO_5
  if (newOrientation == QLatin1String(MCE_ORIENTATION_PORTRAIT)) {
    setAttribute(Qt::WA_Maemo5ForcePortraitOrientation, true);
    emit orientationChanged(Qt::Vertical);
  } else {
    setAttribute(Qt::WA_Maemo5ForceLandscapeOrientation, true);
    emit orientationChanged(Qt::Horizontal);
  }
#else
Q_UNUSED(newOrientation);
#endif

}

bool MaemoMainWindow::event (QEvent* event) {
#ifdef Q_WS_MAEMO_5
  switch (event->type()) {
    case QEvent::WindowActivate:
      QDBusConnection::systemBus().call(
           QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH,
                                          MCE_REQUEST_IF,
                                          MCE_ACCELEROMETER_ENABLE_REQ));
      break;
    case QEvent::WindowDeactivate:
      QDBusConnection::systemBus().call(
           QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH,
                                          MCE_REQUEST_IF,
                                          MCE_ACCELEROMETER_DISABLE_REQ));
      break;
    default:
      break;
  }
#endif
  return QMainWindow::event (event);
}

Update: reformatted code. Thought wordpres and <code> was smart. Thanks Ken.

Subclassing QMutex considered harmful

Monday, November 23rd, 2009

If you are using QMutex, you are probably writing threaded applications, and thus want to use helgrind (part of valgrind).

helgrind has some support for threading and mutexes in Qt, but not fully.

If you try to run a app using a QMutex subclass in helgrind, it fails with


<appname>: hg_intercepts.c:2124: _vgwZU_libQtCoreZdsoZa__ZN6QMutexC2ENS_13RecursionModeE: Assertion `0' failed.

Basically, it is the handler for the _ZN6QMutexC2ENS_13RecursionModeE symbol that is implemented as assert(0);. The demangled symbol is QMutex::QMutex(QMutex::RecursionMode), which looks very much like the constructor for QMutex:

$ objdump -T /usr/lib/libQtCore.so | grep _ZN6QMutexC
00068840 g DF .text 0000005b Base _ZN6QMutexC2ENS_13RecursionModeE
000687e0 g DF .text 0000005b Base _ZN6QMutexC1ENS_13RecursionModeE

which both demangles into the same QMutex::QMutex(QMutex::RecursionMode)

The important difference is the C1 vs C2 in the mangled symbol name. The C1 symbol is used for creating QMutex objects (complete object constructor), wheras the C2 symbol is used for creating subclasses of QMutex (base object constructor).

And the C2 handler in helgrind is as said implemented as assert(0);.
So until helgrind is fixed here, please be careful to not subclass QMutex. (the destructor handler for subclasses is also implemented the same way)

QMutex has no virtual base class, so even in case of subclassing, I think the helgrind handlers should be implemented the same way in the base object constructor as in the base complete object constructor.

I guess I should file a bug against helgrind.

A test app if anyone is curious:

#include <QtCore>

class mymutex : public QMutex {
public:
mymutex(QMutex::RecursionMode=QMutex::NonRecursive);
};
mymutex::mymutex(QMutex::RecursionMode mode) : QMutex(mode) {
}

int main(int, char**) {
mymutex m;
QMutexLocker lock(&m);
return 0;
}

Update 1: Bug filed.
Update 2: Better understanding of virtual base classes. Thanks Thiago