Skip to content

Commit

Permalink
Merge pull request #28 from guanlisheng/upgrade2v4
Browse files Browse the repository at this point in the history
reflect file's cipher properly
  • Loading branch information
guanlisheng authored Mar 20, 2024
2 parents 4338fc1 + fb082dd commit e51e308
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sqliteplusframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,7 @@ bool wxSQLitePlusFrame::OpenDatabase(const wxString& dbfullname, const wxString&

m_DbName = name;
m_db.Open(dbfullname);
wxSQLite3Cipher* cipher = nullptr;
if (m_db.IsOpen()&&m_db.HasEncryptionSupport())
{
do
Expand Down Expand Up @@ -1638,7 +1639,7 @@ bool wxSQLitePlusFrame::OpenDatabase(const wxString& dbfullname, const wxString&
return false; // Annuler retour sans ouvrir
for (size_t index = 0; index < this->m_Cipher.size(); ++ index)
{
wxSQLite3Cipher* cipher = this->m_Cipher[index];
cipher = this->m_Cipher[index];
try
{
m_db.Open(dbfullname, *cipher, l_dbkey);
Expand Down Expand Up @@ -1674,7 +1675,7 @@ bool wxSQLitePlusFrame::OpenDatabase(const wxString& dbfullname, const wxString&
m_auiManager.Update();
msg = wxString::Format(_("SQLite3 Version %s\n"), m_db.GetVersion().c_str());
SQLBook->GetLogResult()->AppendText(msg);
msg = wxString::Format(_("The database \"%s\" is opened as main\n"), dbfullname.c_str());
msg = wxString::Format(_("The database \"%s\" is opened as main with %s\n"), dbfullname.c_str(), cipher == nullptr ? "empty cipher" : wxSQLite3Cipher::GetCipherName(cipher->GetCipherType()));
SQLBook->GetLogResult()->AppendText(msg);

SQLBook->ShowLog();
Expand Down Expand Up @@ -1777,7 +1778,7 @@ bool wxSQLitePlusFrame::AttachDatabase(const wxString& dbfile,
{
// si dbkey est non nulle modifgier le message pour indiquer que la base est chiffrée
msg = wxString::Format(_("The database \"%s\" is attached as %s with %s\n"),
dbfile.c_str(), dbalias.c_str(), wxSQLite3Cipher::GetCipherName(cipher->GetCipherType()));
dbfile.c_str(), dbalias.c_str(), l_dbkey.IsEmpty() ? "empty cipher" : wxSQLite3Cipher::GetCipherName(cipher->GetCipherType()));

book->GetLogResult()->AppendText(msg);
book->ShowLog();
Expand Down

0 comments on commit e51e308

Please sign in to comment.