FolderView Fixes Part I


Warning: Trying to access array offset on value of type null in /var/www/netrunner-mag.com/wp-content/plugins/really-simple-facebook-twitter-share-buttons/really-simple-facebook-twitter-share-buttons.php on line 308

Hello fellow KDE devs and users!

At the end of January 2012, I started working on the FolderView Plasma applet. The FolderView applet allows you to place a folder on the desktop for quick access when used as an applet, but most importantly, it allows you to use the desktop the conventional Windows way – that is, as an icon store. The former is pretty useful when working on a certain task to have the necessary files handy, whereas the latter is absolutely crucial for those distros that want to embrace a more traditional desktop paradigm, for example, in order to aid Windows users in their migration to the Linux OS, or to create a KDE3 feel. Either way, it is really important to have this Plasma component as polished as possible – it is the first thing the user see on login, and if they come from Windows, FW may well be the first Linux desktop component they see in their entire life.

Now you may be surprised here, but it has a lot of bugs!

Well, used to.

I’m glad to tell you that more than half of the FW bugs have been fixed by now. What remains is mostly containment and multiscreen bugs, and those will have been fixed for 4.8.1.

Here goes the list of the fixes with comments where appropriate:

  • #268641 Automatically enable / disable selection marker – if kde is double-click, no need for the “+” sign
  • (no bug #) If KDE is set to double-click, shrink the icons only once on double-clicking them
  • (no bug #) On double-clicking an icon with KDE configured to d-click globally, repaint the icon after shrink (icons used to stick) – debugged by me, final patch and commit by aseigo
  • #291140 Some config related problems where the FW would not apply settings on the fly when used as a containment – aseigo had broken that, I made him fix the thing back ;)
  • (no bug #) Account for the SVG margins in IconView::itemSize() – when the text width is used to calculate the item frame width, this is noticeable
  • (no bug #) kdelibs/plasma/widgets/iconwidget – same as (2), but for the Icon widget
  • #247144 Fix the 1px offset in air/widgets/viewitem.svgz – now that was one hell of a bug!I spent 1.5 days looking for the source of the issue. I quickly narrowed it down to the wrong size of the “normal-right-border” element in the viewitem SVG (the frame you see on the FolderView icons), which was 9px wide as opposed to all the other border elements (8px). Now what? Marco Martin found out that the PNG of the shadow for that element was incorrect and 9px wide instead of the required 8px. And I was digging through the source of the Plasma::FrameSvg class. All I needed was in fact to get an svg expert  to have a close look at the SVG. Thank you a lot Marco!
  • #211002 Make the popup view inherit the parent IconView sorting & filtering settings
  • similar to #211002 Make the popup view inherit the parent IconView selection marker settings
  • #290694 (Part I) Correctly handle Plasma theme change – thanks goes to Marco again, he noticed there was a slot name collision when I pointed him to the relevant slot in the FolderView class, though he still insists it’s my bugfix ;). When the applet is on the desktop, the outer frame will be immediately repainted on Plasma theme change, just as it should be
  • (no bug #) Apply icon flow settings in configChanged() – icon flow settings will be applied when you click “Apply”, as they should be
  • (no bug #) Read icon size settings in FolderView::init() – don’t lose the custom icon size settings between plasma restarts
  • #261207 Apply custom text line count setting in the list view – this, used with a small icon size and a slim plasma theme, can save quite some vertical space in the listview
  • #290694 (Part II) Relayout the items using the updated grid and item size – on Plasma theme change, the SVG margins change, and so do the positions of the items in the icon and list views
  • Fix folderview sorting – fix sorting by size and type, introduce a three-level fallback for sorting by name, sort folders by child items count when sorting by size. Thanks goes to Peter Penz for the three-level file name sorting fallback code!
  • (no bug #) Enable  on-hover item animation only for a certain level of graphics effects (Low CPU == effect off)This introduced a new KGlobalSettings category, SETTINGS_STYLE, which is currently only used when the graphic effects level changes – you’re welcome to notify about style configuration changes using this category.
  • #244557 Fix icon scaling when the folderview is in panel – behave similar to the Trash applet when in panel

This is of course not all what needs to be done, but it at least makes FolderView usable. Bug #268641 needs further fixing as I occasionally learnt yesterday – with some icon sizes, the marker occludes the icon partially (at 22px) or even completely (at 16px). There are some visual glitches remaining, and of course a lot of features to implement.

Now for the timeframes. The fixes listed above will all be available in 4.8.1, along with some yet to be done bugfixes. There is one 4.9 feature currently, the ability to sort icons ascending or descending when FolderView is used as a containment.

I also need to tell you about one important bit of polish that depends on a fix in Qt. Namely, if you drag some icons around in FolderView, you will see some  ugly artifacts. I’ve created a review request in Gerrit, the Qt code review system, but the Trolls refuse to accept the patch until I do a similar fix for Qt5. Now drag and drop in Qt5 is broken, as in, the drag pixmap is not displayed at all! And the Trolls want me to fix all the DnD code in Qt5, after which they will gladly accept my Qt4 patch. Well, as they say, you fight fire with fire! I’ve talked to Jonathan Riddell of KUbuntu fame, and he promised to post the patch to the kde-packagers mailing list. This means that the patch will be applied by the distros on the next Qt release. Take it, trolls! :) (no offence here – but I need to get the applet fixed, Qt5 is a mirage at the moment and will remain a mirage until two or more major KDE releases)

What I’ve done is more than half of the job. The other part will have been done before the 4.8.1 tagging. I encourage you to check out and build kde-baseapps master and have a look at the improved folderview!

Best regards,
Ignat Semenov