Skip to content

Commit b1f6342

Browse files
committed
Qt: Rename confusingly-named "address prefix" to "search string"
1 parent 0e70791 commit b1f6342

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/qt/transactionfilterproxy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ TransactionFilterProxy::TransactionFilterProxy(QObject *parent) :
2020
QSortFilterProxyModel(parent),
2121
dateFrom(MIN_DATE),
2222
dateTo(MAX_DATE),
23-
addrPrefix(),
23+
m_search_string(),
2424
typeFilter(ALL_TYPES),
2525
watchOnlyFilter(WatchOnlyFilter_All),
2626
minAmount(0),
@@ -51,7 +51,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
5151
return false;
5252
if(datetime < dateFrom || datetime > dateTo)
5353
return false;
54-
if (!address.contains(addrPrefix, Qt::CaseInsensitive) && !label.contains(addrPrefix, Qt::CaseInsensitive))
54+
if (!address.contains(m_search_string, Qt::CaseInsensitive) && !label.contains(m_search_string, Qt::CaseInsensitive))
5555
return false;
5656
if(amount < minAmount)
5757
return false;
@@ -66,9 +66,9 @@ void TransactionFilterProxy::setDateRange(const QDateTime &from, const QDateTime
6666
invalidateFilter();
6767
}
6868

69-
void TransactionFilterProxy::setAddressPrefix(const QString &_addrPrefix)
69+
void TransactionFilterProxy::setSearchString(const QString &search_string)
7070
{
71-
this->addrPrefix = _addrPrefix;
71+
m_search_string = search_string;
7272
invalidateFilter();
7373
}
7474

src/qt/transactionfilterproxy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class TransactionFilterProxy : public QSortFilterProxyModel
3535
};
3636

3737
void setDateRange(const QDateTime &from, const QDateTime &to);
38-
void setAddressPrefix(const QString &addrPrefix);
38+
void setSearchString(const QString &);
3939
/**
4040
@note Type filter takes a bit field created with TYPE() or ALL_TYPES
4141
*/
@@ -57,7 +57,7 @@ class TransactionFilterProxy : public QSortFilterProxyModel
5757
private:
5858
QDateTime dateFrom;
5959
QDateTime dateTo;
60-
QString addrPrefix;
60+
QString m_search_string;
6161
quint32 typeFilter;
6262
WatchOnlyFilter watchOnlyFilter;
6363
CAmount minAmount;

src/qt/transactionview.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
9595

9696
hlayout->addWidget(typeWidget);
9797

98-
addressWidget = new QLineEdit(this);
98+
search_widget = new QLineEdit(this);
9999
#if QT_VERSION >= 0x040700
100-
addressWidget->setPlaceholderText(tr("Enter address or label to search"));
100+
search_widget->setPlaceholderText(tr("Enter address or label to search"));
101101
#endif
102-
hlayout->addWidget(addressWidget);
102+
hlayout->addWidget(search_widget);
103103

104104
amountWidget = new QLineEdit(this);
105105
#if QT_VERSION >= 0x040700
@@ -187,8 +187,8 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
187187
connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int)));
188188
connect(amountWidget, SIGNAL(textChanged(QString)), amount_typing_delay, SLOT(start()));
189189
connect(amount_typing_delay, SIGNAL(timeout()), this, SLOT(changedAmount()));
190-
connect(addressWidget, SIGNAL(textChanged(QString)), prefix_typing_delay, SLOT(start()));
191-
connect(prefix_typing_delay, SIGNAL(timeout()), this, SLOT(changedPrefix()));
190+
connect(search_widget, SIGNAL(textChanged(QString)), prefix_typing_delay, SLOT(start()));
191+
connect(prefix_typing_delay, SIGNAL(timeout()), this, SLOT(changedSearch()));
192192

193193
connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));
194194
connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
@@ -326,11 +326,11 @@ void TransactionView::chooseWatchonly(int idx)
326326
(TransactionFilterProxy::WatchOnlyFilter)watchOnlyWidget->itemData(idx).toInt());
327327
}
328328

329-
void TransactionView::changedPrefix()
329+
void TransactionView::changedSearch()
330330
{
331331
if(!transactionProxyModel)
332332
return;
333-
transactionProxyModel->setAddressPrefix(addressWidget->text());
333+
transactionProxyModel->setSearchString(search_widget->text());
334334
}
335335

336336
void TransactionView::changedAmount()

src/qt/transactionview.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class TransactionView : public QWidget
6666
QComboBox *dateWidget;
6767
QComboBox *typeWidget;
6868
QComboBox *watchOnlyWidget;
69-
QLineEdit *addressWidget;
69+
QLineEdit *search_widget;
7070
QLineEdit *amountWidget;
7171

7272
QMenu *contextMenu;
@@ -113,7 +113,7 @@ public Q_SLOTS:
113113
void chooseType(int idx);
114114
void chooseWatchonly(int idx);
115115
void changedAmount();
116-
void changedPrefix();
116+
void changedSearch();
117117
void exportClicked();
118118
void focusTransaction(const QModelIndex&);
119119

0 commit comments

Comments
 (0)