[umbrello-devel] [umbrello] [Bug 327701] code import wizard: does not read folders

Ralf Habacker ralf.habacker at freenet.de
Sun Dec 1 00:25:14 UTC 2013


Ralf Habacker <ralf.habacker at freenet.de> changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |CONFIRMED
                 CC|                            |ralf.habacker at freenet.de
     Ever confirmed|0                           |1

--- Comment #1 from Ralf Habacker <ralf.habacker at freenet.de> ---
A debugging session shows that  QFileSystemModel::row() returns zero if the
related dir is not expanded, see below: 

void CodeImpSelectPage::treeClicked(const QModelIndex& index)
    uDebug() << "item at row=" << index.row() << " / column=" <<
    QFileSystemModel* indexModel = (QFileSystemModel*)index.model();
    QFileInfo fileInfo = indexModel->fileInfo(index);
    if (fileInfo.isDir()) {
        // QFileSystemModel returns zero childrens for a collapsed directory
        int rows = indexModel->rowCount(index);
The code import wizard has code to select and count file recursivly with
selected  "include subdirs", but it fails because of the zero childs mentioned
                QFileInfo childInfo = indexModel->fileInfo(childIndex);
                if (childInfo.isDir() && ui_subdirCheckBox->isChecked()) {

I found a partial workaround by expanding the directory before fetching the
    if (fileInfo.isDir()) {
        // QFileSystemModel returns zero childrens for a collapsed directory
        ui_treeView->setExpanded(index, true);
        int rows = indexModel->rowCount(index);

unfortunally a few tests show that this fix is not enough to set this bug as

You are receiving this mail because:
You are the assignee for the bug.

More information about the umbrello-devel mailing list