Code: Select all
roland@roland-amd-desktop:~/Projects/cs_hello_debug$ ls -al /home/roland/Diamond_Backups/
total 8
drwxrwxr-x 2 roland roland 4096 Sep 6 16:34 .
drwxr-xr-x 42 roland roland 4096 Sep 6 10:14 ..
roland@roland-amd-desktop:~/Projects/cs_hello_debug$ ./cs_hello
Hello World!
copy /home/roland/Projects/diamond/src/dialog_colors.cpp to /home/roland/Diamond_Backups/'!home!roland!Projects!diamond!src!dialog_colors.cpp.b00000'
QFSFileEngine::open() No file name specified
QFSFileEngine::open() No file name specified
failed to copy
roland@roland-amd-desktop:~/Projects/cs_hello_debug$ ls -al /home/roland/Diamond_Backups/
total 8
drwxrwxr-x 2 roland roland 4096 Sep 6 16:34 .
drwxr-xr-x 42 roland roland 4096 Sep 6 10:14 ..
roland@roland-amd-desktop:~/Projects/cs_hello_debug$ cp /home/roland/Projects/diamond/src/dialog_colors.cpp /home/roland/Diamond_Backups/'!home!roland!Projects!diamond!src!dialog_colors.cpp.b00000'
roland@roland-amd-desktop:~/Projects/cs_hello_debug$ ls -al /home/roland/Diamond_Backups/
total 40
drwxrwxr-x 2 roland roland 4096 Sep 6 16:36 .
drwxr-xr-x 42 roland roland 4096 Sep 6 10:14 ..
-rw-r--r-- 1 roland roland 31443 Sep 6 16:36 '!home!roland!Projects!diamond!src!dialog_colors.cpp.b00000'
roland@roland-amd-desktop:~/Projects/cs_hello_debug$
Code: Select all
void Task::run()
{
// Do processing here
qDebug() << "Hello World!";
QDir backupDir("/home/roland/Diamond_Backups/");
QString srcName("/home/roland/Projects/diamond/src/dialog_colors.cpp");
QString bName("\'!home!roland!Projects!diamond!src!dialog_colors.cpp.b00000\'");
QString nName = backupDir.absoluteFilePath(bName);
qDebug() << "copy " << srcName << " to " << nName;
if (!QFile::copy(srcName, nName))
{
qDebug() << "failed to copy";
}
else
{
qDebug() << "copy returned no error";
}
emit finished();
}
QFSFileEngine::open() No file name specified
twice.
I can't just rename() [which does work] because the backup location may not be on the same device as the source file. I really don't want to have one system() call for each OS. According to the documentation this should work.
Tips? Work-arounds? Advice?
Backups are the last major thing on the list for this round of changes to Diamond. Was hoping to put this to bed before end of holiday weekend.
Thanks,