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() { void FeedMessageViewer::onFeedUpdatesFinished() {
qApp->feedUpdateLock()->unlock(); qApp->feedUpdateLock()->unlock();
qApp->mainForm()->statusBar()->clearProgressFeeds(); qApp->mainForm()->statusBar()->clearProgressFeeds();
m_messagesView->reloadSelections(1); m_messagesView->reloadSelections(true);
} }
void FeedMessageViewer::switchFeedComponentVisibility() { void FeedMessageViewer::switchFeedComponentVisibility() {

View file

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

View file

@ -73,7 +73,7 @@ void MessagesView::keyboardSearch(const QString &search) {
setSelectionMode(QAbstractItemView::ExtendedSelection); 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 current_index = selectionModel()->currentIndex();
QModelIndex mapped_current_index = m_proxyModel->mapToSource(current_index); QModelIndex mapped_current_index = m_proxyModel->mapToSource(current_index);
QModelIndexList selected_indexes = selectionModel()->selectedRows(); 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())); current_index = m_proxyModel->mapFromSource(m_sourceModel->index(mapped_current_index.row(), mapped_current_index.column()));
if (current_index.isValid()) { 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 // User selected to mark some messages as unread, if one
// of them will be marked as current, then it will be read again. // of them will be marked as current, then it will be read again.
m_batchUnreadSwitch = true; m_batchUnreadSwitch = true;
@ -436,8 +436,7 @@ void MessagesView::reselectIndexes(const QModelIndexList &indexes) {
QItemSelection selection; QItemSelection selection;
foreach (const QModelIndex &index, indexes) { foreach (const QModelIndex &index, indexes) {
// TODO: THIS IS very slow. Try to select 4000 messages // TODO: THIS IS very slow. Try to select 4000 messages and hit "mark as read" button.
// and hit "mark as read" button.
selection.merge(QItemSelection(index, index), QItemSelectionModel::Select); 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. // and it needs to be reloaded to the view.
// If "mark_current_index_read" is 0, then message with // If "mark_current_index_read" is 0, then message with
// "current" index is not marked as read. // "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. // Loads un-deleted messages from selected feeds.
void loadFeeds(const FeedsSelection &selection); void loadFeeds(const FeedsSelection &selection);