qt, refactor: Inline GUIUtil::SplitSkipEmptyParts function

This commit is contained in:
Hennadii Stepanov 2025-04-02 20:49:18 +01:00
parent d1ec6db249
commit 3aa58bea8e
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 1 additions and 18 deletions

View file

@ -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 <typename SeparatorType>
QStringList SplitSkipEmptyParts(const QString& string, const SeparatorType& separator)
{
return string.split(separator, Qt::SkipEmptyParts);
}
/**
* Replaces a plain text link with an HTML tagged one.
*/

View file

@ -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)
{