Results 1 to 3 of 3

Thread: Qt4: QDir::entryList bug in windows when listing network files?

  1. #1
    Join Date
    Apr 2006
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Red face Qt4: QDir::entryList bug in windows when listing network files?

    Hi,

    I'm trying to iterate on files in a directory using QDir::entryList using Qt4.1.2 in Windows. I can find files located on a hdd drive (like C:\ ), but I get nothing when listing files from a network-drive (like //host/name).

    Am I doing something wrong? It worked fine earlier in Qt3! Is this a Qt4.1.2 bug?

    Yvon

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4: QDir::entryList bug in windows when listing network files?

    Searching the TaskTracker gives nothing: http://www.trolltech.com/developer/t...ugs=on&sugs=on . From task 94416 it sounds as if UNC really works, but the description uses the "\\xxx\xxx\xxx"-notation instead of "//xxx/xxx/xxx". Could that be it?

  3. #3
    Join Date
    Apr 2006
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4: QDir::entryList bug in windows when listing network files?

    Hi,

    No that's not it because I don't specify the path myself, I only use the currentPath.

    Here is a little example of the problem. It tries to find all the xml files from the directory where it is started from. It works fine on hard disk drive like C: , but not from networked drives.

    int main(int argc, char** argv)
    {
    QApplication a(argc, argv);

    QDir dir;
    QStringList xml_filters;
    xml_filters << "*.xml";

    QStringList xml_files = dir.entryList(xml_filters, QDir::Files | QDir::Readable);

    if (xml_files.count() == 0) {
    QMessageBox::critical(0, "Error", "Cannot find any xml file",
    QMessageBox::Ok, QMessageBox::NoButton);
    return 1;
    }
    else {
    QMessageBox::information(0, "Ok", QString("Found %1 xml files.").arg(xml_files.count()),
    QMessageBox::Ok, QMessageBox::NoButton);
    }
    return 0;
    }

    Is this a bug? Am I missing something?

    Yvon
    Attached Files Attached Files

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.