Skip to content

Commit

Permalink
Some warning cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhard Stein committed Jun 30, 2024
1 parent 33c8ce6 commit 8eadc80
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/filtertransdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ void mmFilterTransactionsDialog::OnButtonOkClick(wxCommandEvent& /*event*/)
}
}

void mmFilterTransactionsDialog::OnButtonCancelClick(wxCommandEvent& event)
void mmFilterTransactionsDialog::OnButtonCancelClick( [[maybe_unused]] wxCommandEvent& event)
{
#ifdef __WXMSW__
wxWindow* w = FindFocus();
Expand Down
26 changes: 11 additions & 15 deletions src/mmchecking_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ wxEND_EVENT_TABLE();
TransactionListCtrl::EColumn TransactionListCtrl::toEColumn(const unsigned long col)
{
EColumn res = COL_DEF_SORT;
if (col >= 0 && col < m_real_columns.size()) res = static_cast<EColumn>(col);
if (col < m_real_columns.size()) res = static_cast<EColumn>(col);
return res;
}

Expand Down Expand Up @@ -241,14 +241,7 @@ TransactionListCtrl::TransactionListCtrl(
m_attr14(new wxListItemAttr(*bestFontColour(mmColors::userDefColor4), mmColors::userDefColor4, wxNullFont)),
m_attr15(new wxListItemAttr(*bestFontColour(mmColors::userDefColor5), mmColors::userDefColor5, wxNullFont)),
m_attr16(new wxListItemAttr(*bestFontColour(mmColors::userDefColor6), mmColors::userDefColor6, wxNullFont)),
m_attr17(new wxListItemAttr(*bestFontColour(mmColors::userDefColor7), mmColors::userDefColor7, wxNullFont)),
m_sortCol(COL_DEF_SORT),
g_sortcol(COL_DEF_SORT),
prev_g_sortcol(COL_DEF_SORT2),
g_asc(true),
prev_g_asc(true),
m_firstSort(true),
m_topItemIndex(-1)
m_attr17(new wxListItemAttr(*bestFontColour(mmColors::userDefColor7), mmColors::userDefColor7, wxNullFont))
{
wxASSERT(m_cp);
m_selected_id.clear();
Expand Down Expand Up @@ -394,14 +387,14 @@ void TransactionListCtrl::setExtraTransactionData(const bool single)

//----------------------------------------------------------------------------

void TransactionListCtrl::OnListItemSelected(wxListEvent& event)
void TransactionListCtrl::OnListItemSelected(wxListEvent&)
{
wxLogDebug("OnListItemSelected: %i selected", GetSelectedItemCount());
FindSelectedTransactions();
setExtraTransactionData(GetSelectedItemCount() == 1);
}

void TransactionListCtrl::OnListItemDeSelected(wxListEvent& event)
void TransactionListCtrl::OnListItemDeSelected(wxListEvent&)
{
wxLogDebug("OnListItemDeSelected: %i selected", GetSelectedItemCount());
FindSelectedTransactions();
Expand Down Expand Up @@ -701,7 +694,7 @@ void TransactionListCtrl::OnMouseRightClick(wxMouseEvent& event)
PopupMenu(&menu, event.GetPosition());
}

void TransactionListCtrl::findInAllTransactions(wxCommandEvent& event) {
void TransactionListCtrl::findInAllTransactions(wxCommandEvent&) {
if (!rightClickFilter_.IsEmpty())
{
// save the filter as the "Advanced" filter for All Transactions
Expand All @@ -724,7 +717,7 @@ void TransactionListCtrl::findInAllTransactions(wxCommandEvent& event) {
}
}

void TransactionListCtrl::OnCopyText(wxCommandEvent& event)
void TransactionListCtrl::OnCopyText(wxCommandEvent&)
{
if (!copyText_.IsEmpty())
{
Expand Down Expand Up @@ -1182,7 +1175,7 @@ void TransactionListCtrl::OnListKeyDown(wxListEvent& event)
}
//----------------------------------------------------------------------------

void TransactionListCtrl::OnRestoreViewedTransaction(wxCommandEvent& event)
void TransactionListCtrl::OnRestoreViewedTransaction(wxCommandEvent&)
{
wxMessageDialog msgDlg(this
, _("Do you really want to restore all of the transactions shown?")
Expand Down Expand Up @@ -1928,16 +1921,19 @@ void TransactionListCtrl::doSearchText(const wxString& value)
wxString UDFCFormatHelper(Model_CustomField::FIELDTYPE type, wxString data)
{
wxString formattedData = data;
bool v = false;
if (!data.empty())
{
switch (type) {
case Model_CustomField::FIELDTYPE::DATE:
formattedData = mmGetDateForDisplay(data);
break;
case Model_CustomField::FIELDTYPE::BOOLEAN:
bool v = wxString("TRUE|true|1").Contains(data);
v = wxString("TRUE|true|1").Contains(data);
formattedData = (v) ? L"\u2713" : L"\u2717";
break;
default:
break;
}
}
return formattedData;
Expand Down
24 changes: 12 additions & 12 deletions src/mmchecking_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ class TransactionListCtrl : public mmListCtrl
};
EColumn toEColumn(const unsigned long col);
public:
EColumn g_sortcol; // index of primary column to sort by
EColumn prev_g_sortcol; // index of secondary column to sort by
bool g_asc; // asc\desc sorting for primary sort column
bool prev_g_asc; // asc\desc sorting for secondary sort column
EColumn g_sortcol = COL_DEF_SORT; // index of primary column to sort by
EColumn prev_g_sortcol = COL_DEF_SORT2; // index of secondary column to sort by
bool g_asc = true; // asc\desc sorting for primary sort column
bool prev_g_asc = true; // asc\desc sorting for secondary sort column

bool getSortOrder() const;
EColumn getSortColumn() const { return m_sortCol; }
Expand All @@ -92,7 +92,7 @@ class TransactionListCtrl : public mmListCtrl
void OnDeleteTransaction(wxCommandEvent& event);
void OnRestoreTransaction(wxCommandEvent& event);
void OnDeleteViewedTransaction(wxCommandEvent& event);
void OnRestoreViewedTransaction(wxCommandEvent& event);
void OnRestoreViewedTransaction(wxCommandEvent&);
void OnEditTransaction(wxCommandEvent& event);
void OnDuplicateTransaction(wxCommandEvent& event);
void OnSetUserColour(wxCommandEvent& event);
Expand Down Expand Up @@ -198,8 +198,8 @@ class TransactionListCtrl : public mmListCtrl

void OnMouseRightClick(wxMouseEvent& event);
void OnListLeftClick(wxMouseEvent& event);
void OnListItemSelected(wxListEvent& event);
void OnListItemDeSelected(wxListEvent& event);
void OnListItemSelected(wxListEvent&);
void OnListItemDeSelected(wxListEvent&);
void OnListItemActivated(wxListEvent& event);
void OnMarkTransaction(wxCommandEvent& event);
void OnListKeyDown(wxListEvent& event);
Expand All @@ -215,16 +215,16 @@ class TransactionListCtrl : public mmListCtrl
bool CheckForClosedAccounts();
void setExtraTransactionData(const bool single);
void SortTransactions(int sortcol, bool ascend);
void findInAllTransactions(wxCommandEvent& event);
void OnCopyText(wxCommandEvent& event);
void findInAllTransactions(wxCommandEvent&);
void OnCopyText(wxCommandEvent&);
int getColumnFromPosition(int xPos);
private:
/* The topmost visible item - this will be used to set
where to display the list again after refresh */
long m_topItemIndex;
EColumn m_sortCol;
long m_topItemIndex = -1;
EColumn m_sortCol = COL_DEF_SORT;
wxString m_today;
bool m_firstSort;
bool m_firstSort = true;
wxString rightClickFilter_;
wxString copyText_;
};
Expand Down

0 comments on commit 8eadc80

Please sign in to comment.