github shundhammer/qdirstat 1.3
New QDirStat Release: 1.3

latest releases: 1.9, 1.8.1, 1.8...
7 years ago

Overview

The QDirStat project proudly presents its latest release: QDirStat 1.3.

This release brings a number of new features as well as some bug fixes:

  • File type statistics window

  • Locate files per directory by file type

  • Display path and size of the current item in the status line while hovering over a treemap tile

  • Optional alternate layout of the main window: Tree view and treemap side by side

  • Improved logging: More secure and rotating logs

  • New document: QDirStat for Headless Servers for server admins

  • New document: The GitHub Workflow for developers

Details

New Features

File Type Statistics Window

People who know WinDirStat inevitably want its File Type view in QDirStat, too. I was really reluctant to do that because I didn't quite see the point; in WinDirStat, it serves mostly as a legend to the treemap colors since they are constantly changing in WinDirStat: The file type that consumes most disk space always gets color #1, the next-most color #2 etc., so it depends which directory you scan what color each file type gets. In QDirStat, the colors are stable; they are predefined and configurable in the MIME Type Categories configuration dialog.

And as most of you probably know, filename extensions have a much stricter meaning in Windows than on Linux/Unix systems; Linux people get very creative when it comes to using dots in filenames. Sometimes those dots delimit a filename's extension (suffix) from its base name, sometimes they are used for entirely different purposes.

But there was one user who was insistent enough to make me reconsider and convinced me with valid use cases for this, and after some experimenting I found an approach that works for QDirStat -- both technically and in terms of usability:

File Type Statistics Window Screenshot

So it's not just a flat list of filename extensions (suffixes); rather, they are sorted into their respective MIME categories (yes, the ones you might know from the Treemap Colors config dialog) where appropriate and Other for everything that doesn't fit into a known category.

See the whole discussion with more screenshots at GitHub issue #45.

Limitations

Since filename extensions (suffixes) don't have as much semantics in Linux/Unix systems as they do in Windows, many files are categorized as "Other". This is a known limitation, but it's a limitation of the whole concept of using suffixes to categorize files by type. And no, checking file headers for magic byte sequences like the "file" command does is not an option here; QDirStat would have to do that for (at least) all the 30,000+ files typically listed under the "Other" category.

So we'll have to live with that limitation. More exactly, everybody will have to live with this; I will not spend hours upon hours anymore explaining that same thing to the umpteenth user demanding this to be more sophisticated.

This will also not become part of the main window (as was suggested before) because it just takes up too much space, and it would clutter the main window too much; See also GibHub issue #52 and GitHub issue #51.

Locating Files by Type

Locating FilesWindow

You can now locate files with a specific filename extension directly:

  • You select a file type (a filename extension) in the "File Type Statistics" window.

  • You click "Locate" or you double-click the item.

  • The "Locate Files" window opens.

  • You click a directory there.

  • In the main window, the branch for that directory opens, and all matching files are selected in the tree view and in the treemap.

  • You can now directly start cleanup actions for those files.

See also GitHub issue #48.

The File Type Statistics and the Locate window are both non-modal, i.e. you can still work in the QDirStat main window while they are open, and they both remember their size and position so you can arrange them on the screen to have everything visible at the same time that you need to see.

Improved Logging

Logging is now more secure, and the logs are automatically rotated, so there is no longer one large log file that keeps growing and growing.

QDirStat now uses its own log directory /tmp/qdirstat-$USER (where $USER is your user name; the numeric user ID is now only used if the user name cannot be obtained). It no longer keeps one single log file growing, but starts a new one each time it is started. 3 old logs are kept; any older ones are deleted.

The permissions for that directory are set up in a pretty restrictive way (0700, i.e. rwx------) when it is created. If it already exists, QDirStat checks the owner and creates a new one with a random name if it is owned by anyone else than the user who started QDirStat.

[sh @ balrog] ~ 68 % ls -ld /tmp/qdirstat-sh
drwx------ 2 sh sh 4096 Feb 24 18:29 /tmp/qdirstat-sh
[sh @ balrog] ~ 69 % ls -l /tmp/qdirstat-sh
total 16
-rw-rw-r-- 1 sh sh 2067 Feb 24 18:29 qdirstat-00.old
-rw-rw-r-- 1 sh sh 2067 Feb 24 18:07 qdirstat-01.old
-rw-rw-r-- 1 sh sh 2067 Feb 24 18:07 qdirstat-02.old
-rw-rw-r-- 1 sh sh 2067 Feb 24 18:29 qdirstat.log

For anybody regularly watching the log file this means they will now have to use tail -F qdirstat.log rather than tail -f since the latter does not realize when the file it watches is renamed and a new one is created under the same name.

Other New Features

  • Implemented GitHub issue #30:

    When hovering over a treemap tile, display the full path and the total size of that element in the status bar. When the hover ends (when the mouse cursor leaves the treemap tile), display the current selection again in the status bar.

  • Optional alternate layout for the main window: You can now switch from the traditional layout of tree view above and treemap below to a side-by-side layout with the tree view on the left and the treemap on the right (Menu Treemap -> Treemap as Side Panel).

    This was contributed by @flurbius.

New Documents

  • QDirStat for Headless Servers

    This document explains step by step how to use the qdirstat-cache-writer Perl script to collect data on your headless (without X server, without X libs) server somewhere in a rack in a data center and display the data on your local workstation machine with QDirStat.

    This information has been out there for at least 10 years, but still people keep asking that on sites like stackexchange.com and superuser.com; I lost count how many times I answered it. And still people come up with the most crazy and arcane command lines to do a shitty job for the same problem when they could also have the good solution.

  • The GitHub Workflow

    This document is a step-by-step instruction guide how to collaborate with projects such as QDirStat (but also other Open Source projects) with GitHub and git with upstream repositories and your personal fork and local working copies; how to set it up, how to fetch and rebase, how to work with pull requests and getting your merged contributions from upstream back to your fork.

    I wrote that when I caught myself explaining that in great detail in a pull request comment; I thought that might be useful for a lot more people out there. So here it is.

Bugfixes

  • Fixed GitHub issue #24:

    During directory reading, subdirectories would get out of sync when opening a tree branch.

    It looks like QDirStat's tree display was a bit too dynamic for the concepts of the underlying Qt classes (QTreeView / QAbstractItemModel): During reading, QDirStat would sort the tree by the number of pending read jobs. That number is constantly changing, so the sort order would also constantly need to change. This is very hard to do properly with the limitations those underlying classes impose; basically it would require a reset of all the data the QTreeView keeps, thus making it forget things like its current scrollbar position or which tree branches were expanded or collapsed. That would make the user interface pretty much unusable.

    So the fix for this is to not sort by read jobs, but by directory names instead since they don't change all the time. The user can still sort by any other column, but that sort is a momentary thing that might become invalid moments later as data (accumulated sizes, number of child items) are updated. Everybody please notice that this is a known limitation and any complaints about that will flatly be rejected. The alternative would be to not allow the user to sort at all during directory reading, and that is certainly a lot less desirable.

  • Fixed GitHub issue #54:

    Crash with cleanup action with "Refresh Policy: Refresh this item" when more than one file item was selected.

  • Fixed crash upon refresh when deleting the toplevel directory via cleanup.

Acknowledgements

This release was supported by my employer SUSE Linux GmbH with the SUSE Hack Week where R&D people are free to spend one whole working week on their favourite Open Source projects. SUSE does this roughly every 6-8 months to support the Open Source movement.

About one third of my time working on this release was covered by the Hack Week.

Don't miss a new qdirstat release

NewReleases is sending notifications on new releases.