mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix #445
This commit is contained in:
parent
9df5ab02ec
commit
3e8557466c
|
@ -168,10 +168,17 @@ void IdentityForm::onImportClicked()
|
|||
QString path = QFileDialog::getOpenFileName(this, tr("Import profile", "import dialog title"), QDir::homePath(), tr("Tox save file (*.tox)", "import dialog filter"));
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
QFileInfo info(path);
|
||||
|
||||
if (info.suffix() != "tox")
|
||||
{
|
||||
QMessageBox::warning(this, tr("Ignoring non-Tox file", "popup title"), tr("Warning: you've chosen a file that is not a Tox save file; ignoring.", "popup text"));
|
||||
return;
|
||||
}
|
||||
|
||||
QString profile = info.completeBaseName();
|
||||
QString profilePath = QDir(Settings::getSettingsDirPath()).filePath(profile + Core::TOX_EXT);
|
||||
QFile::copy(path, profilePath);
|
||||
bodyUI->profiles->addItem(profile);
|
||||
Core::getInstance()->switchConfiguration(profile);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user