OMG
This commit is contained in:
parent
11ce7f5389
commit
72ace2fe43
@ -124,6 +124,8 @@ class MessagesModel : public QSqlTableModel {
|
||||
void setupIcons();
|
||||
|
||||
private:
|
||||
DisplayFilter m_filter;
|
||||
|
||||
QList<int> m_currentFeeds;
|
||||
QList<QString> m_headerData;
|
||||
QList<QString> m_tooltipData;
|
||||
|
@ -194,9 +194,11 @@ void FeedMessageViewer::switchFeedComponentVisibility() {
|
||||
void FeedMessageViewer::createConnections() {
|
||||
FormMain *form_main = FormMain::instance();
|
||||
|
||||
// Filtering.
|
||||
// Filtering & searching.
|
||||
connect(m_toolBarMessages, SIGNAL(messageSearchPatternChanged(QString)),
|
||||
m_messagesView, SLOT(filterMessages(QString)));
|
||||
m_messagesView, SLOT(searchMessages(QString)));
|
||||
/*connect(m_toolBarMessages, SIGNAL(messageFilterChanged(MessagesModel::DisplayFilter)),
|
||||
m_messagesView, SLOT(filterMessages(MessagesModel::DisplayFilter)));*/
|
||||
|
||||
// Message changers.
|
||||
connect(m_messagesView, SIGNAL(currentMessagesRemoved()),
|
||||
|
@ -373,11 +373,16 @@ void MessagesView::switchSelectedMessagesImportance() {
|
||||
void MessagesView::reselectIndexes(const QModelIndexList &indexes) {
|
||||
selectionModel()->clearSelection();
|
||||
|
||||
QItemSelection selection;
|
||||
|
||||
foreach (const QModelIndex &index, indexes) {
|
||||
selectionModel()->select(index,
|
||||
QItemSelectionModel::Select |
|
||||
QItemSelectionModel::Rows);
|
||||
// TODO: THIS IS very slow. Try to select 4000 messages
|
||||
// and hit "mark as read" button.
|
||||
selection.merge(QItemSelection(index, index), QItemSelectionModel::Select);
|
||||
}
|
||||
|
||||
selectionModel()->select(selection,
|
||||
QItemSelectionModel::Select | QItemSelectionModel::Rows);
|
||||
}
|
||||
|
||||
void MessagesView::selectNextItem() {
|
||||
@ -398,7 +403,7 @@ void MessagesView::selectPreviousItem() {
|
||||
}
|
||||
}
|
||||
|
||||
void MessagesView::filterMessages(const QString &pattern) {
|
||||
void MessagesView::searchMessages(const QString &pattern) {
|
||||
m_proxyModel->setFilterWildcard(pattern);
|
||||
|
||||
if (selectionModel()->selectedRows().size() == 0) {
|
||||
|
@ -76,8 +76,8 @@ class MessagesView : public QTreeView {
|
||||
void selectNextItem();
|
||||
void selectPreviousItem();
|
||||
|
||||
// Filters the visible message according to given pattern.
|
||||
void filterMessages(const QString &pattern);
|
||||
// Searchs the visible message according to given pattern.
|
||||
void searchMessages(const QString &pattern);
|
||||
|
||||
protected slots:
|
||||
// Marks given indexes as selected.
|
||||
|
Loading…
x
Reference in New Issue
Block a user