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

refactor(profileimporter): Removed extra spaces

This commit is contained in:
Diadlo 2016-07-30 13:15:18 +03:00
parent 58ea0afed1
commit df7bf32072
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -45,33 +45,32 @@ bool ProfileImporter::importProfile()
if (path.isEmpty()) if (path.isEmpty())
return false; return false;
QFileInfo info(path); QFileInfo info(path);
QString profile = info.completeBaseName(); QString profile = info.completeBaseName();
if (info.suffix() != "tox") if (info.suffix() != "tox")
{ {
QMessageBox::warning( this, QMessageBox::warning(this,
tr("Ignoring non-Tox file", "popup title"), tr("Ignoring non-Tox file", "popup title"),
tr("Warning: You have chosen a file that is not a Tox save file; ignoring.", "popup text"), tr("Warning: You have chosen a file that is not a Tox save file; ignoring.", "popup text"),
QMessageBox::Ok); QMessageBox::Ok);
return false; //ingore importing non-tox file return false; //ingore importing non-tox file
} }
QString profilePath = QDir(Settings::getInstance().getSettingsDirPath()).filePath(profile + Core::TOX_EXT); QString profilePath = QDir(Settings::getInstance().getSettingsDirPath()).filePath(profile + Core::TOX_EXT);
if (QFileInfo(profilePath).exists()) if (QFileInfo(profilePath).exists())
{ {
QString title = QObject::tr("Profile already exists", "import confirm title"); QString title = QObject::tr("Profile already exists", "import confirm title");
QString message = QObject::tr("A profile named \"%1\" already exists. Do you want to erase it?", "import confirm text").arg(profile); QString message = QObject::tr("A profile named \"%1\" already exists. Do you want to erase it?", "import confirm text").arg(profile);
bool erase = GUI::askQuestion(title, message); bool erase = GUI::askQuestion(title, message);
if (!erase) if (!erase)
return false; //import canelled return false; //import canelled
QFile(profilePath).remove(); QFile(profilePath).remove();
} }
QFile::copy(path, profilePath);
return true; //import successfull
QFile::copy(path, profilePath);
return true; //import successfull
} }