K4DirStat (KDE Directory Statistics) is a small utility program that sums up disk usage for directory trees, very much like the Unix 'du' command. It displays the disk space used up by a directory tree, both numerically and graphically (copied from the Debian package description).
I am experiencing k4dirstat crashes on every startup, with k4dirstat installed from official Debian packages. This is the backtrace
After very painful debugging, it became clear that QStandardItemModel::itemFromIndex was being called with a QModelIndex argument that didn't originated in a QStandardItemModel at all, but rather, in a KDirModel from KIO. The reason for this was that KSortFiterProxyModel from kdirtreeview.cpp got mixed up on linking with KSortFilterProxyModel from KIO.
To fix this, I moved all definitions fro kdirtreeview.cpp to the namespace KDirStat. This was probably already intended, but it hasn't been executed thoroughly. With this change, k4dirstat runs fine.
Note, that using namespace XXX is a code smell and you problably don't want it in any code. I suggest enclosing your definitions in namespace XXX { ... } should be done in the other source files as well, although I only had problems with this one.
After you've fixed this, please release the corrected version to Debian.
Hello,
I am experiencing k4dirstat crashes on every startup, with k4dirstat installed from official Debian packages. This is the backtrace
After very painful debugging, it became clear that
QStandardItemModel::itemFromIndex
was being called with aQModelIndex
argument that didn't originated in aQStandardItemModel
at all, but rather, in aKDirModel
from KIO. The reason for this was thatKSortFiterProxyModel
fromkdirtreeview.cpp
got mixed up on linking withKSortFilterProxyModel
from KIO.To fix this, I moved all definitions fro
kdirtreeview.cpp
to the namespaceKDirStat
. This was probably already intended, but it hasn't been executed thoroughly. With this change, k4dirstat runs fine.Note, that
using namespace XXX
is a code smell and you problably don't want it in any code. I suggest enclosing your definitions innamespace XXX { ... }
should be done in the other source files as well, although I only had problems with this one.After you've fixed this, please release the corrected version to Debian.