Archive for March, 2009

Ark: new cli-interface opening for junior jobs?

March 20, 2009

Greetings fellow KDE coders. Here’s a quick update on what I’ve been working on lately. Apart from the bugfixing (which there have actually beenquite a bit of to get ark stable lately), I’ve been working on a new interface that makes it very easy to implement a new plugin for your favorite archive format. Uptil now, implementing a new format meant handling the whole process execution, and parsing the input etc etc. So I’ve been trying to create a class that generalizes this whole interaction with process-based archive formats: the cli-interface.

With this new class, all that is needed to add support for a new file format is a class with two functions: one that is called for every line of the file listing, parsing the output and emitting file entries that are passed onto Ark, and another one that supplies a QHash containing all kinds of properties describing how to interact with this process (for example, a regex looking for a “file already exists” message, how to respond when this happens, how to tell the process to delete a certain file, etc etc.) An api listing of the properties defined so far can be found here.

The whole point of this class is to make implementing a new class less of a hassle than it was before. Once support for adding and deleting files has also been added, I hope people can either take up any of the file format requests on as junior jobs and implement the format, or even just mail me a list of the various properties for your favorite archive format. Eventually I hope to be able to reach the same number of file formats that Ark for KDE3 supported.

EDIT: just in case someone was curious, here’s an example of the parameter list for the rar-format (so far).

virtual ParameterList parameterList() const
static ParameterList p;
if (p.isEmpty()) {

p[CaptureProgress] = true;
p[ListProgram] = p[ExtractProgram] = p[DeleteProgram] = p[AddProgram] = “rar”;

p[ListArgs] = QStringList() << “v” << “-c-” << “$Archive”;
p[ExtractArgs] = QStringList() << “$PreservePathSwitch” << “$RootNodeSwitch” << “$Archive” << “$Files”;
p[PreservePathSwitch] = QStringList() << “x” << “e”;
p[RootNodeSwitch] = QStringList() << “-ap$Path”;

p[FileExistsExpression] = “^(.+) already exists. Overwrite it”;
p[FileExistsInput] = QStringList()
<< “Y” //overwrite
<< “N” //skip
<< “A” //overwrite all
<< “E” //autoskip
<< “Q” //cancel

return p;


How to disable the guidance-power-manager from autostarting in kubuntu

March 12, 2009

If you’re one of those using kde 4.2 on kubuntu, and getting annoyed at guidance-power-manager starting up all the time while you instead want to use the more integrated powerdevil, here’s the clean solution.

The Autostart spec says that adding Hidden=true to a desktop file says that it should be completely ignored. This is, by the way, also what happens when you enable/disable the checkbox in the system settings autostart manager. The autostart manager, however, does not include the autostart items added from the root /usr/share/autostart folder, so here is how you do it:

In  $XDG_CONFIG_HOME/autostart/  (defaults to ~/.config/autostart ), create the file guidance-power-manager.desktop and add the following two lines:

[Desktop Entry]

In the long run,  I think the better solution would be to have these also pop up in the autostart manager, so that overriding of properties in these files would be more intuitive.