[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [umbrello] [Bug 327701] code import wizard: does not read folders
From:       Ralf Habacker <ralf.habacker () freenet ! de>
Date:       2013-12-01 0:25:14
Message-ID: bug-327701-17878-kTnlFiSG5P () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=327701

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

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

--- Comment #1 from Ralf Habacker <ralf.habacker@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=" <<
index.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
above.
                QFileInfo childInfo = indexModel->fileInfo(childIndex);
                if (childInfo.isDir() && ui_subdirCheckBox->isChecked()) {
                    treeClicked(childIndex);
                }

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

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

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic