Search This Blog

Monday, June 10, 2013

My work in basysKom

As you probably already know I work for basysKom, a German company that also employ other KDE developers and strongly supports Plasma Active. You can even download Plasma Active live/installation images from basysKom's servers.

I work for basysKom since late 2011 and one of my first assignments was to contribute to Plasma Active, but some of my work for basysKom reached Plasma Desktop as well.

Another big contribution to KDE came last year when basysKom sponsored me and other developers to rewrite Ark (KDE's archive program). All the changes we did are in basyskom branch in Ark's repository. I will talk about the changes we implemented in another post.

Now you must be asking why those changes are not in Ark 4.10 already and even not merged into (the yet to release) Ark 4.11. Well, at least they are listed  in kdeutils 4.11's schedule. The fact is that reviewing all 284 commits in basyskom branch takes a lot of time. Ark's maintainer also asked us to edit several commits, which slowed down the reviewing process even further. Only today I have finished rewriting the commits according to Ark maintainer's comments (or most of the comments).

The new branch now contains 181 commits and:


  1. Comply with kdelibs's code style;
  2. Use the correct data structure names (QVariantList instead of QList);
  3. Do not generate compiler warnings;
  4. Use kDebug() instead of qDebug() and kDebug(1601), where 1601 is Ark's debug area;
  5. Removed unneeded empty lines;
  6. Most of the "undesired" massive text reformatting were removed as requested by Ark's maintainer;
  7. Several commits were squashed (merged) when it makes sense, then the total number of commits is now way smaller;
  8. Another reason for the smaller number of commits is that I removed of the features we (from basysKom) implemented: the "fix file name encoding" feature, which is an heuristic to guess the file name encoding and convert it to UTF-8. The heuristic works for German language only so I decided to remove it and rework it later to make it support other languages, if possible (guessing file name encoding is very error prone);
  9. Another reason for the smaller number of commits is that I removed/edited the commits that added/updated German translation files. This was a requirement by the time we implemented those changes. However, that was not according to KDE's policy so I removed them.
Unfortunately, I have not been able to do all the changes asked me to do, such as rewriting all the commit's messages in git-format. I am constantly rebasing the branch so I cannot edit the commit's messages or I would lose the only thing I can use to compare the original commit with the new commit in the rebased  branch. Another change I have not done yet is removing the copy of KNewPasswordDialog and KIO::RenameDialog classes that resides in kerfuffle/kdelibs. We needed to implement some UI changes in those dialogs, copying them were the fastestes approach. Now we need to discuss which of the changes in them can go to frameworks5.

By the way, the rebased branch is in one of my scratch repositories now. I must say that editing all those commits in the past months has been an extremely boring task :-/, it resumes to 0 features added, 1 feature removed and a lot of text editing, no developer likes that. Here I must give basysKom a big "thank you" for sponsoring part of that boring task and for sponsoring all the work we did in Ark last year.

I am not confident that the commits will make it to Ark 4.11. I have done part and now I need help to test the end result. If you want to test the new Ark you will need to clone the rebased branch and compile it yourself. The compilation process is:

  • git clone git://anongit.kde.org/clones/ark/lvsouza/ark2
  • cd ark2
  • git checkout ark2
  • mkdir ../ark2_build
  • cmake -DCMAKE_INSTALL_PREFIX= ../ark2
  • make
  • make install
The new Ark mainwindow looks like this:


When you open a file (or archive in Ark's jargon) it will look like this:


Yes, 7z support is one of the new features we implemented in Ark :-) We also implemented (read-only) support for split archives (AKA multi volume archives). All the new features are listed in the CHANGES file in the rebased branch. You can also see the list of all contributors to Ark in app/main.cpp file, including the four basysKom developers (me included) that worked in this project.

Stay tuned for more post about the new Ark.

13 comments:

Laszlo Papp said...

I wonder about the business use case, if there is any at all, behind this project, but you might not be able to tell that.

At any rate, looks nice.

lynxlynx said...

Awesome work, ark is a real cludge to use sometimes. I'm very happy to see this in the changelog:
- Disable ark build in content viewer and use global applications instead

The encoding detection is another thing I'll be waiting for patiently. Sure, you can always just unpack things via the console, but that's not something one would advertise.

Anonymous said...

Excellent work, I really look forward to all the nice changes you did to Ark.
Thank you very much!

Greetings, Pete

Anonymous said...

1. I don't like the removal of the built-in content viewer. I have the impression that there seems little interest in maintaining the availability and usage of one of the ancient (pre-4.0) pillars of KDE: KParts (the other one being KIO which luckily still survives undamaged): the KParts don't work in Konqueror's WebKit view (they do in the KHTML view), there is no support for them in Dolphin and now kparts are removed from Ark too. This is especially disturbing when previewing archives in Konqueror. The archives are correctly loaded in the Ark KPart but when I click any file in the archive, then it is opened in an external viewer. The reason why I use Konqueror is because I need a tabbed viewer for any file format. I agree that the item "View in external viewer" should be added to the menus.

2. When I try to open an archive that is not located locally (in my "Open Recent" menu I have e.g. http://cdn.debian.net/debian/pool/main/k/ktikz/ktikz_0.10.orig.tar.gz) then I get a confusing dialog entitled "Create Archive" in which the "Archive name" says:
/debian/pool/main/k/ktikz/ktikz_0.10.orig.tar.gz
What should I do with that path that obviously doesn't exist on my computer. There is an option "Delete original files after succesful testing": what does it do, does it remove the archive from the online location (as this is the original file IMHO)? I dared not try to push the "OK" button, so I don't know what happens next. Obviously this breaks the second ancient pillar of KDE (KIO).

3. In the "Extract archive" dialog (note the different capitalization with the "Create Archive" title that I saw before) the options "Overwrite handling" and "Preserve paths" should be in the general tab as these are not advanced: I want to be sure that nothing gets overwritten unexpectedly. In the "General" tab it is confusing to read that the path "will be created if it does not exist", but there is no text field in which the non-existing path can be entered (after 10sec of looking for it, you realize that you can click on the right side of the breadcrumb). It is better to have a text field below the browsing area (as in the "Browse Directory" dialog in kdelibs). The old "Extract" dialog was much better.

4. Where is the "Create new archive" action?

5. On startup I am confused to see the listing of my home directory with the "Add to archive" action enabled. I dared not try to push it in order to see what happens if I add a file to the "archive" that my home directory obviously is not. The listing also shows files which are not archives. When I click a PDF file in the listing, it is opened in Okular and the "View" and "Delete" actions become enabled (I dared not try the "Delete" button). Ark should not be a file browser, I have Dolphin for that. The old empty view was much better because there was no possibility for being confused and because there is still the easily discoverable "Open..." action (which should also be in the toolbar).

6. I would also like to finally see the return of the search text field in Ark which allows to filter the listing of the archive (this was a very helpful feature in KDE3's Ark).

Basically, I like almost everything in the old Ark better; the only improvements which the new Ark provides are the fact that you can open the archive's files in a separate viewer (this should be an additional action and not replace the preview action) and the fact that there is a context menu when right-clicking a file in the archive's listing. Sorry for being so harsh, but this is my true experience with the new Ark.

Lamarque said...

@Laszlo Papp, obviously basysKom did not sponsor Ark's rewrite just because they are cool with KDE hehe. A German customer, that uses KDE in several of its computers, paid for the rewrite. By the time we were implementing them we were under non-disclosure agreement though.

@xh, unfortunately encoding detection is very error prone. kdelibs already comes with a class implementing it but it requires at least 256 bytes of data to return a reliably guess and file names are usually less than 30 bytes. The returned guess was wrong several times because of that, so we implemented a new heuristic using some particular aspects of the characters used in German language. It worked better but also not 100% reliable.

@Pete, thanks. Now it is up to Ark's maintainer to review the rebased branch and merge it.

Anonymous said...

I wish when the archive was "Open" in ark the icon on the left would change to having the box open (aka the top y of the zipper was open and showing the "contents" of the zip, just some file icons etc)

yep, totally a graphical thing and not a coding thing.

kinda a 1 cent comment not even a 2 cents kinda comment :)

scalpel4k said...

Hi Lamarque,

first of all I think the rewrite was really worth it.
One thing that doesn't work in my installment though, is the "Preserve Paths" option. It is greyed out in the Advanced tab.
The other thing that I didn't find was "Extract All", so currently I have to select everything that I wanna get extracted.

thx Michi

Jos Poortvliet said...

Lamarque: awesome work. Real happy that Ark got some love and I really hope this makes it in 4.11 ;-)

Hugs,
J

Unknown said...

Is there any official places where to report issues? Ark2 won't open anything for me and judging by the confusing gdb reports I assume it's some sort of threading issue. When I try to load any kind of archive, Ark2 would crash with "*** Error in `/home/madcat/Devel/Ark2/ark2/binary/bin/ark': corrupted double-linked list: 0x0000000001103630 ***
", it some cases it just gets stuck on __lll_lock_wait_private().

Anonymous said...

Is there any news on when these changes are going to ship with KDE? I was hoping to see them in 4.12, but it seems otherwise.

Anonymous said...

Ark already supports 7z via libarchive backend. I don't think it's reasonable to implement own backend for it (if this is what is done in this branch).

MM

Anonymous said...

(libarchive, despite what's written on their web page, actually supports both reading and writing 7z - per https://code.google.com/p/libarchive/issues/detail?id=41)

MM

Lamarque said...

Ark's maintainer is still reviewing the code. It is not going to enter Ark until he finishes that.

By that time I worked on that implementation I did not know libarchive supported 7z. Anyway, we also wanted to use 7z command line tool to manage .zip and multi-volume archives as well. I am not sure if libarchive supports both of them.