• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

akregator

  • sources
  • kde-4.14
  • kdepim
  • akregator
  • src
articlelistview.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Stanislav Karchebny <Stanislav.Karchebny@kdemail.net>
5  2005-2008 Frank Osterfeld <osterfeld@kde.org>
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of Qt, and distribute the resulting executable,
22  without including the source code for Qt in the source distribution.
23 */
24 
25 #include "articlelistview.h"
26 #include "actionmanager.h"
27 #include "akregatorconfig.h"
28 #include "article.h"
29 #include "articlemodel.h"
30 #include "kernel.h"
31 #include "types.h"
32 
33 #include <utils/filtercolumnsproxymodel.h>
34 
35 #include <KDateTime>
36 #include <KGlobal>
37 #include <KIcon>
38 #include <KLocalizedString>
39 #include <KUrl>
40 #include <KMenu>
41 #include <KColorScheme>
42 #include <KLocale>
43 
44 #include <QApplication>
45 #include <QContextMenuEvent>
46 #include <QHeaderView>
47 #include <QMenu>
48 #include <QPaintEvent>
49 #include <QPalette>
50 #include <QScrollBar>
51 
52 #include <cassert>
53 
54 using namespace boost;
55 using namespace Akregator;
56 
57 
58 FilterDeletedProxyModel::FilterDeletedProxyModel( QObject* parent ) : QSortFilterProxyModel( parent )
59 {
60  setDynamicSortFilter( true );
61 }
62 
63 bool FilterDeletedProxyModel::filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const
64 {
65  return !sourceModel()->index( source_row, 0, source_parent ).data( ArticleModel::IsDeletedRole ).toBool();
66 }
67 
68 SortColorizeProxyModel::SortColorizeProxyModel( QObject* parent ) : QSortFilterProxyModel( parent ), m_keepFlagIcon( KIcon( "mail-mark-important" ) )
69 {
70  m_unreadColor = KColorScheme( QPalette::Normal, KColorScheme::View ).foreground( KColorScheme::PositiveText ).color();
71  m_newColor = KColorScheme( QPalette::Normal, KColorScheme::View ).foreground( KColorScheme::NegativeText ).color();
72 }
73 
74 bool SortColorizeProxyModel::filterAcceptsRow ( int source_row, const QModelIndex& source_parent ) const
75 {
76  if ( source_parent.isValid() )
77  return false;
78 
79  for ( uint i = 0; i < m_matchers.size(); ++i )
80  {
81  if ( !static_cast<ArticleModel*>( sourceModel() )->rowMatches( source_row, m_matchers[i] ) )
82  return false;
83  }
84 
85  return true;
86 }
87 
88 void SortColorizeProxyModel::setFilters( const std::vector<shared_ptr<const Filters::AbstractMatcher> >& matchers )
89 {
90  if ( m_matchers == matchers )
91  return;
92  m_matchers = matchers;
93  invalidateFilter();
94 }
95 
96 QVariant SortColorizeProxyModel::data( const QModelIndex& idx, int role ) const
97 {
98  if ( !idx.isValid() || !sourceModel() )
99  return QVariant();
100 
101  const QModelIndex sourceIdx = mapToSource( idx );
102 
103  switch ( role )
104  {
105  case Qt::ForegroundRole:
106  {
107  switch ( static_cast<ArticleStatus>( sourceIdx.data( ArticleModel::StatusRole ).toInt() ) )
108  {
109  case Unread:
110  {
111  return Settings::useCustomColors() ?
112  Settings::colorUnreadArticles() : m_unreadColor;
113  }
114  case New:
115  {
116  return Settings::useCustomColors() ?
117  Settings::colorNewArticles() : m_newColor;
118  }
119  case Read:
120  {
121  return QApplication::palette().color( QPalette::Text );
122  }
123  }
124  }
125  break;
126  case Qt::DecorationRole:
127  {
128  if ( sourceIdx.column() == ArticleModel::ItemTitleColumn )
129  {
130  return sourceIdx.data( ArticleModel::IsImportantRole ).toBool() ? m_keepFlagIcon : QVariant();
131  }
132  }
133  break;
134  }
135  return sourceIdx.data( role );
136 }
137 
138 namespace {
139 
140  static bool isRead( const QModelIndex& idx )
141  {
142  if ( !idx.isValid() )
143  return false;
144 
145  return static_cast<ArticleStatus>( idx.data( ArticleModel::StatusRole ).toInt() ) == Read;
146  }
147 }
148 
149 void ArticleListView::setArticleModel( ArticleModel* model )
150 {
151  if ( !model ) {
152  setModel( model );
153  return;
154  }
155 
156  m_proxy = new SortColorizeProxyModel( model );
157  m_proxy->setSourceModel( model );
158  m_proxy->setSortRole( ArticleModel::SortRole );
159  m_proxy->setFilters( m_matchers );
160  FilterDeletedProxyModel* const proxy2 = new FilterDeletedProxyModel( model );
161  proxy2->setSortRole( ArticleModel::SortRole );
162  proxy2->setSourceModel( m_proxy );
163 
164  connect( model, SIGNAL(rowsInserted(QModelIndex,int,int)),
165  m_proxy, SLOT(invalidate()) );
166 
167  FilterColumnsProxyModel* const columnsProxy = new FilterColumnsProxyModel( model );
168  columnsProxy->setSortRole( ArticleModel::SortRole );
169  columnsProxy->setSourceModel( proxy2 );
170  columnsProxy->setColumnEnabled( ArticleModel::ItemTitleColumn );
171  columnsProxy->setColumnEnabled( ArticleModel::FeedTitleColumn );
172  columnsProxy->setColumnEnabled( ArticleModel::DateColumn );
173  columnsProxy->setColumnEnabled( ArticleModel::AuthorColumn );
174 
175  setModel( columnsProxy );
176  header()->setContextMenuPolicy( Qt::CustomContextMenu );
177  header()->setResizeMode( QHeaderView::Interactive );
178 }
179 
180 void ArticleListView::showHeaderMenu(const QPoint& pos)
181 {
182  if ( !model() )
183  return;
184 
185  QPointer<KMenu> menu = new KMenu( this );
186  menu->addTitle( i18n( "Columns" ) );
187  menu->setAttribute( Qt::WA_DeleteOnClose );
188 
189  const int colCount = model()->columnCount();
190  int visibleColumns = 0; // number of column currently shown
191  QAction *visibleColumnsAction = 0;
192  for ( int i = 0; i < colCount; ++i )
193  {
194  QAction* act = menu->addAction( model()->headerData( i, Qt::Horizontal ).toString() );
195  act->setCheckable( true );
196  act->setData( i );
197  bool sectionVisible = !header()->isSectionHidden( i );
198  act->setChecked( sectionVisible );
199  if ( sectionVisible ) {
200  ++visibleColumns;
201  visibleColumnsAction = act;
202  }
203  }
204 
205  // Avoid that the last shown column is also hidden
206  if ( visibleColumns == 1 ) {
207  visibleColumnsAction->setEnabled( false );
208  }
209 
210 
211  QPointer<QObject> that( this );
212  QAction * const action = menu->exec( header()->mapToGlobal( pos ) );
213  if ( that && action ) {
214  const int col = action->data().toInt();
215  if ( action->isChecked() )
216  header()->showSection( col );
217  else
218  header()->hideSection( col );
219  }
220  delete menu;
221 }
222 
223 void ArticleListView::saveHeaderSettings()
224 {
225  if ( model() ) {
226  const QByteArray state = header()->saveState();
227  if ( m_columnMode == FeedMode )
228  m_feedHeaderState = state;
229  else
230  m_groupHeaderState = state;
231  }
232 
233  KConfigGroup conf( Settings::self()->config(), "General" );
234  conf.writeEntry( "ArticleListFeedHeaders", m_feedHeaderState.toBase64() );
235  conf.writeEntry( "ArticleListGroupHeaders", m_groupHeaderState.toBase64() );
236 }
237 
238 void ArticleListView::loadHeaderSettings()
239 {
240  KConfigGroup conf( Settings::self()->config(), "General" );
241  m_feedHeaderState = QByteArray::fromBase64( conf.readEntry( "ArticleListFeedHeaders" ).toLatin1() );
242  m_groupHeaderState = QByteArray::fromBase64( conf.readEntry( "ArticleListGroupHeaders" ).toLatin1() );
243 }
244 
245 QItemSelectionModel* ArticleListView::articleSelectionModel() const
246 {
247  return selectionModel();
248 }
249 
250 const QAbstractItemView* ArticleListView::itemView() const
251 {
252  return this;
253 }
254 
255 QAbstractItemView* ArticleListView::itemView()
256 {
257  return this;
258 }
259 
260 QPoint ArticleListView::scrollBarPositions() const
261 {
262  return QPoint( horizontalScrollBar()->value(), verticalScrollBar()->value() );
263 }
264 
265 void ArticleListView::setScrollBarPositions( const QPoint& p )
266 {
267  horizontalScrollBar()->setValue( p.x() );
268  verticalScrollBar()->setValue( p.y() );
269 }
270 
271 
272 void ArticleListView::setGroupMode()
273 {
274  if ( m_columnMode == GroupMode )
275  return;
276 
277  if ( model() )
278  m_feedHeaderState = header()->saveState();
279  m_columnMode = GroupMode;
280  restoreHeaderState();
281 }
282 
283 void ArticleListView::setFeedMode()
284 {
285  if ( m_columnMode == FeedMode )
286  return;
287 
288  if ( model() )
289  m_groupHeaderState = header()->saveState();
290  m_columnMode = FeedMode;
291  restoreHeaderState();
292 }
293 
294 static int maxDateColumnWidth( const QFontMetrics &fm )
295 {
296  int width = 0;
297  KDateTime date( KDateTime::currentLocalDate(), QTime(23, 59) );
298  for (int x=0; x<10; x++, date = date.addDays( -1 ) ) {
299  QString txt = ' ' + KGlobal::locale()->formatDateTime(date, KLocale::FancyShortDate ) + ' ';
300  width = qMax( width, fm.width( txt ) );
301  }
302  return width;
303 }
304 
305 void ArticleListView::restoreHeaderState()
306 {
307  QByteArray state = m_columnMode == GroupMode ? m_groupHeaderState : m_feedHeaderState;
308  header()->restoreState( state );
309  if ( state.isEmpty() )
310  {
311  // No state, set a default config:
312  // - hide the feed column in feed mode (no need to see the same feed title over and over)
313  // - set the date column wide enough to fit all possible dates
314  header()->setSectionHidden( ArticleModel::FeedTitleColumn, m_columnMode == FeedMode );
315  header()->setStretchLastSection( false );
316  header()->resizeSection( ArticleModel::DateColumn, maxDateColumnWidth(fontMetrics()) );
317  if ( model() ) {
318  startResizingTitleColumn();
319  }
320  }
321 
322  if ( header()->sectionSize( ArticleModel::DateColumn ) == 1 )
323  header()->resizeSection( ArticleModel::DateColumn, maxDateColumnWidth(fontMetrics()) );
324 }
325 
326 void ArticleListView::startResizingTitleColumn()
327 {
328  // set the title column to Stretch resize mode so that it adapts to the
329  // content. finishResizingTitleColumn() will turn the resize mode back to
330  // Interactive so that the user can still resize the column himself if he
331  // wants to
332  header()->setResizeMode( ArticleModel::ItemTitleColumn, QHeaderView::Stretch );
333  QMetaObject::invokeMethod( this, "finishResizingTitleColumn", Qt::QueuedConnection );
334 }
335 
336 void ArticleListView::finishResizingTitleColumn()
337 {
338  if ( QApplication::mouseButtons() != Qt::NoButton )
339  {
340  // Come back later: user is still resizing the widget
341  QMetaObject::invokeMethod( this, "finishResizingTitleColumn", Qt::QueuedConnection );
342  return;
343  }
344  header()->setResizeMode( QHeaderView::Interactive );
345 }
346 
347 ArticleListView::~ArticleListView()
348 {
349  saveHeaderSettings();
350 }
351 
352 void ArticleListView::setIsAggregation( bool aggregation )
353 {
354  if ( aggregation )
355  setGroupMode();
356  else
357  setFeedMode();
358 }
359 
360 ArticleListView::ArticleListView( QWidget* parent )
361  : QTreeView(parent),
362  m_columnMode( FeedMode )
363 {
364  setSortingEnabled( true );
365  setAlternatingRowColors( true );
366  setSelectionMode( QAbstractItemView::ExtendedSelection );
367  setUniformRowHeights( true );
368  setRootIsDecorated( false );
369  setAllColumnsShowFocus( true );
370  setDragDropMode( QAbstractItemView::DragOnly );
371 
372  setMinimumSize( 250, 150 );
373  setWhatsThis( i18n("<h2>Article list</h2>"
374  "Here you can browse articles from the currently selected feed. "
375  "You can also manage articles, as marking them as persistent (\"Mark as Important\") or delete them, using the right mouse button menu. "
376  "To view the web page of the article, you can open the article internally in a tab or in an external browser window."));
377 
378  //connect exactly once
379  disconnect( header(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showHeaderMenu(QPoint)) );
380  connect( header(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showHeaderMenu(QPoint)) );
381  loadHeaderSettings();
382 }
383 
384 void ArticleListView::mousePressEvent( QMouseEvent *ev )
385 {
386  // let's push the event, so we can use currentIndex() to get the newly selected article..
387  QTreeView::mousePressEvent( ev );
388 
389  if( ev->button() == Qt::MidButton ) {
390  QModelIndex idx( currentIndex() );
391  const KUrl url = currentIndex().data( ArticleModel::LinkRole ).value<KUrl>();
392 
393  emit signalMouseButtonPressed( ev->button(), url );
394  }
395 }
396 
397 
398 #if 0 // unused
399 namespace {
400  static QString itemIdForIndex( const QModelIndex& index )
401  {
402  return index.isValid() ? index.data( ArticleModel::ItemIdRole ).toString() : QString();
403  }
404 
405  static QStringList itemIdsForIndexes( const QModelIndexList& indexes )
406  {
407  QStringList articles;
408  Q_FOREACH ( const QModelIndex i, indexes )
409  {
410  articles.append( itemIdForIndex( i ) );
411  }
412 
413  return articles;
414  }
415 }
416 #endif
417 
418 void ArticleListView::contextMenuEvent( QContextMenuEvent* event )
419 {
420  QWidget* w = ActionManager::getInstance()->container( "article_popup" );
421  QMenu* popup = qobject_cast<QMenu*>( w );
422  if ( popup )
423  popup->exec( event->globalPos() );
424 }
425 
426 void ArticleListView::paintEvent( QPaintEvent* e )
427 {
428  QTreeView::paintEvent( e );
429 
430 #ifdef __GNUC__
431 #warning The distinction between empty node and 0 items after filtering is hard to port to interview
432 #endif
433 #if 0
434  QString message;
435 
436  if ( !model() || model()->rowCount() > 0 ) // article list is not empty
437  {
438  if (visibleArticles() == 0)
439  {
440  message = i18n("<div align=center>"
441  "<h3>No matches</h3>"
442  "Filter does not match any articles, "
443  "please change your criteria and try again."
444  "</div>");
445  }
446  }
447  else if ( !model() ) // article list is empty
448  {
449  if (!d->node) // no node selected
450  {
451  message = i18n("<div align=center>"
452  "<h3>No feed selected</h3>"
453  "This area is article list. "
454  "Select a feed from the feed list "
455  "and you will see its articles here."
456  "</div>");
457  }
458  }
459 
460  if (!message.isNull())
461  paintInfoBox( message, viewport(), palette() );
462 #endif
463 }
464 
465 
466 void ArticleListView::setModel( QAbstractItemModel* m )
467 {
468  const bool groupMode = m_columnMode == GroupMode;
469 
470  QAbstractItemModel* const oldModel = model();
471  if ( oldModel ) {
472  const QByteArray state = header()->saveState();
473  if ( groupMode )
474  m_groupHeaderState = state;
475  else
476  m_feedHeaderState = state;
477  }
478 
479  QTreeView::setModel( m );
480 
481  if ( m )
482  {
483  sortByColumn( ArticleModel::DateColumn, Qt::DescendingOrder );
484  restoreHeaderState();
485 
486  // Ensure at least one column is visible
487  if ( header()->hiddenSectionCount() == header()->count() ) {
488  header()->showSection( ArticleModel::ItemTitleColumn );
489  }
490  }
491 }
492 
493 void ArticleListView::slotClear()
494 {
495  setModel( 0L );
496 }
497 
498 void ArticleListView::slotPreviousArticle()
499 {
500  if ( !model() )
501  return;
502  emit userActionTakingPlace();
503  const QModelIndex idx = currentIndex();
504  const int newRow = qMax( 0, ( idx.isValid() ? idx.row() : model()->rowCount() ) - 1 );
505  const QModelIndex newIdx = idx.isValid() ? idx.sibling( newRow, 0 ) : model()->index( newRow, 0 );
506  selectIndex( newIdx );
507 }
508 
509 void ArticleListView::slotNextArticle()
510 {
511  if ( !model() )
512  return;
513 
514  emit userActionTakingPlace();
515  const QModelIndex idx = currentIndex();
516  const int newRow = idx.isValid() ? ( idx.row() + 1 ) : 0;
517  const QModelIndex newIdx = model()->index( qMin( newRow, model()->rowCount() - 1 ), 0 );
518  selectIndex( newIdx );
519 }
520 
521 void ArticleListView::slotNextUnreadArticle()
522 {
523  if (!model())
524  return;
525 
526  const int rowCount = model()->rowCount();
527  const int startRow = qMin( rowCount - 1, ( currentIndex().isValid() ? currentIndex().row() + 1 : 0 ) );
528 
529  int i = startRow;
530  bool foundUnread = false;
531 
532  do
533  {
534  if ( !::isRead( model()->index( i, 0 ) ) )
535  foundUnread = true;
536  else
537  i = (i + 1) % rowCount;
538  }
539  while ( !foundUnread && i != startRow );
540 
541  if ( foundUnread )
542  {
543  selectIndex( model()->index( i, 0 ) );
544  }
545 }
546 
547 void ArticleListView::selectIndex( const QModelIndex& idx )
548 {
549  if ( !idx.isValid() )
550  return;
551  setCurrentIndex( idx );
552  clearSelection();
553  Q_ASSERT( selectionModel() );
554  selectionModel()->select( idx, QItemSelectionModel::Select | QItemSelectionModel::Rows );
555  scrollTo( idx, PositionAtCenter );
556 }
557 
558 void ArticleListView::slotPreviousUnreadArticle()
559 {
560  if ( !model() )
561  return;
562 
563  const int rowCount = model()->rowCount();
564  const int startRow = qMax( 0, ( currentIndex().isValid() ? currentIndex().row() : rowCount ) - 1 );
565 
566  int i = startRow;
567  bool foundUnread = false;
568 
569  do
570  {
571  if ( !::isRead( model()->index( i, 0 ) ) )
572  foundUnread = true;
573  else
574  i = i > 0 ? i - 1 : rowCount - 1;
575  }
576  while ( !foundUnread && i != startRow );
577 
578  if ( foundUnread )
579  {
580  selectIndex( model()->index( i, 0 ) );
581  }
582 }
583 
584 
585 void ArticleListView::forceFilterUpdate()
586 {
587  if ( m_proxy )
588  m_proxy->invalidate();
589 }
590 
591 void ArticleListView::setFilters( const std::vector<shared_ptr<const Filters::AbstractMatcher> >& matchers )
592 {
593  if ( m_matchers == matchers )
594  return;
595  m_matchers = matchers;
596  if ( m_proxy )
597  m_proxy->setFilters( matchers );
598 }
599 
QWidget::customContextMenuRequested
void customContextMenuRequested(const QPoint &pos)
Akregator::SortColorizeProxyModel::SortColorizeProxyModel
SortColorizeProxyModel(QObject *parent=0)
Definition: articlelistview.cpp:68
QApplication::mouseButtons
Qt::MouseButtons mouseButtons()
QModelIndex
QSortFilterProxyModel::setSortRole
void setSortRole(int role)
QWidget
QAbstractItemModel::rowCount
virtual int rowCount(const QModelIndex &parent) const =0
maxDateColumnWidth
static int maxDateColumnWidth(const QFontMetrics &fm)
Definition: articlelistview.cpp:294
Akregator::ArticleListView::setIsAggregation
void setIsAggregation(bool isAggregation)
Definition: articlelistview.cpp:352
QWidget::palette
const QPalette & palette() const
QTreeView::paintEvent
virtual void paintEvent(QPaintEvent *event)
types.h
QAbstractItemModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
QAbstractItemView::setAlternatingRowColors
void setAlternatingRowColors(bool enable)
QAbstractItemView
QAbstractItemView::setCurrentIndex
void setCurrentIndex(const QModelIndex &index)
QAbstractItemView::setSelectionMode
void setSelectionMode(QAbstractItemView::SelectionMode mode)
Akregator::ArticleListView::setModel
void setModel(QAbstractItemModel *model)
Definition: articlelistview.cpp:466
articlelistview.h
QByteArray
QAbstractItemView::selectionModel
QItemSelectionModel * selectionModel() const
Akregator::SortColorizeProxyModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: articlelistview.cpp:96
QSortFilterProxyModel::setSourceModel
virtual void setSourceModel(QAbstractItemModel *sourceModel)
Akregator::ArticleListView::setFilters
void setFilters(const std::vector< boost::shared_ptr< const Akregator::Filters::AbstractMatcher > > &)
Definition: articlelistview.cpp:591
kernel.h
QHeaderView::showSection
void showSection(int logicalIndex)
QAction::setChecked
void setChecked(bool)
QHeaderView::restoreState
bool restoreState(const QByteArray &state)
QAction::data
QVariant data() const
Akregator::ArticleListView::setArticleModel
void setArticleModel(Akregator::ArticleModel *model)
Definition: articlelistview.cpp:149
Akregator::ArticleListView::forceFilterUpdate
void forceFilterUpdate()
Definition: articlelistview.cpp:585
QPalette::color
const QColor & color(ColorGroup group, ColorRole role) const
Akregator::ArticleListView::articleSelectionModel
QItemSelectionModel * articleSelectionModel() const
Definition: articlelistview.cpp:245
uint
unsigned int uint
Definition: article.h:41
QPointer
Akregator::ArticleListView::slotClear
void slotClear()
Definition: articlelistview.cpp:493
QByteArray::isEmpty
bool isEmpty() const
QAbstractItemView::setDragDropMode
void setDragDropMode(DragDropMode behavior)
QWidget::mapToGlobal
QPoint mapToGlobal(const QPoint &pos) const
Akregator::ArticleListView::mousePressEvent
void mousePressEvent(QMouseEvent *ev)
Definition: articlelistview.cpp:384
QVariant::value
T value() const
QTreeView::setUniformRowHeights
void setUniformRowHeights(bool uniform)
QAbstractScrollArea::viewport
QWidget * viewport() const
Akregator::ArticleListView::signalMouseButtonPressed
void signalMouseButtonPressed(int, const KUrl)
QPoint
QFontMetrics
QMouseEvent
QTreeView::sortByColumn
void sortByColumn(int column, Qt::SortOrder order)
actionmanager.h
Akregator::ArticleListView::slotNextArticle
void slotNextArticle()
Definition: articlelistview.cpp:509
Akregator::ArticleModel::IsDeletedRole
Definition: articlemodel.h:70
QObject::disconnect
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
QContextMenuEvent::globalPos
const QPoint & globalPos() const
QTime
Akregator::New
article was fetched in the last fetch of it's feed and not read yet.
Definition: types.h:33
QPoint::x
int x() const
QPoint::y
int y() const
QString::isNull
bool isNull() const
QHeaderView::resizeSection
void resizeSection(int logicalIndex, int size)
Akregator::ArticleModel::IsImportantRole
Definition: articlemodel.h:69
QWidget::setMinimumSize
void setMinimumSize(const QSize &)
Akregator::ArticleModel::AuthorColumn
Definition: articlemodel.h:55
QModelIndex::isValid
bool isValid() const
QList::append
void append(const T &value)
Akregator::ArticleModel::ItemTitleColumn
Definition: articlemodel.h:53
QVariant::toInt
int toInt(bool *ok) const
QHeaderView::isSectionHidden
bool isSectionHidden(int logicalIndex) const
QContextMenuEvent
QObject
Akregator::ArticleListView::~ArticleListView
~ArticleListView()
Definition: articlelistview.cpp:347
Akregator::ArticleListView::slotPreviousArticle
void slotPreviousArticle()
Definition: articlelistview.cpp:498
Akregator::SortColorizeProxyModel
Definition: articlelistview.h:64
QMouseEvent::button
Qt::MouseButton button() const
QTreeView::rowsInserted
virtual void rowsInserted(const QModelIndex &parent, int start, int end)
QItemSelectionModel::select
virtual void select(const QModelIndex &index, QFlags< QItemSelectionModel::SelectionFlag > command)
QModelIndex::row
int row() const
Akregator::Read
article is read
Definition: types.h:32
QSortFilterProxyModel::invalidateFilter
void invalidateFilter()
QSortFilterProxyModel::setDynamicSortFilter
void setDynamicSortFilter(bool enable)
Akregator::ArticleListView::itemView
const QAbstractItemView * itemView() const
Definition: articlelistview.cpp:250
Akregator::ArticleStatus
ArticleStatus
(un)read status of the article
Definition: types.h:30
Akregator::ActionManager::container
virtual QWidget * container(const char *name)=0
QTreeView::setAllColumnsShowFocus
void setAllColumnsShowFocus(bool enable)
QString
article.h
QApplication::palette
QPalette palette()
QAbstractScrollArea::verticalScrollBar
QScrollBar * verticalScrollBar() const
Akregator::FilterDeletedProxyModel
Definition: articlelistview.h:53
QMenu::exec
QAction * exec()
QStringList
Akregator::ArticleModel::StatusRole
Definition: articlemodel.h:68
Akregator::ArticleModel::LinkRole
Definition: articlemodel.h:64
QAction::setData
void setData(const QVariant &userData)
QMenu
QSortFilterProxyModel
QHeaderView::hideSection
void hideSection(int logicalIndex)
QWidget::setContextMenuPolicy
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
QAbstractSlider::setValue
void setValue(int)
QFontMetrics::width
int width(const QString &text, int len) const
QTreeView::scrollTo
virtual void scrollTo(const QModelIndex &index, ScrollHint hint)
QAction::setCheckable
void setCheckable(bool)
QMetaObject::invokeMethod
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
Akregator::FilterColumnsProxyModel
Definition: filtercolumnsproxymodel.h:33
QAbstractItemView::state
State state() const
QTreeView::setSortingEnabled
void setSortingEnabled(bool enable)
QAbstractProxyModel::sourceModel
QAbstractItemModel * sourceModel() const
QSortFilterProxyModel::mapToSource
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const
QWidget::setWhatsThis
void setWhatsThis(const QString &)
Akregator::ArticleListView::slotNextUnreadArticle
void slotNextUnreadArticle()
Definition: articlelistview.cpp:521
QWidget::fontMetrics
QFontMetrics fontMetrics() const
QModelIndex::data
QVariant data(int role) const
Akregator::Unread
article wasn't read yet by the user
Definition: types.h:31
Akregator::ActionManager::getInstance
static ActionManager * getInstance()
Definition: actionmanager.cpp:35
QTreeView
QByteArray::fromBase64
QByteArray fromBase64(const QByteArray &base64)
Akregator::ArticleListView::ArticleListView
ArticleListView(QWidget *parent=0)
Definition: articlelistview.cpp:360
Akregator::FilterColumnsProxyModel::setColumnEnabled
void setColumnEnabled(int col, bool enabled=true)
Definition: filtercolumnsproxymodel.cpp:42
QModelIndex::sibling
QModelIndex sibling(int row, int column) const
QHeaderView::saveState
QByteArray saveState() const
articlemodel.h
QTreeView::setModel
virtual void setModel(QAbstractItemModel *model)
Akregator::ArticleModel::SortRole
Definition: articlemodel.h:63
Akregator::ArticleModel::FeedTitleColumn
Definition: articlemodel.h:54
QHeaderView::setResizeMode
void setResizeMode(ResizeMode mode)
QAction
Akregator::SortColorizeProxyModel::setFilters
void setFilters(const std::vector< boost::shared_ptr< const Akregator::Filters::AbstractMatcher > > &)
Definition: articlelistview.cpp:88
QAbstractItemModel::columnCount
virtual int columnCount(const QModelIndex &parent) const =0
Akregator::ArticleListView::scrollBarPositions
QPoint scrollBarPositions() const
Definition: articlelistview.cpp:260
QModelIndex::column
int column() const
QVariant::toBool
bool toBool() const
Akregator::ArticleListView::userActionTakingPlace
void userActionTakingPlace()
QAbstractItemModel
Akregator::ArticleModel::ItemIdRole
Definition: articlemodel.h:66
QAbstractScrollArea::horizontalScrollBar
QScrollBar * horizontalScrollBar() const
QTreeView::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event)
QTreeView::header
QHeaderView * header() const
Akregator::ArticleModel::DateColumn
Definition: articlemodel.h:56
QByteArray::toBase64
QByteArray toBase64() const
QPaintEvent
Akregator::ArticleListView::setScrollBarPositions
void setScrollBarPositions(const QPoint &p)
Definition: articlelistview.cpp:265
QAbstractItemView::model
QAbstractItemModel * model() const
QAbstractItemView::currentIndex
QModelIndex currentIndex() const
QTreeView::setRootIsDecorated
void setRootIsDecorated(bool show)
QHeaderView::setStretchLastSection
void setStretchLastSection(bool stretch)
QItemSelectionModel
QAbstractItemView::clearSelection
void clearSelection()
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QVariant::toString
QString toString() const
QHeaderView::setSectionHidden
void setSectionHidden(int logicalIndex, bool hide)
filtercolumnsproxymodel.h
Akregator::ArticleListView::slotPreviousUnreadArticle
void slotPreviousUnreadArticle()
Definition: articlelistview.cpp:558
QAction::setEnabled
void setEnabled(bool)
Akregator::ArticleModel
Definition: articlemodel.h:46
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akregator

Skip menu "akregator"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal