diff --git a/widget/form/settings/identityform.cpp b/widget/form/settings/identityform.cpp index 09be6af66..cea181318 100644 --- a/widget/form/settings/identityform.cpp +++ b/widget/form/settings/identityform.cpp @@ -121,8 +121,9 @@ void IdentityForm::onRenameClicked() { name = Core::sanitize(name); QDir dir(Settings::getSettingsDirPath()); - QFile::copy(dir.filePath(cur+Core::TOX_EXT), dir.filePath(name+Core::TOX_EXT)); + QFile::rename(dir.filePath(cur+Core::TOX_EXT), dir.filePath(name+Core::TOX_EXT)); bodyUI->profiles->setItemText(bodyUI->profiles->currentIndex(), name); + Settings::getInstance().setCurrentProfile(name); } } diff --git a/widget/widget.cpp b/widget/widget.cpp index 09aa0f8e0..84d18bc81 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -223,6 +223,7 @@ QString Widget::detectProfile() QFile file(path); if (profile == "" || !file.exists()) { + Settings::getInstance().setCurrentProfile(""); #if 1 // deprecation attempt // if the last profile doesn't exist, fall back to old "data" path = dir.filePath(Core::CONFIG_FILE_NAME);