mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
moved calls to setDynamicSortFilter(false) into constructors of sort proxy models
This commit is contained in:
parent
95e1073b8a
commit
d4141c493d
@ -99,6 +99,12 @@ public:
|
||||
SFDSortFilterProxyModel(RetroshareDirModel *dirModel, QObject *parent) : QSortFilterProxyModel(parent)
|
||||
{
|
||||
m_dirModel = dirModel;
|
||||
|
||||
// Mr.Alice: I removed this because it causes a crash for some obscur reason. Apparently when the model is changed, the proxy model cannot
|
||||
// deal with the change by itself. Should I call something specific? I've no idea. Removing this does not seem to cause any harm either.
|
||||
//Ghibli: set false because by default in qt5 is true and makes rs crash when sorting, all this decided by Cyril not me :D it works
|
||||
|
||||
setDynamicSortFilter(false);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -193,12 +199,6 @@ SharedFilesDialog::SharedFilesDialog(bool remote_mode, QWidget *parent)
|
||||
flat_proxyModel->setFilterRole(RetroshareDirModel::FilterRole);
|
||||
flat_proxyModel->setFilterRegExp(QRegExp(QString(RETROSHARE_DIR_MODEL_FILTER_STRING))) ;
|
||||
|
||||
// Mr.Alice: I removed this because it causes a crash for some obscur reason. Apparently when the model is changed, the proxy model cannot
|
||||
// deal with the change by itself. Should I call something specific? I've no idea. Removing this does not seem to cause any harm either.
|
||||
//Ghibli: set false because by default in qt5 is true and makes rs crash when sorting, all this decided by Cyril not me :D it works
|
||||
tree_proxyModel->setDynamicSortFilter(false);
|
||||
flat_proxyModel->setDynamicSortFilter(false);
|
||||
|
||||
connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter()));
|
||||
connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter()));
|
||||
connect(ui.filterPatternLineEdit, SIGNAL(returnPressed()), this, SLOT(startFilter()));
|
||||
|
@ -111,7 +111,10 @@ public:
|
||||
: QSortFilterProxyModel(parent)
|
||||
, m_header(header)
|
||||
, m_sortingEnabled(false), m_sortByState(false)
|
||||
, m_showOfflineNodes(true) {}
|
||||
, m_showOfflineNodes(true)
|
||||
{
|
||||
setDynamicSortFilter(false); // causes crashes when true.
|
||||
}
|
||||
|
||||
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
|
||||
{
|
||||
@ -184,7 +187,6 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par
|
||||
|
||||
mProxyModel->setSourceModel(mModel);
|
||||
mProxyModel->setSortRole(RsFriendListModel::SortRole);
|
||||
mProxyModel->setDynamicSortFilter(false);
|
||||
mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
mProxyModel->setFilterRole(RsFriendListModel::FilterRole);
|
||||
mProxyModel->setFilterRegExp(QRegExp(RsFriendListModel::FilterString));
|
||||
|
@ -64,7 +64,9 @@ class FSMSortFilterProxyModel : public QSortFilterProxyModel
|
||||
{
|
||||
public:
|
||||
FSMSortFilterProxyModel( QObject *parent) : QSortFilterProxyModel(parent)
|
||||
{}
|
||||
{
|
||||
setDynamicSortFilter(false); // essential to avoid random crashes
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
@ -201,7 +203,6 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName
|
||||
connect(_dirModel, SIGNAL(directoryLoaded(QString)), this, SLOT(directoryLoaded(QString)));
|
||||
|
||||
_tree_proxyModel = new FSMSortFilterProxyModel(this);
|
||||
_tree_proxyModel->setDynamicSortFilter(true);
|
||||
_tree_proxyModel->setSourceModel(_dirModel);
|
||||
_tree_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
_tree_proxyModel->setSortRole(Qt::DisplayRole);
|
||||
|
@ -206,7 +206,10 @@ public:
|
||||
class ForumPostSortFilterProxyModel: public QSortFilterProxyModel
|
||||
{
|
||||
public:
|
||||
explicit ForumPostSortFilterProxyModel(const QHeaderView *header,QObject *parent = NULL): QSortFilterProxyModel(parent),m_header(header) {}
|
||||
explicit ForumPostSortFilterProxyModel(const QHeaderView *header,QObject *parent = NULL): QSortFilterProxyModel(parent),m_header(header)
|
||||
{
|
||||
setDynamicSortFilter(false); // causes crashes when true
|
||||
}
|
||||
|
||||
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
|
||||
{
|
||||
@ -257,7 +260,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
|
||||
mThreadModel = new RsGxsForumModel(this);
|
||||
mThreadProxyModel = new ForumPostSortFilterProxyModel(ui->threadTreeWidget->header(),this);
|
||||
mThreadProxyModel->setSourceModel(mThreadModel);
|
||||
mThreadProxyModel->setDynamicSortFilter(false); // causes crashes when true.
|
||||
mThreadProxyModel->setSortRole(RsGxsForumModel::SortRole);
|
||||
ui->threadTreeWidget->setModel(mThreadProxyModel);
|
||||
|
||||
|
@ -98,7 +98,10 @@
|
||||
class MessageSortFilterProxyModel: public QSortFilterProxyModel
|
||||
{
|
||||
public:
|
||||
MessageSortFilterProxyModel(QObject *parent = NULL): QSortFilterProxyModel(parent), m_sortingEnabled(false) {}
|
||||
MessageSortFilterProxyModel(QObject *parent = NULL): QSortFilterProxyModel(parent), m_sortingEnabled(false)
|
||||
{
|
||||
setDynamicSortFilter(false); // causes crashes when true
|
||||
}
|
||||
|
||||
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
|
||||
{
|
||||
@ -145,7 +148,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
||||
mMessageProxyModel = new MessageSortFilterProxyModel(this);
|
||||
mMessageProxyModel->setSourceModel(mMessageModel);
|
||||
mMessageProxyModel->setSortRole(RsMessageModel::SortRole);
|
||||
mMessageProxyModel->setDynamicSortFilter(false);
|
||||
mMessageProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
mMessageProxyModel->setFilterRole(RsMessageModel::FilterRole);
|
||||
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString));
|
||||
|
Loading…
Reference in New Issue
Block a user