Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard Stein committed Oct 6, 2024
1 parent 727729c commit 0dbc277
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
14 changes: 8 additions & 6 deletions src/dbwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ wxSharedPtr<wxSQLite3Database> static_db_ptr()
return db;
}

wxSharedPtr<wxSQLite3Database> mmDBWrapper::Open(const wxString &dbpath, const wxString &password, bool debug)
wxSharedPtr<wxSQLite3Database> mmDBWrapper::Open(const wxString &dbpath, const wxString &password, const bool debug)
{
wxSharedPtr<wxSQLite3Database> db = static_db_ptr();

Expand All @@ -47,11 +47,13 @@ wxSharedPtr<wxSQLite3Database> mmDBWrapper::Open(const wxString &dbpath, const w
cipher.SetLegacy(true);
try
{
if (debug)
// open and disable flag SQLITE_CorruptRdOnly = 0x200000000
db->Open(dbpath, cipher, password, (WXSQLITE_OPEN_READWRITE | WXSQLITE_OPEN_CREATE) & ~0x200000000);
else
db->Open(dbpath, cipher, password);
// open and disable flag SQLITE_CorruptRdOnly = 0x200000000
const int flags = debug ?
(WXSQLITE_OPEN_READWRITE | WXSQLITE_OPEN_CREATE) & ~0x200000000 :
WXSQLITE_OPEN_READWRITE | WXSQLITE_OPEN_CREATE;

db->Open(dbpath, cipher, password, flags);

// Ensure that an existing mmex database is not encrypted.
if ((db->IsOpen()) && (db->TableExists("INFOTABLE_V1")))
{
Expand Down
5 changes: 1 addition & 4 deletions src/reports/reportbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
#include "util.h"

mmPrintableBase::mmPrintableBase(const wxString& title)
: m_title(title)
, m_initial(true)
, accountArray_(nullptr)
, m_settings("")
: m_title(title)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/reports/reportbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ class mmPrintableBase
bool m_only_active = false;

private:
bool m_initial;
bool m_initial = true;
int m_account_selection = 0;
int m_id = -1;
int m_parameters = 0;
wxString m_settings;
wxString m_settings = "";
};

inline void mmPrintableBase::setSelection(int sel) { m_date_selection = sel; }
Expand Down

0 comments on commit 0dbc277

Please sign in to comment.