diff --git a/pglab/ConnectionController.cpp b/pglab/ConnectionController.cpp index 75f7d2f..ea9152f 100644 --- a/pglab/ConnectionController.cpp +++ b/pglab/ConnectionController.cpp @@ -337,7 +337,7 @@ bool ConnectionController::InitializePasswordManager() std::string ConnectionController::getPskId(QUuid connectionid) { std::string id = "dbpw/"; - id += connectionid.toString().toUtf8().data(); + id += connectionid.toString(QUuid::WithBraces).toUtf8().data(); return id; } diff --git a/pglab/ConnectionListModel.cpp b/pglab/ConnectionListModel.cpp index 38b19f2..22dbac6 100644 --- a/pglab/ConnectionListModel.cpp +++ b/pglab/ConnectionListModel.cpp @@ -202,8 +202,7 @@ INSERT INTO connection_parameter (connection_uuid, pname, pvalue) auto& encodedPassword = cc.encodedPassword(); if (!encodedPassword.isEmpty()) { - b64 = encodedPassword.toBase64(QByteArray::Base64Encoding); - stmt.Bind(4, b64.data(), b64.length()); + stmt.Bind(4, encodedPassword.data(), encodedPassword.length()); } stmt.Step(); @@ -272,7 +271,8 @@ void ConnectionTreeModel::loadConnections() auto cc = std::make_shared(); cc->setUuid(QUuid::fromString(stmt.ColumnText(0))); cc->setName(stmt.ColumnText(1)); - cc->setEncodedPassword(stmt.ColumnCharPtr(3)); + const char* p = stmt.ColumnCharPtr(3); + cc->setEncodedPassword(p); loadConnectionParameters(*cc); int group_id = stmt.ColumnInteger(2);