Ark: new cli-interface opening for junior jobs?

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 bugs.kde.org 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;
}


%d bloggers like this: