From 56a36e2e0a1023a77f0b047a7273295a35aa1833 Mon Sep 17 00:00:00 2001 From: Impyy Date: Thu, 21 Apr 2016 16:48:17 +0200 Subject: [PATCH] fix(profile): Don't require .ini to load profile Fixes an issue where qtox refused to load profiles while using the -p switch on the command line. This happened in cases where there was no .ini file for the specified profile present. --- src/persistence/profile.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/persistence/profile.cpp b/src/persistence/profile.cpp index cdf928a89..d9c7077c2 100644 --- a/src/persistence/profile.cpp +++ b/src/persistence/profile.cpp @@ -202,17 +202,11 @@ void Profile::scanProfiles() for (QString toxfile : toxfiles) { if (!inifiles.contains(toxfile)) - importProfile(toxfile); + Settings::getInstance().createPersonal(toxfile); profiles.append(toxfile); } } -void Profile::importProfile(QString name) -{ - assert(!exists(name)); - Settings::getInstance().createPersonal(name); -} - QVector Profile::getProfiles() { return profiles; @@ -464,7 +458,7 @@ void Profile::removeAvatar(const QString &ownerId) bool Profile::exists(QString name) { QString path = Settings::getInstance().getSettingsDirPath() + name; - return QFile::exists(path+".tox") && QFile::exists(path+".ini"); + return QFile::exists(path+".tox"); } bool Profile::isEncrypted() const