1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge branch 'pr721'

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-11-11 23:13:08 +01:00
commit 57bcda7cd9
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -167,7 +167,24 @@ void IdentityForm::onExportClicked()
QDir::home().filePath(current),
tr("Tox save file (*.tox)", "save dialog filter"));
if (!path.isEmpty())
QFile::copy(QDir(Settings::getSettingsDirPath()).filePath(current), path);
{
bool success;
if (QFile::exists(path))
{
// should we popup a warning?
// if (!checkContinue(tr("Overwriting a file"), tr("Are you sure you want to overwrite %1?").arg(path)))
// return;
success = QFile::remove(path);
if (!success)
{
QMessageBox::warning(this, tr("Failed to remove file"), tr("The file you chose to overwrite could not be removed first."));
return;
}
}
success = QFile::copy(QDir(Settings::getSettingsDirPath()).filePath(current), path);
if (!success)
QMessageBox::warning(this, tr("Failed to copy file"), tr("The file you chose could not be written to."));
}
}
void IdentityForm::onDeleteClicked()