mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-07 05:42:19 -04:00
Added Qt dependent macro for QString::SkipEmptyParts/Qt::SkipEmptyParts
This commit is contained in:
parent
f38b72e7a3
commit
e2e1a431ff
11 changed files with 23 additions and 17 deletions
|
@ -898,7 +898,7 @@ void SearchDialog::searchKeywords(const QString& keywords)
|
||||||
if (keywords.length() < 3)
|
if (keywords.length() < 3)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
QStringList qWords = keywords.split(" ", QString::SkipEmptyParts);
|
QStringList qWords = keywords.split(" ", QtSkipEmptyParts);
|
||||||
std::list<std::string> words;
|
std::list<std::string> words;
|
||||||
QStringListIterator qWordsIter(qWords);
|
QStringListIterator qWordsIter(qWords);
|
||||||
while (qWordsIter.hasNext())
|
while (qWordsIter.hasNext())
|
||||||
|
@ -1236,7 +1236,7 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
|
||||||
int friendSource = 0;
|
int friendSource = 0;
|
||||||
int anonymousSource = 0;
|
int anonymousSource = 0;
|
||||||
QString resultCount = it->text(SR_SOURCES_COL);
|
QString resultCount = it->text(SR_SOURCES_COL);
|
||||||
QStringList modifiedResultCount = resultCount.split("/", QString::SkipEmptyParts);
|
QStringList modifiedResultCount = resultCount.split("/", QtSkipEmptyParts);
|
||||||
if(searchType == FRIEND_SEARCH)
|
if(searchType == FRIEND_SEARCH)
|
||||||
{
|
{
|
||||||
friendSource = modifiedResultCount.at(0).toInt() + 1;
|
friendSource = modifiedResultCount.at(0).toInt() + 1;
|
||||||
|
|
|
@ -1619,7 +1619,7 @@ void SharedFilesDialog::FilterItems()
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
//FileSearchFlags flags = isRemote()?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL;
|
//FileSearchFlags flags = isRemote()?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL;
|
||||||
QStringList lst = text.split(" ",QString::SkipEmptyParts) ;
|
QStringList lst = text.split(" ",QtSkipEmptyParts) ;
|
||||||
std::list<std::string> keywords ;
|
std::list<std::string> keywords ;
|
||||||
|
|
||||||
for(auto it(lst.begin());it!=lst.end();++it)
|
for(auto it(lst.begin());it!=lst.end();++it)
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include "util/DateTime.h"
|
#include "util/DateTime.h"
|
||||||
#include "util/qtthreadsutils.h"
|
#include "util/qtthreadsutils.h"
|
||||||
#include "gui/common/FilesDefs.h"
|
#include "gui/common/FilesDefs.h"
|
||||||
|
#include "util/QtVersion.h"
|
||||||
|
|
||||||
#include "gui/MainWindow.h"
|
#include "gui/MainWindow.h"
|
||||||
|
|
||||||
|
@ -417,7 +418,7 @@ void PostedListWidgetWithModel::updateShowLabel()
|
||||||
|
|
||||||
void PostedListWidgetWithModel::filterItems(QString text)
|
void PostedListWidgetWithModel::filterItems(QString text)
|
||||||
{
|
{
|
||||||
QStringList lst = text.split(" ",QString::SkipEmptyParts) ;
|
QStringList lst = text.split(" ",QtSkipEmptyParts) ;
|
||||||
|
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
mPostedPostsModel->setFilter(lst,count) ;
|
mPostedPostsModel->setFilter(lst,count) ;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* *
|
* *
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#include "expressionwidget.h"
|
#include "expressionwidget.h"
|
||||||
|
#include "util/QtVersion.h"
|
||||||
|
|
||||||
ExpressionWidget::ExpressionWidget(QWidget * parent, bool initial)
|
ExpressionWidget::ExpressionWidget(QWidget * parent, bool initial)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
@ -109,11 +110,7 @@ RsRegularExpression::Expression* ExpressionWidget::getRsExpression()
|
||||||
if (isStringSearchExpression())
|
if (isStringSearchExpression())
|
||||||
{
|
{
|
||||||
QString txt = exprParamElem->getStrSearchValue();
|
QString txt = exprParamElem->getStrSearchValue();
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
|
QStringList words = txt.split(" ", QtSkipEmptyParts);
|
||||||
QStringList words = txt.split(" ", QString::SkipEmptyParts);
|
|
||||||
#else
|
|
||||||
QStringList words = txt.split(" ", Qt::SkipEmptyParts);
|
|
||||||
#endif
|
|
||||||
for (int i = 0; i < words.size(); ++i)
|
for (int i = 0; i < words.size(); ++i)
|
||||||
wordList.push_back(words.at(i).toUtf8().constData());
|
wordList.push_back(words.at(i).toUtf8().constData());
|
||||||
} else if (inRangedConfig){
|
} else if (inRangedConfig){
|
||||||
|
|
|
@ -1673,7 +1673,7 @@ void NewFriendList::setShowGroups(bool show)
|
||||||
*/
|
*/
|
||||||
void NewFriendList::filterItems(const QString &text)
|
void NewFriendList::filterItems(const QString &text)
|
||||||
{
|
{
|
||||||
QStringList lst = text.split(' ',QString::SkipEmptyParts);
|
QStringList lst = text.split(' ',QtSkipEmptyParts);
|
||||||
int filterColumn = ui->filterLineEdit->currentFilter();
|
int filterColumn = ui->filterLineEdit->currentFilter();
|
||||||
|
|
||||||
if(filterColumn == 0)
|
if(filterColumn == 0)
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "util/DateTime.h"
|
#include "util/DateTime.h"
|
||||||
#include "util/qtthreadsutils.h"
|
#include "util/qtthreadsutils.h"
|
||||||
#include "gui/common/FilesDefs.h"
|
#include "gui/common/FilesDefs.h"
|
||||||
|
#include "util/QtVersion.h"
|
||||||
|
|
||||||
#include "GxsChannelPostsWidgetWithModel.h"
|
#include "GxsChannelPostsWidgetWithModel.h"
|
||||||
#include "GxsChannelPostsModel.h"
|
#include "GxsChannelPostsModel.h"
|
||||||
|
@ -1454,7 +1455,7 @@ void GxsChannelPostsWidgetWithModel::switchOnlyUnread(bool)
|
||||||
}
|
}
|
||||||
void GxsChannelPostsWidgetWithModel::filterChanged(QString s)
|
void GxsChannelPostsWidgetWithModel::filterChanged(QString s)
|
||||||
{
|
{
|
||||||
QStringList ql = s.split(' ',QString::SkipEmptyParts);
|
QStringList ql = s.split(' ',QtSkipEmptyParts);
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
mChannelPostsModel->setFilter(ql,ui->showUnread_TB->isChecked(),count);
|
mChannelPostsModel->setFilter(ql,ui->showUnread_TB->isChecked(),count);
|
||||||
mChannelFilesModel->setFilter(ql,count);
|
mChannelFilesModel->setFilter(ql,count);
|
||||||
|
|
|
@ -1846,7 +1846,7 @@ void GxsForumThreadWidget::filterColumnChanged(int column)
|
||||||
|
|
||||||
void GxsForumThreadWidget::filterItems(const QString& text)
|
void GxsForumThreadWidget::filterItems(const QString& text)
|
||||||
{
|
{
|
||||||
QStringList lst = text.split(" ",QString::SkipEmptyParts) ;
|
QStringList lst = text.split(" ",QtSkipEmptyParts) ;
|
||||||
|
|
||||||
int filterColumn = ui->filterLineEdit->currentFilter();
|
int filterColumn = ui->filterLineEdit->currentFilter();
|
||||||
|
|
||||||
|
|
|
@ -640,7 +640,7 @@ void MessageWidget::fill(const std::string &msgId)
|
||||||
|
|
||||||
ui.trans_ToText->setText(to_text);
|
ui.trans_ToText->setText(to_text);
|
||||||
|
|
||||||
int recipientsCount = ui.trans_ToText->toPlainText().split(QRegExp("(\\s|\\n|\\r)+"), QString::SkipEmptyParts).count();
|
int recipientsCount = ui.trans_ToText->toPlainText().split(QRegExp("(\\s|\\n|\\r)+"), QtSkipEmptyParts).count();
|
||||||
ui.expandButton->setText( QString::number(recipientsCount)+ " " + tr("more"));
|
ui.expandButton->setText( QString::number(recipientsCount)+ " " + tr("more"));
|
||||||
|
|
||||||
if (recipientsCount >=20) {
|
if (recipientsCount >=20) {
|
||||||
|
|
|
@ -1246,7 +1246,7 @@ void MessagesDialog::undeletemessage()
|
||||||
|
|
||||||
void MessagesDialog::filterChanged(const QString& text)
|
void MessagesDialog::filterChanged(const QString& text)
|
||||||
{
|
{
|
||||||
QStringList items = text.split(' ',QString::SkipEmptyParts);
|
QStringList items = text.split(' ',QtSkipEmptyParts);
|
||||||
|
|
||||||
RsMessageModel::FilterType f = RsMessageModel::FILTER_TYPE_NONE;
|
RsMessageModel::FilterType f = RsMessageModel::FILTER_TYPE_NONE;
|
||||||
|
|
||||||
|
@ -1287,7 +1287,7 @@ void MessagesDialog::filterColumnChanged(int column)
|
||||||
default:break;
|
default:break;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList items = ui.filterLineEdit->text().split(' ',QString::SkipEmptyParts);
|
QStringList items = ui.filterLineEdit->text().split(' ',QtSkipEmptyParts);
|
||||||
mMessageModel->setFilter(f,items);
|
mMessageModel->setFilter(f,items);
|
||||||
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
|
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "util/ObjectPainter.h"
|
#include "util/ObjectPainter.h"
|
||||||
#include "util/imageutil.h"
|
#include "util/imageutil.h"
|
||||||
|
#include "util/QtVersion.h"
|
||||||
|
|
||||||
#include "util/rsdebug.h"
|
#include "util/rsdebug.h"
|
||||||
#include "util/rstime.h"
|
#include "util/rstime.h"
|
||||||
|
@ -1252,7 +1253,7 @@ QString RsHtml::makeQuotedText(RSTextBrowser *browser)
|
||||||
{
|
{
|
||||||
text = browser->toPlainText();
|
text = browser->toPlainText();
|
||||||
}
|
}
|
||||||
QStringList sl = text.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
|
QStringList sl = text.split(QRegExp("[\r\n]"),QtSkipEmptyParts);
|
||||||
text = sl.join("\n> ");
|
text = sl.join("\n> ");
|
||||||
text.replace("\n> >","\n>>"); // Don't add space for already quotted lines.
|
text.replace("\n> >","\n>>"); // Don't add space for already quotted lines.
|
||||||
text.replace(QChar(-4)," ");//Char used when image on text.
|
text.replace(QChar(-4)," ");//Char used when image on text.
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#ifndef QTVERSION_H
|
#ifndef QTVERSION_H
|
||||||
#define QTVERSION_H
|
#define QTVERSION_H
|
||||||
|
|
||||||
// Macros to compile with Qt 4 and Qt 5
|
// Macros to compile with Qt 4, Qt 5 and Qt 6
|
||||||
|
|
||||||
// Renamed QHeaderView::setResizeMode to QHeaderView::setSectionResizeMode
|
// Renamed QHeaderView::setResizeMode to QHeaderView::setSectionResizeMode
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
|
||||||
|
@ -43,4 +43,10 @@
|
||||||
#define QHeaderView_setSectionsMovable(header, movable) header->setMovable(movable);
|
#define QHeaderView_setSectionsMovable(header, movable) header->setMovable(movable);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
|
||||||
|
#define QtSkipEmptyParts Qt::SkipEmptyParts
|
||||||
|
#else
|
||||||
|
#define QtSkipEmptyParts QString::SkipEmptyParts
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue