Some more changes.

This commit is contained in:
Martin Rotter 2015-05-13 07:09:28 +02:00
parent 719ab53d94
commit 44fc4a3f07
4 changed files with 5 additions and 7 deletions

View File

@ -179,7 +179,7 @@ void FeedMessageViewer::onFeedUpdatesProgress(FeedsModelFeed *feed, int current,
void FeedMessageViewer::onFeedUpdatesFinished() {
qApp->feedUpdateLock()->unlock();
qApp->mainForm()->statusBar()->clearProgressFeeds();
m_messagesView->reloadSelections(1);
m_messagesView->reloadSelections(true);
}
void FeedMessageViewer::switchFeedComponentVisibility() {

View File

@ -78,7 +78,6 @@ void MessagesToolBar::loadChangeableActions(const QStringList& actions) {
// Add new separator.
addSeparator();
}
// TODO: tydle dve vetve asi vymazat.
else if (action_name == SEACRH_MESSAGES_ACTION_NAME) {
// Add search box.
addAction(m_actionSearchMessages);

View File

@ -73,7 +73,7 @@ void MessagesView::keyboardSearch(const QString &search) {
setSelectionMode(QAbstractItemView::ExtendedSelection);
}
void MessagesView::reloadSelections(int mark_current_index_read) {
void MessagesView::reloadSelections(bool mark_current_index_read) {
QModelIndex current_index = selectionModel()->currentIndex();
QModelIndex mapped_current_index = m_proxyModel->mapToSource(current_index);
QModelIndexList selected_indexes = selectionModel()->selectedRows();
@ -89,7 +89,7 @@ void MessagesView::reloadSelections(int mark_current_index_read) {
current_index = m_proxyModel->mapFromSource(m_sourceModel->index(mapped_current_index.row(), mapped_current_index.column()));
if (current_index.isValid()) {
if (mark_current_index_read == 0) {
if (mark_current_index_read) {
// User selected to mark some messages as unread, if one
// of them will be marked as current, then it will be read again.
m_batchUnreadSwitch = true;
@ -436,8 +436,7 @@ void MessagesView::reselectIndexes(const QModelIndexList &indexes) {
QItemSelection selection;
foreach (const QModelIndex &index, indexes) {
// TODO: THIS IS very slow. Try to select 4000 messages
// and hit "mark as read" button.
// TODO: THIS IS very slow. Try to select 4000 messages and hit "mark as read" button.
selection.merge(QItemSelection(index, index), QItemSelectionModel::Select);
}

View File

@ -57,7 +57,7 @@ class MessagesView : public QTreeView {
// and it needs to be reloaded to the view.
// If "mark_current_index_read" is 0, then message with
// "current" index is not marked as read.
void reloadSelections(int mark_current_index_read);
void reloadSelections(bool mark_current_index_read);
// Loads un-deleted messages from selected feeds.
void loadFeeds(const FeedsSelection &selection);