MW

Tag kde - page 13

Recent Posts

Shell helper: running KDE unit tests (ctests) the easy way (March 26, 2009)

Unit tests are in my eyes a very important part of programming. KDE uses them, KDevelop does - the PHP plugin I help writing does as well. cmake comes with a ctest program which does quite well to give you a quick glance on which test suite you just broke with your new fance feature :)

But I am very dissatisfied with it. Right now I usually do the following

    # lets assume I'm in the source directory
    cb && ctest
    # look for failed test suites
    cd $failed_test_suite_path
    ./$failed_test_suite.shell | less
    # search for FAIL
    cs
    cd $to_whereever_I_was_before

That’s pretty much for just running a test. Especially all that cding and lessing became very tedious. Tedious is good, because I eventually fix it:

introducing kdetest

I wrote a bash function (with autocompletion!!!) called kdetest. Calling it without any parameter will run all test suites and gives a nice report of failed functions at the end. Here’s an example (run via cs php && kdetest).

continue reading...

Building KDevplatform, KDevelop and the PHP plugin from Git (March 06, 2009)

In a follow up to my last post about the PHP plugin for KDevelop and Quanta I want to detail how I setup my build environment. Since I’m only working on KDevelop I only want to compile that. For all other applications, I use the packages my distribution makes available. Below you this is possible.

Note: I use Kubuntu and hence some commands like aptitude and the package names etc. will have to be adapted to your specific distribution. But the general idea should be the same and the packages should be called at least somewhat similar. You could always take a look at the techbase article on compilation of KDE 4 to get a more general HowTo.

It is generally a very good idea to read some articles on the techbase. Especially in the Getting Started section.

getting the dependencies

First, you’ll need to install some packages to satisfy dependencies and to get a working compile chain (think cmake, gcc and stuff). The following command only lists very few packages but they have a huge list of dependencies which your package manager will take into account automatically. Don’t be suprised by a possibly huge list of packages ;-) So some disk space will be required (though I doubt it’s more than 250MB in total).

continue reading...

Building KDevplatform, KDevelop and the PHP plugin from Git (March 06, 2009)

In a follow up to my last post about the PHP plugin for KDevelop and Quanta I want to detail how I setup my build environment. Since I’m only working on KDevelop I only want to compile that. For all other applications, I use the packages my distribution makes available. Below you this is possible.

Note: I use Kubuntu and hence some commands like aptitude and the package names etc. will have to be adapted to your specific distribution. But the general idea should be the same and the packages should be called at least somewhat similar. You could always take a look at the techbase article on compilation of KDE 4 to get a more general HowTo.

It is generally a very good idea to read some articles on the techbase. Especially in the Getting Started section.

getting the dependencies

First, you’ll need to install some packages to satisfy dependencies and to get a working compile chain (think cmake, gcc and stuff). The following command only lists very few packages but they have a huge list of dependencies which your package manager will take into account automatically. Don’t be suprised by a possibly huge list of packages ;-) So some disk space will be required (though I doubt it’s more than 250MB in total).

continue reading...

PHP support for KDevelop 4 (and eventually Quanta+) (March 03, 2009)

Hello Planet KDE!

I want to give you a little insight on the current state of PHP support in KDevelop4:

Me and Nikolaus Sams (nsams) are working diligently on a plugin for PHP support in playground. It’s somewhat stable, i.e. we fix any crashes we stumble upon, but I would call it Alpha state at most. It may eat your babies so to speak. Yet I’m happy to say that at least one user is already using it for production (hi leinir ;-) ).

implemented PHP support

Well, here’s a (not complete) list of features that are already working. Though I have to warn you: no screenshots included ;-) It’s actually all very similar to the C++ screenies you can see on the web.

sematic highlighting

Let’s start with a feature that only very recently was added for PHP - semantic highlighting. Niko moved some language independent parts of the C++ plugin from KDevelop to KDevplatform and now PHP has the same code highlighting features as C++.

continue reading...

Attack of the shell helpers (March 03, 2009)

Everyone who uses the command line regularly has a bunch of (at least for him) useful helper scripts. I now took the liberty to put mine on github for general consumption.

You can find them at: http://github.com/milianw/shell-helpers/tree/master

Some of these might be more useful than others, you decide :) Personally, I can’t live without the following:

apupgrade

a shortcut to update your Debian system with one command - no questions asked `openurl`

opens a given URL in an already opened browser instance or starts a new browser session. Not only one browser is checked. I use it because firefox is slow to start and konqueror is blazingly fast to start. But when firefox is already open I want to use that. `xerr`

shortcut for fast error checking in your Xorg log `clipboard`

makes KDE4 Klipper contents available on the CLI (read _and_ write access!) `debug`

shortcut to start a GDB session: debug APP APP_ARGS is all you have to do. Its basically the same as doing:

continue reading...

Patching Kirocker Music Display for volume control via mouse scrolling (March 28, 2008)

