FdoSecrets: handle corner cases in collection dbus names, fix #5279

- Use completeBaseName rather than baseName to ensure nonempty name
- Handle two databases have the same name
- Cleanup Service::onDatabaseTabOpened logic
This commit is contained in:
Aetf
2020-11-03 19:02:56 -05:00
parent 804a3b6706
commit a651d7049d
11 changed files with 112 additions and 55 deletions

View File

@@ -28,13 +28,13 @@ namespace FdoSecrets
Session* Session::Create(std::unique_ptr<CipherPair>&& cipher, const QString& peer, Service* parent)
{
std::unique_ptr<Session> res{new Session(std::move(cipher), peer, parent)};
QScopedPointer<Session> res{new Session(std::move(cipher), peer, parent)};
if (!res->registerSelf()) {
return nullptr;
}
return res.release();
return res.take();
}
Session::Session(std::unique_ptr<CipherPair>&& cipher, const QString& peer, Service* parent)