the iterator doesnt mater, the filename doesnt seem to matter.. and as far as the error try looking at this line again....
{
QMessageBox::information(this, tr
("Unable to open file"),
file.
errorString());
return;
}
QFile file(filename);
if (!file.open(QIODevice::ReadOnly))
{
QMessageBox::information(this, tr("Unable to open file"), file.errorString());
return;
}
To copy to clipboard, switch view to plain text mode
when the app starts it calls load() to grab the list file for the filename and location. This file loads fine and I have no problems with it, its not until I try to load the other files to back them up that the problem shows up. The vector holds the filename and location. it->fullpath is the full filepath and filename, this can be swapped out for the actual path and not from the vector and it gives the same result... The vector is fine.. there is nothing wrong with the vector or iterator so those should be ignored.
If you reread the code you will see the file.errorstring.. that is where the message comes from. While reading the code look at ALL the QMessagebox statements. Each time something gets started a messagebox should pop up and tell me whats about to happen. In the code posted in this thread the if has a return, so the remaining code should be ignored. The entire function was posted to see how it is supposed to work.
Added after 5 minutes:

Originally Posted by
SixDegrees
I have no idea what 'it' is, but assuming it's an iterator I'll note that it is never changed between these two statements, so you are potentially attempting to read and write to the same file. Maybe it->fullPath() and it->getFile() are sufficiently different for this to work, but it certainly isn't clear without knowing more about what 'it' points to.
Yes it is the same file. fullpath is the location of the original while getfile only used the filename itself so the file gets saved in the applications directory. Currently I am using C:\test as the file locationd and C:\test2 as the application directory. So the app will load file xxx.whatever from C:\test and save it to C:\test2 Eventually I will compress the files and save all of them in something like xxx.bak but for now I need the initial file.open to work...
Bookmarks