Kirocker is such a great application, it’s a pity the developer Sébastien Laoût has given up on it and is using Windows now!

Usually I only use the kicker applet, the full screen window is nice for parties though. But I didn’t like the way the applet handles scroll events: It seeks (if possible). Since I rarely seek when listening to music I’d rather have the behaviour of the Amarok tray icon: volume control!

I had a look inside the sources and found this part in src/coverdisplay.cpp:

    void CoverDisplay::wheelEvent(QWheelEvent *event)
    {
        if (areControlsShown()) {
          if (event->orientation() == Qt::Vertical) {
             PlayerInformation *infos = PlayerInformation::instance();
              if (infos->canSeek()) {
                 int deltaSeconds = 10 * (event->delta() > 0 ? 1 : -1);
                   m_infos->seekRelative(deltaSeconds);
                }
          } else {
               if (event->delta() > 0)
                  AmarokApi::volumeUp();
             else
                   AmarokApi::volumeDown();
           }
      }
    }

continue reading...

Redaxo Impressions (March 13, 2008)

Today at work I had my first contact with Redaxo, a German contact management system written in PHP and based on MySQL. I’ve heard of it before but never used it, there always seemed to exist better solutions - Drupal for example. But the company I work for already committed itself to Redaxo for this client. So no chance to work with Drupal this time - a pity.

But new experience with other solutions is a great thing. I thought Redaxo had its right to exist: its very small.

Here I don’t mean the filesize or whatever - I mean the size of the admin panel to begin with. It has not that many features. It’s very easy to understand. The average John Doe which is not that websavvy wont be confused by a multitude of choices. And I think I got to know pretty much all of Redaxo in just a few hours — which I can’t say about the steep learning curve of Drupal. And since the website of this client will be small I first thought Redaxo will do quite good.

The deeper I dug into Redaxo the more annoyed I got by its shortcomings though: There are modules and addons with which you can do pretty much all you need. But not one module I used was ready out of the box. Always I had to do adjustments. Drupal does much better here. And what you can do with overloading in Drupal is millions of light years ahead of what Redaxo is able to do. Oh and the developers of Redaxo really should take a look at Drupals documentation! After some searching on the official website I stuck to grep -R "function XXX" . for Api references…

continue reading...

open URL a in variable browser (July 22, 2007)

I was recently annoyed by how URLs were started in KDE: I used an antiquated firefox command to run an URL in a new tab (firefox-remote "OpenURL(%u, new-window)") which does the job quite well. But: If you have no running firefox instance this command will simply do nothing. Right - nothing! You’ll have to start firefox manually and click once again on the link (in konversation, kopete or wherever).

But the newer firefox versions (I don’t know when this feature was added) support the firefox -newtab %u command. This is all you need if you only use firefox. Configure KDE via kcontrol to use this command as a standard webbrowser.

This was still not enough for me though, as I regularly switch to konqueror or opera, because firefox is sometimes to slow for a quick browse. This is what I came up with:

open_url script

what it does

Via open_url it is possible to use one of the currently open browsers. If you for example have a running konqueror instance but no firefox it is more likely (in my point of view) to open a new URL in konqueror instead of launching a new firefox instance (which would take a long time).

continue reading...

open URL a in variable browser (July 22, 2007)

I was recently annoyed by how URLs were started in KDE: I used an antiquated firefox command to run an URL in a new tab (firefox-remote "OpenURL(%u, new-window)") which does the job quite well. But: If you have no running firefox instance this command will simply do nothing. Right - nothing! You’ll have to start firefox manually and click once again on the link (in konversation, kopete or wherever).

But the newer firefox versions (I don’t know when this feature was added) support the firefox -newtab %u command. This is all you need if you only use firefox. Configure KDE via kcontrol to use this command as a standard webbrowser.

This was still not enough for me though, as I regularly switch to konqueror or opera, because firefox is sometimes to slow for a quick browse. This is what I came up with:

open_url script

what it does

Via open_url it is possible to use one of the currently open browsers. If you for example have a running konqueror instance but no firefox it is more likely (in my point of view) to open a new URL in konqueror instead of launching a new firefox instance (which would take a long time).

continue reading...

KDE and Windows Shares (February 25, 2007)

If you have successfully installed Samba it should be no problem to access your Linux shares from Windows. What I couldn’t do until recently was accessing the Windows shares from Linux.

Today I came across LiSa , the Lan Information Server. It was not installed by default on my Kubuntu Edgy machine but a simple sudo aptitude install lisa was sufficient. Lisa is embedded into kcontrol, launch it and you’ll find two new tabs in Internet & Network -> Network Browser. Go to the lisa-daemon tab and launch the guided setup tour. The descriptions should be pretty much straight forward. Accept the changes, fill in your sudo password to save the lisa config file and restart lisa with sudo /etc/init.d/lisa restart.

Now launch Konqueror or Dolphin and head over to lan:/. You should see all machines in your workgroup.

continue reading...