PDA

View Full Version : QFileDialog Crashes with Networked Drive



Rayven
30th January 2008, 22:58
I am using (both as a subclass and directly) a QFileDialog to open files, keeping track of the last directory opened and subsequently setting the last directory each time the dialog opens using setDirectory( ). Everything works fine until after the user goes into a network mounted drive (I am using Windows XP btw). If the user traverses into the directory, everything is fine, but if I try to setDirectory directly to the network drive path, the application crashes with an invalid Heap pointer error. It seems to crash because of the length of time it takes to access the drive. The crash also occurs if I quickly double click on the network drive immediately after the dialog opens. Is there some fix out there for this? Or am I stuck with a crashing application? :crying:

I am using Qt 4.3.0 on Visual Studios 2005.

Thanks!!

jacek
30th January 2008, 23:24
Sounds familiar. Have you checked the task tracker and changelogs for 4.3 releases?

Rayven
31st January 2008, 03:37
It seems that there is a "similar" bug: Task ID 193483 (http://trolltech.com/developer/task-tracker/index_html?method=entry&id=193483) involving hidden directories and Task ID 195192 (http://trolltech.com/developer/task-tracker/index_html?method=entry&id=195192) involving always accessing network drives. Only the one with the hidden directories mentions crashes, but the code example


#include <QtGui/QtGui>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFileDialog d;
// d.setDirectory(QDir::homePath() + "/.kde/share"); // works
d.setDirectory(".foo/bar");
d.exec();
}

is essentially what I am doing in Windows. It says the hidden directories is "fixed" in 4.3.4, does anyone know if this fix works for network mounted drives in Windows as well? I dont want to roll to 4.3.4 at this point in the game unless it will fix this issue. Maybe in combination with the slow network drive access this is a problem, but I find it hard to believe I am the first person to try and setDirectory to a network drive.

jacek
31st January 2008, 12:34
Maybe in combination with the slow network drive access this is a problem, but I find it hard to believe I am the first person to try and setDirectory to a network drive.
Maybe it's some incarnation of this bug: QFileDialog crashes when forward slash // on Windows?

I would create a small application that reproduces the problem and try it on the newest Qt 4.3 version.

Rayven
31st January 2008, 20:57
Maybe it's some incarnation of this bug: QFileDialog crashes when forward slash // on Windows?

I would create a small application that reproduces the problem and try it on the newest Qt 4.3 version.

I will once I get the "ok" to download and install it...dont ask...long story! I will post results once I get them.

jacek
31st January 2008, 21:03
I will once I get the "ok" to download and install it...dont ask...long story! I will post results once I get them.
Then maybe it will be faster to contact the Trolls ask them about the bug?

Rayven
20th February 2008, 02:01
Ok I got Qt 4.3.3 installed and it fixed the issue with the QFileDialog crashing. Glad to see the Trolls are on top of things!! Now if they can just get drive names to appear in the QFileDialog all will be super! :p