diff -r 6ced87c58cea -r f3465a5f0dc4 file.cpp --- a/file.cpp Thu Jun 14 10:21:40 2007 +0000 +++ b/file.cpp Thu Jun 14 10:21:41 2007 +0000 @@ -126,6 +126,51 @@ qWarning ("removeDir("+d.path()+") failed!"); } +void copyDir (QDir src, QDir dst) +{ + system ("cp -r "+src.path()+"/* "+dst.path()); + + /* + ErrorCode err=success; + + Process *cpProc=new Process (); + QStringList args; + cpProc->setWorkingDirectory (src.path()); + args <<"-r"; + args <start ("cp",args); + if (!cpProc->waitForStarted() ) + { + // zip could not be started + QMessageBox::critical( 0, QObject::tr( "Critical Error" ), + QObject::tr("Couldn't start zip to compress data.")); + err=aborted; + } else + { + // zip could be started + cpProc->waitForFinished(); + if (cpProc->exitStatus()!=QProcess::NormalExit ) + { + QMessageBox::critical( 0, QObject::tr( "Critical Error" ), + QObject::tr("cp didn't exit normally")+ + "\n" + cpProc->getErrout()); + err=aborted; + } else + { + if (cpProc->exitCode()>0) + { + QMessageBox::critical( 0, QObject::tr( "Critical Error" ), + QString("cp exit code: %1").arg(cpProc->exitCode() )+ + "\n" + cpProc->getErrout() ); + err=aborted; + } + } + } // cp could be started + */ +} + void makeSubDirs (const QString &s) { QDir d(s);