• 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
feedlist.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Frank Osterfeld <osterfeld@kde.org>
5 
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 "feedlist.h"
26 #include "storage.h"
27 #include "article.h"
28 #include "feed.h"
29 #include "folder.h"
30 #include "treenode.h"
31 #include "treenodevisitor.h"
32 
33 #include "kernel.h"
34 #include "subscriptionlistjobs.h"
35 
36 #include <kdebug.h>
37 #include <klocale.h>
38 #include <krandom.h>
39 
40 #include <qdom.h>
41 #include <QHash>
42 #include <QSet>
43 #include <QTime>
44 
45 #include <cassert>
46 
47 using namespace boost;
48 
49 namespace Akregator {
50 
51 class FeedList::Private
52 {
53  FeedList* const q;
54 
55 public:
56  Private( Backend::Storage* st, FeedList* qq );
57 
58  Akregator::Backend::Storage* storage;
59  QList<TreeNode*> flatList;
60  Folder* rootNode;
61  QHash<int, TreeNode*> idMap;
62  AddNodeVisitor* addNodeVisitor;
63  RemoveNodeVisitor* removeNodeVisitor;
64  QHash<QString, QList<Feed*> > urlMap;
65  mutable int unreadCache;
66 };
67 
68 class FeedList::AddNodeVisitor : public TreeNodeVisitor
69 {
70  public:
71  AddNodeVisitor(FeedList* list) : m_list(list) {}
72 
73 
74  bool visitFeed(Feed* node)
75  {
76  m_list->d->idMap.insert(node->id(), node);
77  m_list->d->flatList.append(node);
78  m_list->d->urlMap[node->xmlUrl()].append(node);
79  connect( node, SIGNAL(fetchStarted(Akregator::Feed*)),
80  m_list, SIGNAL(fetchStarted(Akregator::Feed*)) );
81  connect( node, SIGNAL(fetched(Akregator::Feed*)),
82  m_list, SIGNAL(fetched(Akregator::Feed*)) );
83  connect( node, SIGNAL(fetchAborted(Akregator::Feed*)),
84  m_list, SIGNAL(fetchAborted(Akregator::Feed*)) );
85  connect( node, SIGNAL(fetchError(Akregator::Feed*)),
86  m_list, SIGNAL(fetchError(Akregator::Feed*)) );
87  connect( node, SIGNAL(fetchDiscovery(Akregator::Feed*)),
88  m_list, SIGNAL(fetchDiscovery(Akregator::Feed*)) );
89 
90 
91  visitTreeNode(node);
92  return true;
93  }
94 
95  void visit(TreeNode* node, bool preserveID)
96  {
97  m_preserveID = preserveID;
98  TreeNodeVisitor::visit(node);
99  }
100 
101  bool visitTreeNode(TreeNode* node)
102  {
103  if (!m_preserveID)
104  node->setId(m_list->generateID());
105  m_list->d->idMap[node->id()] = node;
106  m_list->d->flatList.append(node);
107 
108  connect(node, SIGNAL(signalDestroyed(Akregator::TreeNode*)), m_list, SLOT(slotNodeDestroyed(Akregator::TreeNode*)));
109  connect( node, SIGNAL(signalChanged(Akregator::TreeNode*)), m_list, SIGNAL(signalNodeChanged(Akregator::TreeNode*)) );
110  emit m_list->signalNodeAdded(node);
111 
112  return true;
113  }
114 
115  bool visitFolder(Folder* node)
116  {
117  connect(node, SIGNAL(signalChildAdded(Akregator::TreeNode*)), m_list, SLOT(slotNodeAdded(Akregator::TreeNode*)));
118  connect( node, SIGNAL(signalAboutToRemoveChild(Akregator::TreeNode*)), m_list, SIGNAL(signalAboutToRemoveNode(Akregator::TreeNode*)) );
119  connect(node, SIGNAL(signalChildRemoved(Akregator::Folder*,Akregator::TreeNode*)), m_list, SLOT(slotNodeRemoved(Akregator::Folder*,Akregator::TreeNode*)));
120 
121  visitTreeNode(node);
122 
123  for (TreeNode* i = node->firstChild(); i && i != node; i = i->next() )
124  m_list->slotNodeAdded(i);
125 
126  return true;
127  }
128 
129  private:
130  FeedList* m_list;
131  bool m_preserveID;
132 };
133 
134 class FeedList::RemoveNodeVisitor : public TreeNodeVisitor
135 {
136  public:
137  RemoveNodeVisitor(FeedList* list) : m_list(list) {}
138 
139  bool visitFeed(Feed* node)
140  {
141  visitTreeNode( node );
142  m_list->d->urlMap[node->xmlUrl()].removeAll(node);
143  return true;
144  }
145 
146  bool visitTreeNode(TreeNode* node)
147  {
148  m_list->d->idMap.remove(node->id());
149  m_list->d->flatList.removeAll(node);
150  m_list->disconnect( node );
151  return true;
152  }
153 
154  bool visitFolder(Folder* node)
155  {
156  visitTreeNode(node);
157 
158  return true;
159  }
160 
161  private:
162  FeedList* m_list;
163 };
164 
165 FeedList::Private::Private( Backend::Storage* st, FeedList* qq )
166  : q( qq )
167  , storage( st )
168  , rootNode( 0 )
169  , addNodeVisitor( new AddNodeVisitor( q ) )
170  , removeNodeVisitor( new RemoveNodeVisitor( q ) )
171  , unreadCache( -1 ) {
172  Q_ASSERT( storage );
173 }
174 
175 FeedList::FeedList( Backend::Storage* storage )
176  : QObject( 0 ), d( new Private( storage, this ) ) {
177  Folder* rootNode = new Folder( i18n("All Feeds") );
178  rootNode->setId( 1 );
179  setRootNode( rootNode );
180  addNode( rootNode, true );
181 }
182 
183 QVector<int> FeedList::feedIds() const
184 {
185  QVector<int> ids;
186  Q_FOREACH ( const Feed* const i, feeds() )
187  ids += i->id();
188  return ids;
189 }
190 
191 QVector<const Feed*> FeedList::feeds() const
192 {
193  QVector<const Feed*> constList;
194  Q_FOREACH( const Feed* const i, d->rootNode->feeds() )
195  constList.append( i );
196  return constList;
197 }
198 
199 QVector<Feed*> FeedList::feeds()
200 {
201  return d->rootNode->feeds();
202 }
203 
204 QVector<const Folder*> FeedList::folders() const
205 {
206  QVector<const Folder*> constList;
207  Q_FOREACH( const Folder* const i, d->rootNode->folders() )
208  constList.append( i );
209  return constList;
210 }
211 
212 QVector<Folder*> FeedList::folders()
213 {
214  return d->rootNode->folders();
215 }
216 
217 void FeedList::addNode(TreeNode* node, bool preserveID)
218 {
219  d->addNodeVisitor->visit(node, preserveID);
220 }
221 
222 void FeedList::removeNode(TreeNode* node)
223 {
224  d->removeNodeVisitor->visit(node);
225 }
226 
227 void FeedList::parseChildNodes(QDomNode &node, Folder* parent)
228 {
229  QDomElement e = node.toElement(); // try to convert the node to an element.
230 
231  if( !e.isNull() )
232  {
233  //QString title = e.hasAttribute("text") ? e.attribute("text") : e.attribute("title");
234 
235  if (e.hasAttribute(QLatin1String("xmlUrl")) || e.hasAttribute(QLatin1String("xmlurl")) || e.hasAttribute(QLatin1String("xmlURL")) )
236  {
237  Feed* feed = Feed::fromOPML(e, d->storage);
238  if (feed)
239  {
240  if (!d->urlMap[feed->xmlUrl()].contains(feed))
241  d->urlMap[feed->xmlUrl()].append(feed);
242  parent->appendChild(feed);
243  }
244  }
245  else
246  {
247  Folder* fg = Folder::fromOPML(e);
248  parent->appendChild(fg);
249 
250  if (e.hasChildNodes())
251  {
252  QDomNode child = e.firstChild();
253  while(!child.isNull())
254  {
255  parseChildNodes(child, fg);
256  child = child.nextSibling();
257  }
258  }
259  }
260  }
261 }
262 
263 bool FeedList::readFromOpml(const QDomDocument& doc)
264 {
265  QDomElement root = doc.documentElement();
266 
267  kDebug() <<"loading OPML feed" << root.tagName().toLower();
268 
269  kDebug() <<"measuring startup time: START";
270  QTime spent;
271  spent.start();
272 
273  if (root.tagName().toLower() != QLatin1String("opml"))
274  {
275  return false;
276  }
277  QDomNode bodyNode = root.firstChild();
278 
279  while (!bodyNode.isNull() && bodyNode.toElement().tagName().toLower() != QLatin1String("body"))
280  bodyNode = bodyNode.nextSibling();
281 
282 
283  if (bodyNode.isNull())
284  {
285  kDebug() <<"Failed to acquire body node, markup broken?";
286  return false;
287  }
288 
289  QDomElement body = bodyNode.toElement();
290 
291  QDomNode i = body.firstChild();
292 
293  while( !i.isNull() )
294  {
295  parseChildNodes(i, allFeedsFolder());
296  i = i.nextSibling();
297  }
298 
299  for (TreeNode* i = allFeedsFolder()->firstChild(); i && i != allFeedsFolder(); i = i->next() )
300  if (i->id() == 0)
301  {
302  uint id = generateID();
303  i->setId(id);
304  d->idMap.insert(id, i);
305  }
306 
307  kDebug() <<"measuring startup time: STOP," << spent.elapsed() <<"ms";
308  kDebug() <<"Number of articles loaded:" << allFeedsFolder()->totalCount();
309  return true;
310 }
311 
312 FeedList::~FeedList()
313 {
314  emit signalDestroyed(this);
315  setRootNode(0);
316  delete d->addNodeVisitor;
317  delete d->removeNodeVisitor;
318  delete d;
319 }
320 
321 const Feed* FeedList::findByURL(const QString& feedURL) const
322 {
323  if ( !d->urlMap.contains( feedURL ) )
324  return 0;
325  const QList<Feed*>& v = d->urlMap[feedURL];
326  return !v.isEmpty() ? v.front() : 0;
327 }
328 
329 Feed* FeedList::findByURL(const QString& feedURL)
330 {
331  if ( !d->urlMap.contains( feedURL ) )
332  return 0;
333  const QList<Feed*>& v = d->urlMap[feedURL];
334  return !v.isEmpty() ? v.front() : 0;
335 }
336 
337 const Article FeedList::findArticle(const QString& feedURL, const QString& guid) const
338 {
339  const Feed* feed = findByURL(feedURL);
340  return feed ? feed->findArticle(guid) : Article();
341 }
342 
343 void FeedList::append(FeedList* list, Folder* parent, TreeNode* after)
344 {
345  if ( list == this )
346  return;
347 
348  if ( !d->flatList.contains(parent) )
349  parent = allFeedsFolder();
350 
351  QList<TreeNode*> children = list->allFeedsFolder()->children();
352 
353  QList<TreeNode*>::ConstIterator end( children.constEnd() );
354  for (QList<TreeNode*>::ConstIterator it = children.constBegin(); it != end; ++it)
355  {
356  list->allFeedsFolder()->removeChild(*it);
357  parent->insertChild(*it, after);
358  after = *it;
359  }
360 }
361 
362 QDomDocument FeedList::toOpml() const
363 {
364  QDomDocument doc;
365  doc.appendChild( doc.createProcessingInstruction( QLatin1String("xml"), QLatin1String("version=\"1.0\" encoding=\"UTF-8\"") ) );
366 
367  QDomElement root = doc.createElement( QLatin1String("opml") );
368  root.setAttribute( QLatin1String("version"), QLatin1String("1.0") );
369  doc.appendChild( root );
370 
371  QDomElement head = doc.createElement( QLatin1String("head") );
372  root.appendChild( head );
373 
374  QDomElement ti = doc.createElement( QLatin1String("text") );
375  head.appendChild( ti );
376 
377  QDomElement body = doc.createElement( QLatin1String("body") );
378  root.appendChild( body );
379 
380  foreach( const TreeNode* const i, allFeedsFolder()->children() )
381  body.appendChild( i->toOPML(body, doc) );
382 
383  return doc;
384 }
385 
386 const TreeNode* FeedList::findByID(int id) const
387 {
388  return d->idMap[id];
389 }
390 
391 TreeNode* FeedList::findByID(int id)
392 {
393  return d->idMap[id];
394 }
395 
396 QList<const TreeNode*> FeedList::findByTitle(const QString& title ) const
397 {
398  return allFeedsFolder()->namedChildren( title );
399 }
400 
401 QList<TreeNode*> FeedList::findByTitle(const QString& title )
402 {
403  return allFeedsFolder()->namedChildren( title );
404 }
405 
406 const Folder* FeedList::allFeedsFolder() const
407 {
408  return d->rootNode;
409 }
410 
411 Folder* FeedList::allFeedsFolder()
412 {
413  return d->rootNode;
414 }
415 
416 bool FeedList::isEmpty() const
417 {
418  return d->rootNode->firstChild() == 0;
419 }
420 
421 void FeedList::rootNodeChanged() {
422  assert( d->rootNode );
423  const int newUnread = d->rootNode->unread();
424  if ( newUnread == d->unreadCache )
425  return;
426  d->unreadCache = newUnread;
427  emit unreadCountChanged( newUnread );
428 }
429 
430 void FeedList::setRootNode(Folder* folder)
431 {
432  if ( folder == d->rootNode )
433  return;
434 
435  delete d->rootNode;
436  d->rootNode = folder;
437  d->unreadCache = -1;
438 
439  if ( d->rootNode ) {
440  d->rootNode->setOpen(true);
441  connect(d->rootNode, SIGNAL(signalChildAdded(Akregator::TreeNode*)), this, SLOT(slotNodeAdded(Akregator::TreeNode*)));
442  connect(d->rootNode, SIGNAL(signalAboutToRemoveChild(Akregator::TreeNode*)), this, SIGNAL(signalAboutToRemoveNode(Akregator::TreeNode*)));
443  connect(d->rootNode, SIGNAL(signalChildRemoved(Akregator::Folder*,Akregator::TreeNode*)), this, SLOT(slotNodeRemoved(Akregator::Folder*,Akregator::TreeNode*)));
444  connect( d->rootNode, SIGNAL(signalChanged(Akregator::TreeNode*)), this, SIGNAL(signalNodeChanged(Akregator::TreeNode*)) );
445  connect( d->rootNode, SIGNAL(signalChanged(Akregator::TreeNode*)), this, SLOT(rootNodeChanged()) );
446  }
447 }
448 
449 int FeedList::generateID() const
450 {
451  return KRandom::random();
452 }
453 
454 void FeedList::slotNodeAdded(TreeNode* node)
455 {
456  if (!node) return;
457 
458  Folder* parent = node->parent();
459  if ( !parent || !d->flatList.contains(parent) || d->flatList.contains(node) )
460  return;
461 
462  addNode(node, false);
463 }
464 
465 void FeedList::slotNodeDestroyed(TreeNode* node)
466 {
467  if ( !node || !d->flatList.contains(node) )
468  return;
469  removeNode(node);
470 }
471 
472 void FeedList::slotNodeRemoved(Folder* /*parent*/, TreeNode* node)
473 {
474  if ( !node || !d->flatList.contains(node) )
475  return;
476  removeNode(node);
477  emit signalNodeRemoved( node );
478 }
479 
480 int FeedList::unread() const {
481  if ( d->unreadCache == -1 )
482  d->unreadCache = d->rootNode ? d->rootNode->unread() : 0;
483  return d->unreadCache;
484 }
485 
486 void FeedList::addToFetchQueue( FetchQueue* qu, bool intervalOnly ) {
487  if ( d->rootNode )
488  d->rootNode->slotAddToFetchQueue( qu, intervalOnly );
489 }
490 
491 KJob* FeedList::createMarkAsReadJob() {
492  return d->rootNode ? d->rootNode->createMarkAsReadJob() : 0;
493 }
494 
495 FeedListManagementImpl::FeedListManagementImpl( const shared_ptr<FeedList>& list ) : m_feedList( list )
496 {
497 
498 }
499 
500 void FeedListManagementImpl::setFeedList( const shared_ptr<FeedList>& list )
501 {
502  m_feedList = list;
503 }
504 
505 static QString path_of_folder( const Folder* fol )
506 {
507  assert( fol );
508  QString path;
509  const Folder* i = fol;
510  while ( i ) {
511  path = QString::number( i->id() ) + QLatin1Char('/') + path;
512  i = i->parent();
513  }
514  return path;
515 }
516 
517 QStringList FeedListManagementImpl::categories() const
518 {
519  if ( !m_feedList )
520  return QStringList();
521  QStringList cats;
522  Q_FOREACH ( const Folder* const i, m_feedList->folders() )
523  cats.append( path_of_folder( i ) );
524  return cats;
525 }
526 
527 QStringList FeedListManagementImpl::feeds( const QString& catId ) const
528 {
529  if ( !m_feedList )
530  return QStringList();
531 
532  uint lastcatid = catId.split(QLatin1Char('/'),QString::SkipEmptyParts).last().toUInt();
533 
534  QSet<QString> urls;
535  Q_FOREACH ( const Feed* const i, m_feedList->feeds() ) {
536  if ( lastcatid == i->parent()->id() ) {
537  urls.insert( i->xmlUrl() );
538  }
539  }
540  return urls.toList();
541 }
542 
543 void FeedListManagementImpl::addFeed( const QString& url, const QString& catId )
544 {
545  if ( !m_feedList )
546  return;
547 
548  kDebug() << "Name:" << url.left(20) << "Cat:" << catId;
549  uint folder_id = catId.split(QLatin1Char('/'),QString::SkipEmptyParts).last().toUInt();
550 
551  // Get the folder
552  Folder * m_folder = 0;
553  QVector<Folder*> vector = m_feedList->folders();
554  for (int i = 0; i < vector.size(); ++i) {
555  if (vector.at(i)->id() == folder_id) {
556  m_folder = vector.at(i);
557  i = vector.size();
558  }
559  }
560 
561  // Create new feed
562  std::auto_ptr<FeedList> new_feedlist( new FeedList( Kernel::self()->storage() ) );
563  Feed * new_feed = new Feed( Kernel::self()->storage() );
564  new_feed->setXmlUrl(url);
565  // new_feed->setTitle(url);
566  new_feedlist->allFeedsFolder()->appendChild(new_feed);
567 
568  // Get last in the folder
569  TreeNode* m_last = m_folder->childAt( m_folder->totalCount() );
570 
571  // Add the feed
572  m_feedList->append(new_feedlist.get(), m_folder, m_last);
573 }
574 
575 void FeedListManagementImpl::removeFeed( const QString& url, const QString& catId )
576 {
577  kDebug() << "Name:" << url.left(20) << "Cat:" << catId;
578 
579  uint lastcatid = catId.split(QLatin1Char('/'),QString::SkipEmptyParts).last().toUInt();
580 
581  Q_FOREACH ( const Feed* const i, m_feedList->feeds() ) {
582  if ( lastcatid == i->parent()->id() ) {
583  if (i->xmlUrl().compare(url)==0) {
584  kDebug() << "id:" << i->id();
585  DeleteSubscriptionJob* job = new DeleteSubscriptionJob;
586  job->setSubscriptionId( i->id() );
587  job->start();
588  }
589  }
590  }
591 }
592 
593 QString FeedListManagementImpl::addCategory( const QString& name, const QString& parentId ) const
594 {
595  Q_UNUSED( parentId )
596 
597  if ( !m_feedList )
598  return QLatin1String("");
599 
600  Folder * m_folder = new Folder(name);
601  m_feedList->allFeedsFolder()->appendChild(m_folder);
602 
603  return QString::number(m_folder->id());
604 }
605 
606 QString FeedListManagementImpl::getCategoryName( const QString& catId ) const
607 {
608  QString catname;
609 
610  if ( !m_feedList )
611  return catname;
612 
613  QStringList list = catId.split(QLatin1Char('/'),QString::SkipEmptyParts);
614  for (int i=0;i<list.size();++i) {
615  int index = list.at(i).toInt();
616  catname += m_feedList->findByID(index)->title() + QLatin1Char('/');
617  }
618 
619  return catname;
620 }
621 
622 } // namespace Akregator
623 
treenode.h
QObject::child
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
Akregator::FeedList::signalDestroyed
void signalDestroyed(Akregator::FeedList *)
Akregator::FeedList::signalNodeRemoved
void signalNodeRemoved(Akregator::TreeNode *)
emitted when a node was removed from the list
QDomDocument::createProcessingInstruction
QDomProcessingInstruction createProcessingInstruction(const QString &target, const QString &data)
Akregator::FeedList::FeedList
FeedList(Akregator::Backend::Storage *storage)
Definition: feedlist.cpp:175
feedlist.h
QDomNode::appendChild
QDomNode appendChild(const QDomNode &newChild)
QVector::append
void append(const T &value)
Akregator::Feed::fromOPML
static Feed * fromOPML(QDomElement e, Akregator::Backend::Storage *storage)
creates a Feed object from a description in OPML format
Definition: feed.cpp:134
kernel.h
QString::split
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
Akregator::Folder::fromOPML
static Folder * fromOPML(const QDomElement &e)
creates a feed group parsed from a XML dom element.
Definition: folder.cpp:83
Akregator::FeedList::findByTitle
QList< const TreeNode * > findByTitle(const QString &title) const
Definition: feedlist.cpp:396
QList::at
const T & at(int i) const
QObject::children
const QObjectList & children() const
Akregator::FeedList::~FeedList
~FeedList()
Destructor.
Definition: feedlist.cpp:312
Akregator::FeedListManagementImpl::feeds
QStringList feeds(const QString &catId) const
Definition: feedlist.cpp:527
uint
unsigned int uint
Definition: article.h:41
Akregator::FeedList::findArticle
const Article findArticle(const QString &feedURL, const QString &guid) const
Definition: feedlist.cpp:337
Akregator::Backend::Storage
Storage is the main interface to the article archive.
Definition: storage.h:43
QDomDocument::documentElement
QDomElement documentElement() const
QDomNode
Akregator::TreeNode::setId
virtual void setId(uint id)
sets the ID
Definition: treenode.cpp:203
QSet::insert
const_iterator insert(const T &value)
Akregator::Folder::removeChild
void removeChild(TreeNode *node)
remove node from children.
Definition: folder.cpp:249
Akregator::FeedList::signalAboutToRemoveNode
void signalAboutToRemoveNode(Akregator::TreeNode *)
QTime
Akregator::FeedList::unread
int unread() const
Definition: feedlist.cpp:480
feed.h
QList::size
int size() const
Akregator::FeedListManagementImpl::categories
QStringList categories() const
Definition: feedlist.cpp:517
QDomNode::nextSibling
QDomNode nextSibling() const
Akregator::TreeNode::toOPML
virtual QDomElement toOPML(QDomElement parent, QDomDocument document) const =0
exports node and child nodes to OPML (with akregator settings)
Akregator::TreeNode::parent
virtual const Folder * parent() const
Returns the parent node.
Definition: treenode.cpp:141
Akregator::FeedListManagementImpl::removeFeed
void removeFeed(const QString &url, const QString &catId)
Definition: feedlist.cpp:575
treenodevisitor.h
Akregator::FeedList
The model of a feed tree, represents an OPML document.
Definition: feedlist.h:78
QDomNode::toElement
QDomElement toElement() const
Akregator::Folder::childAt
TreeNode * childAt(int pos)
Definition: folder.cpp:379
QTime::elapsed
int elapsed() const
QString::number
QString number(int n, int base)
Akregator::FeedList::folders
QVector< const Folder * > folders() const
returns all folders in this list
Definition: feedlist.cpp:204
QList::append
void append(const T &value)
QDomElement::hasAttribute
bool hasAttribute(const QString &name) const
QHash
Definition: feedlist.h:41
QObject
QDomElement::setAttribute
void setAttribute(const QString &name, const QString &value)
QList::isEmpty
bool isEmpty() const
Akregator::Kernel::self
static Kernel * self()
Definition: kernel.cpp:39
Akregator::DeleteSubscriptionJob::start
void start()
Definition: subscriptionlistjobs.cpp:135
Akregator::FeedList::findByURL
const Feed * findByURL(const QString &feedURL) const
returns a feed object for a given feed URL.
Definition: feedlist.cpp:321
Akregator::FeedList::signalNodeChanged
void signalNodeChanged(Akregator::TreeNode *)
Akregator::DeleteSubscriptionJob::setSubscriptionId
void setSubscriptionId(int id)
Definition: subscriptionlistjobs.cpp:130
Akregator::FeedList::createMarkAsReadJob
KJob * createMarkAsReadJob()
Definition: feedlist.cpp:491
Akregator::FeedList::feeds
QVector< const Feed * > feeds() const
returns all feeds in this list
Definition: feedlist.cpp:191
Akregator::Feed::xmlUrl
QString xmlUrl() const
returns the url of the actual feed source (rss/rdf/atom file)
Definition: feed.cpp:372
Akregator::Folder::children
QList< const TreeNode * > children() const
returns the (direct) children of this node.
Definition: folder.cpp:124
Akregator::FeedList::isEmpty
bool isEmpty() const
Definition: feedlist.cpp:416
QSet
Akregator::FeedList::readFromOpml
bool readFromOpml(const QDomDocument &doc)
reads an OPML document and appends the items to this list
Definition: feedlist.cpp:263
QList::front
T & front()
QString
QList
Definition: article.h:41
article.h
Akregator::FeedListManagementImpl::getCategoryName
QString getCategoryName(const QString &catId) const
Definition: feedlist.cpp:606
storage.h
Akregator::FeedListManagementImpl::addCategory
QString addCategory(const QString &name, const QString &parentId) const
Definition: feedlist.cpp:593
QDomNode::hasChildNodes
bool hasChildNodes() const
QStringList
Akregator::FeedList::findByID
const TreeNode * findByID(int id) const
Definition: feedlist.cpp:386
QString::toLower
QString toLower() const
Akregator::path_of_folder
static QString path_of_folder(const Folder *fol)
Definition: feedlist.cpp:505
QLatin1Char
QDomDocument
folder.h
QDomNode::isNull
bool isNull() const
Akregator::FeedListManagementImpl::setFeedList
void setFeedList(const boost::shared_ptr< FeedList > &list)
Definition: feedlist.cpp:500
QVector::at
const T & at(int i) const
Akregator::DeleteSubscriptionJob
Definition: subscriptionlistjobs.h:83
Akregator::FeedList::append
void append(FeedList *list, Folder *parent=0, TreeNode *after=0)
appends another feed list as sub tree.
Definition: feedlist.cpp:343
Akregator::Feed::setXmlUrl
void setXmlUrl(const QString &s)
sets the url of the actual feed source (rss/rdf/atom file)
Definition: feed.cpp:374
QDomNode::firstChild
QDomNode firstChild() const
QVector< int >
Akregator::FeedList::feedIds
QVector< int > feedIds() const
Definition: feedlist.cpp:183
QLatin1String
Akregator::Feed
represents a feed
Definition: feed.h:53
Akregator::Folder
Represents a folder (containing feeds and/or other folders)
Definition: folder.h:44
Akregator::Feed::findArticle
Article findArticle(const QString &guid) const
returns article by guid
Definition: feed.cpp:210
QList::last
T & last()
Akregator::FeedList::allFeedsFolder
const Folder * allFeedsFolder() const
Definition: feedlist.cpp:406
Akregator::Folder::totalCount
int totalCount() const
returns the number of articles in all children
Definition: folder.cpp:301
Akregator::Folder::namedChildren
QList< const TreeNode * > namedChildren(const QString &title) const
Definition: folder.cpp:431
QString::left
QString left(int n) const
Akregator::FeedListManagementImpl::addFeed
void addFeed(const QString &url, const QString &catId)
Definition: feedlist.cpp:543
Akregator::Article
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:63
QSet::toList
QList< T > toList() const
QTime::start
void start()
subscriptionlistjobs.h
QDomElement::tagName
QString tagName() const
QList::constEnd
const_iterator constEnd() const
QDomDocument::createElement
QDomElement createElement(const QString &tagName)
QList::constBegin
const_iterator constBegin() const
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QVector::size
int size() const
Akregator::FeedList::unreadCountChanged
void unreadCountChanged(int unread)
QDomElement
QString::compare
int compare(const QString &other) const
Akregator::TreeNode
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:58
Akregator::TreeNode::id
virtual uint id() const
returns the ID of this node.
Definition: treenode.cpp:198
Akregator::Folder::insertChild
void insertChild(TreeNode *node, TreeNode *after)
inserts node as child after child node after.
Definition: folder.cpp:180
KJob
Akregator::FetchQueue
Definition: fetchqueue.h:37
Akregator::FeedList::addToFetchQueue
void addToFetchQueue(FetchQueue *queue, bool intervalOnly=false)
Definition: feedlist.cpp:486
Akregator::FeedList::toOpml
QDomDocument toOpml() const
exports the feed list as OPML.
Definition: feedlist.cpp:362
Akregator::FeedListManagementImpl::FeedListManagementImpl
FeedListManagementImpl(const boost::shared_ptr< FeedList > &list=boost::shared_ptr< FeedList >())
Definition: feedlist.cpp:495
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