for( i = cnt; i = 0; i--)
QDir::rmdir( dirListing
[i
]);
for( i = cnt; i = 0; i--)
QDir::rmdir( dirListing[i]);
To copy to clipboard, switch view to plain text mode
One problem I see here is that you're setting i = 0 in the for loop's conditional test - you want it to read i >= 0. That may be causing your error as after i is set to 0, you then decrement it, so the next go round its trying to access dirListing[-1], besides being stuck in an infinite loop.
EDIT: After looking through the documentation, I see what you're saying, there is not static function QDir::rmdir(); Well, if you don't want to rethink your algorithm, I found a function called cdUp() in QDir, but I've never used it so I can't speak for it. Seems like this would work though:
for(i = cnt; i >= 0; i--)
{
dir.cdUp();
dir.rmdir(dirListing[i]);
}
for(i = cnt; i >= 0; i--)
{
QDir dir(dirListing[i]);
dir.cdUp();
dir.rmdir(dirListing[i]);
}
To copy to clipboard, switch view to plain text mode
Bookmarks