patrik08
12th June 2006, 22:01
If I copy a resource file to a tmp cache dir... so...
MoveAndCopy(QString::fromUtf8(":/images/images/master.sql"),STATIC_TMP_SQL_DUMP);
after this file is readonly to user....
How i set write and remove from application? and edit from user?
bool Gui_Front::MoveAndCopy(QString file, QString destfile)
{
QFile Image(file);
if (db->is_file(destfile)) {
db->qt_unlink(destfile);
}
if (!Image.copy(destfile)) {
/*QMessageBox::warning( this,tr( "File Error!" ) , tr("Unable to copy a file to.. %1").arg( destfile ));*/
return false;
} else {
QFile Image2(destfile);
Image2.setPermissions(QFile::WriteOther); /* all 0777 */
return true;
}
}
MoveAndCopy(QString::fromUtf8(":/images/images/master.sql"),STATIC_TMP_SQL_DUMP);
after this file is readonly to user....
How i set write and remove from application? and edit from user?
bool Gui_Front::MoveAndCopy(QString file, QString destfile)
{
QFile Image(file);
if (db->is_file(destfile)) {
db->qt_unlink(destfile);
}
if (!Image.copy(destfile)) {
/*QMessageBox::warning( this,tr( "File Error!" ) , tr("Unable to copy a file to.. %1").arg( destfile ));*/
return false;
} else {
QFile Image2(destfile);
Image2.setPermissions(QFile::WriteOther); /* all 0777 */
return true;
}
}