Merge pull request #1950 from PhenomRetroShare/Fix_MessagesQuickViewUnselect

Fix Messages Quick View unselect.
This commit is contained in:
defnax 2020-05-19 20:58:56 +02:00 committed by GitHub
commit 623e803584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@
class MessageSortFilterProxyModel: public QSortFilterProxyModel
{
public:
MessageSortFilterProxyModel(const QHeaderView *header,QObject *parent = NULL): QSortFilterProxyModel(parent),m_header(header) , m_sortingEnabled(false) {}
MessageSortFilterProxyModel(QObject *parent = NULL): QSortFilterProxyModel(parent), m_sortingEnabled(false) {}
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
{
@ -113,7 +113,6 @@ public:
void setSortingEnabled(bool b) { m_sortingEnabled = b ; }
private:
const QHeaderView *m_header ;
bool m_sortingEnabled;
};
@ -138,7 +137,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
listMode = LIST_NOTHING;
mMessageModel = new RsMessageModel(this);
mMessageProxyModel = new MessageSortFilterProxyModel(ui.messageTreeWidget->header(),this);
mMessageProxyModel = new MessageSortFilterProxyModel(this);
mMessageProxyModel->setSourceModel(mMessageModel);
mMessageProxyModel->setSortRole(RsMessageModel::SortRole);
mMessageProxyModel->setDynamicSortFilter(false);
@ -780,6 +779,7 @@ void MessagesDialog::changeBox(int box_row)
inChange = true;
ui.quickViewWidget->setCurrentItem(NULL);
changeQuickView(-1);
listMode = LIST_BOX;
switch(box_row)
@ -813,9 +813,9 @@ void MessagesDialog::changeBox(int box_row)
void MessagesDialog::changeQuickView(int newrow)
{
Q_UNUSED(newrow);
ui.listWidget->setCurrentItem(NULL);
changeBox(-1);
listMode = LIST_QUICKVIEW;
RsMessageModel::QuickViewFilter f = RsMessageModel::QUICK_VIEW_ALL ;
@ -870,12 +870,9 @@ void MessagesDialog::messagesTagsChanged()
mMessageModel->updateMessages();
}
static void InitIconAndFont(QTreeWidgetItem *item)
{
}
// click in messageTreeWidget
void MessagesDialog::currentChanged(const QModelIndex& new_proxy_index,const QModelIndex& old_proxy_index)
void MessagesDialog::currentChanged(const QModelIndex& new_proxy_index,const QModelIndex& /*old_proxy_index*/)
{
if(!new_proxy_index.isValid())
return;