Introducing: Accretion! A file browser in QML for the Desktop.

by markg85

Hi,

I’ve been trying very hard to get this in a shape where i can really show off screenshots. And before the next pim sprint (which starts in just 2 days!). What you’re about to read is from a project that is highly work in progress! It is by no means anywhere near alpha quality. Also the design is not final by any means. The stuff you see in screenshots below is the intended direction, but even here there is a lot still missing.

So far for the little disclaimer.

Accretion, the name

Accretion has a meaning. In astrophysics the meaning is:

The first and most common is the growth of a massive object by gravitationally attracting more matter, typically gaseous matter in an accretion disk.[1] Accretion disks are common around smaller stars or stellar remnants in a close binary or black holes in the centers of spiral galaxies. Some dynamics in the disk are necessary to allow orbiting gas to lose angular momentum and fall onto the central massive object. Occasionally, this can result in stellar surface fusion. (See: Bondi accretion)

The second process is somewhat analogous to the one in atmospheric science. In the nebular theory, accretion refers to the collision and sticking of cooled microscopic dust and ice particles electrostatically, in protoplanetary disks and gas giant protoplanet systems, eventually leading to planetesimals which gravitationally accrete more small particles and other planetesimals.[citation needed]

I picked this name because it seemed very fitting for this project. The rationale behind it is that this project really consists of a lot of different components/classes across languages. Each individual component on it’s own is not doing much, but when you bring them all together – with some glue – you can end up with some really nice applications. That’s why i took this name. It combines KIO, my custom KIO classes (will blog about that soon), exposure of the before in QML, creating custom QML components. Even some javascript though i try to keep that at a bare minimum where possible.

Previously the same project was going be the name: “Porpoise”. That was a small hint at Dolphin since a “Porpose” is a different kind of “Dolphin”. However, that name didn’t really sound right. It looks a lot like “Purpose” and just didn’t work out.

Screenshots!

First is the current default view. The red like row is what you see when you hover any part of a row. This is obviously way different then a default icon view mode that you’re used to. There are a couple of reasons for that which you will find below in the “View plugins” section.

folders_with_hover

This is where things get – technically – very complicated. What you see below is the same view as above only grouped by mime type. Technically each individual group is a QSortFilterProxyModel and that is what made it very complicated. To give you an QML idea, this is a ListView inside a ListView. For more details you’d have to look at the code. Anyway, because every group is a model on it’s own it adds the quite big benefit that you can – if you want – create completely different layouts per group view. So for instance one part can be a detailed list view like you see in the screenshots. Other groups can very well be an icon view or something completely different. You have complete freedom here. If it’s possible in QML then a group can make use of it. Or any view for that matter.

grouping_per_group_order

As i just said, each group can have it’s own layout. But you can also sort each individual group the way you want. I actually implemented this feature because i missed it in Dolphin. What you see below is one group (the one with 6 items) is not sorted. The group below with 10 items is sorted in ascending order based on filesize. But you can click any column name and sort by name or time as well. That is another advantage of using QSortFilterProxyModel, it comes with sorting capabilities for nearly all possible data types that you could use. One note though for natural name sorting. Qt 5.2 includes QCollation which allows for fairly simple natural sorting. That is sadly not taken into account in QSortFilterProxyModel so i have to add that in a subclass. Right now it’s not in yet.

grouping_random_suborder

That’s it for the screenshots.

Model/View abstraction

Some people do “loose” model/view abstraction. As in they might do pre-calculated stuff in the model and expose that to the view to use it directly. I don’t. I try to make everything as abstract as possible and any data that is going to be used in a view will be made available in it’s most rawest form. So for example QDateTime objects and filesizes. Both are exposed to QML as they are. The filesize in bytes. QML – or rather a javascript function – will then convert that human unfriendly size to something humans like more. You can see the result of that specific part in the screenshots above. The same holds true for date stamps although i didn’t made them “human friendly” yet. Remember, this is all heavily work in process!

I try to follow the above principle for every single thing i make. If it doesn’t have a direct need in a class/component it shouldn’t be there.

View plugins

By “View plugins” i mean simple files or packages that can be used as a view like you see in the screenshots above. The model and view are completely separated and that allows for custom views to be written very easily. All views have the same access to model data as the default views has. You can do whatever your fantasy (and QML) allows you to. The view you see in the screenshot is inspired by these awesome mockups. I quite frankly find that one of the only awesome flat ui designs that exist. All current popular operating systems (mobile and desktop) that have a flat UI design are – imho – extremely ugly. The Accretion file browser is – initially – going to have a design inspired by those mockups. However, even that is done in a very easily adjustable way. All style related settings are defined in one big javascript file.

Relation to Dolphin?

Dolphin is actually what inspired me to make this. The way i see it, QML is the (long term) future for the Linux desktop or certainly for KDE when it comes to graphical user interfaces. Dolphin is currently too big to rewrite or to adjust to make a QML frontend. The fact that dolphin has it’s own model/view implementation also makes it near impossible to port dolphin to QML at all.

Before anyone starts to get any ideas for this as a dolphin replacement. That won’t happen or at least not anytime soon. There is a ton of stuff to add to this before it even becomes usable.

Future development

I started this project about a year ago. Not the GUI side, but the C++ side. It’s far from done and needs a lot of time to get where i consider it “working just fine”. Right now it even lacks basic functionality like:

  1. Right mouse button
  2. Settings (even though the icon is there)
  3. Click to open files. Folders work.
  4. Bookmarks
  5. tons more

Besides the obvious i also want to implement some more exotic features that should make it very easy for others to develop plugins for it. Perhaps even to build a community around it.

One of those more exotic features is this. Views themselves are plugins, but i also want to have “View entry” plugins. By that i mean plugins that can modify how an entry looks based on it’s data. This should allow for plugins like svn and git. But it should also be flexible enough to – for instance – transform Accretion to an image viewer for image files with the right plugins installed. How that should be done in a technical abstract way, i don’t know.

Intended platforms

Right now: Linux with KDE is the intended target. In the longer run it should work on Mac and Windows as well. Don’t pin me on it though.

Source

If you want to try this out for yourself then you need to follow a few requirements.

  1. Qt 5.2
  2. KF5
  3. KDirchainRebuild

Once you have those 3, you should get the Accretion source from here. I am not going to support or help you getting this up and running. Much of the above changes on a daily basis anyway.

That’s it for my lengthy post. I hope you like this project, i certainly do!

Next blog: KDirchainRebuild.

Cheers,
Mark