From 3aa58bea8e703e33a1eb8e2f9fdf887aca8d03c1 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 2 Apr 2025 20:49:18 +0100 Subject: [PATCH] qt, refactor: Inline `GUIUtil::SplitSkipEmptyParts` function --- src/qt/guiutil.h | 17 ----------------- src/qt/transactionview.cpp | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 3561c31374..1b49343073 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -348,23 +348,6 @@ namespace GUIUtil */ bool HasPixmap(const QLabel* label); - /** - * Splits the string into substrings wherever separator occurs, and returns - * the list of those strings. Empty strings do not appear in the result. - * - * QString::split() signature differs in different Qt versions: - * - QString::SplitBehavior is deprecated since Qt 5.15 - * - Qt::SplitBehavior was introduced in Qt 5.14 - * If {QString|Qt}::SkipEmptyParts behavior is required, use this - * function instead of QString::split(). - */ - template - QStringList SplitSkipEmptyParts(const QString& string, const SeparatorType& separator) - { - return string.split(separator, Qt::SkipEmptyParts); - } - - /** * Replaces a plain text link with an HTML tagged one. */ diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 2aaa65c6f7..90a53fb2bb 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -221,7 +221,7 @@ void TransactionView::setModel(WalletModel *_model) if (_model->getOptionsModel()) { // Add third party transaction URLs to context menu - QStringList listUrls = GUIUtil::SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|"); + QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split("|", Qt::SkipEmptyParts); bool actions_created = false; for (int i = 0; i < listUrls.size(); ++i) {