From 17561b0c9f8efee61093c918883346869a91ba69 Mon Sep 17 00:00:00 2001 From: Eike Hein Date: Thu, 7 May 2015 21:41:54 +0200 Subject: [PATCH] Fix missing signal connect + some speed optimizations for KAMD submenu reveals. --- forwardingmodel.cpp | 6 ++++-- funnelmodel.cpp | 2 ++ recentappsmodel.cpp | 6 ++++++ recentcontactsmodel.cpp | 7 ++++++- recentdocsmodel.cpp | 6 ++++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/forwardingmodel.cpp b/forwardingmodel.cpp index 88a606d67..522be7d24 100644 --- a/forwardingmodel.cpp +++ b/forwardingmodel.cpp @@ -40,10 +40,10 @@ void ForwardingModel::setSourceModel(QAbstractItemModel *sourceModel) m_sourceModel = sourceModel; - endResetModel(); - connectSignals(); + endResetModel(); + emit countChanged(); emit sourceModelChanged(); @@ -174,6 +174,8 @@ void ForwardingModel::connectSignals() Qt::UniqueConnection); connect(m_sourceModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(countChanged()), Qt::UniqueConnection); + connect(m_sourceModel, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(foo(QModelIndex,int,int)), Qt::UniqueConnection); connect(m_sourceModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), Qt::UniqueConnection); diff --git a/funnelmodel.cpp b/funnelmodel.cpp index 88b2cc51e..aaa436e55 100644 --- a/funnelmodel.cpp +++ b/funnelmodel.cpp @@ -46,6 +46,8 @@ void FunnelModel::setSourceModel(QAbstractItemModel *model) m_sourceModel = model; + connectSignals(); + emit endResetModel(); emit countChanged(); diff --git a/recentappsmodel.cpp b/recentappsmodel.cpp index 592039736..161563c4f 100644 --- a/recentappsmodel.cpp +++ b/recentappsmodel.cpp @@ -166,6 +166,12 @@ void RecentAppsModel::refresh() ResultModel *model = new ResultModel(query); model->setItemCountLimit(15); + QModelIndex index; + + if (model->canFetchMore(index)) { + model->fetchMore(index); + } + setSourceModel(model); delete oldModel; diff --git a/recentcontactsmodel.cpp b/recentcontactsmodel.cpp index ad688d7ac..183300219 100644 --- a/recentcontactsmodel.cpp +++ b/recentcontactsmodel.cpp @@ -162,7 +162,12 @@ void RecentContactsModel::refresh() ResultModel *model = new ResultModel(query); model->setItemCountLimit(15); - model->fetchMore(QModelIndex()); + + QModelIndex index; + + if (model->canFetchMore(index)) { + model->fetchMore(index); + } // FIXME TODO: Don't wipe entire cache on transactions. connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), diff --git a/recentdocsmodel.cpp b/recentdocsmodel.cpp index 541d14fe1..d134dfc54 100644 --- a/recentdocsmodel.cpp +++ b/recentdocsmodel.cpp @@ -134,6 +134,12 @@ void RecentDocsModel::refresh() ResultModel *model = new ResultModel(query); model->setItemCountLimit(15); + QModelIndex index; + + if (model->canFetchMore(index)) { + model->fetchMore(index); + } + setSourceModel(model); delete oldModel;