akregator
feed.cpp
Go to the documentation of this file.
135 if( !e.hasAttribute(QLatin1String("xmlUrl")) && !e.hasAttribute(QLatin1String("xmlurl")) && !e.hasAttribute(QLatin1String("xmlURL")) )
138 QString title = e.hasAttribute(QLatin1String("text")) ? e.attribute(QLatin1String("text")) : e.attribute(QLatin1String("title"));
140 QString xmlUrl = e.hasAttribute(QLatin1String("xmlUrl")) ? e.attribute(QLatin1String("xmlUrl")) : e.attribute(QLatin1String("xmlurl"));
144 bool useCustomFetchInterval = e.attribute(QLatin1String("useCustomFetchInterval")) == QLatin1String("true");
152 bool markImmediatelyAsRead = e.attribute(QLatin1String("markImmediatelyAsRead")) == QLatin1String("true");
154 bool loadLinkedWebsite = e.attribute(QLatin1String("loadLinkedWebsite")) == QLatin1String("true");
312 Akregator::Feed::Feed( Backend::Storage* storage ) : TreeNode(), d( new Private( storage, this ) )
339 void Akregator::Feed::setMaxArticleNumber(int maxArticleNumber) { d->maxArticleNumber = maxArticleNumber; }
380 QTimer::singleShot(KRandom::random() % 4000, this, SLOT(slotAddFeedIconListener())); // TODO: let's give a gui some time to show up before starting the fetch when no fetch on startup is used. replace this with something proper later...
391 bool Akregator::Feed::fetchErrorOccurred() const { return d->fetchErrorCode != Syndication::Success; }
406 el.setAttribute( QLatin1String("useCustomFetchInterval"), (useCustomFetchInterval() ? QLatin1String("true") : QLatin1String("false")) );
418 el.setAttribute( QLatin1String("type"), QLatin1String("rss") ); // despite some additional fields, it is still "rss" OPML
498 // if the article's guid is no hash but an ID, we have to check if the article was updated. That's done by comparing the hash values.
525 // delete articles with delete flag set completely from archive, which aren't in the current feed source anymore
543 return ( d->archiveMode == globalDefault && Settings::archiveMode() == Settings::EnumArchiveMode::limitArticleAge) || d->archiveMode == limitArticleAge;
551 if ( d->archiveMode == globalDefault && Settings::archiveMode() == Settings::EnumArchiveMode::limitArticleAge)
562 if ( (a.keep() && Settings::doNotExpireImportantArticles()) || ( !usesExpiryByAge() || !isExpired(a) ) ) // if not expired
620 void Akregator::Feed::fetchCompleted(Syndication::Loader *l, Syndication::FeedPtr doc, Syndication::ErrorCode status)
633 else if (d->followDiscovery && (status == Syndication::InvalidXml) && (d->fetchTries < 3) && (l->discoveredFeedURL().isValid()))
658 QString imageFileName = KGlobal::dirs()->saveLocation("cache", QLatin1String("akregator/Media/"))
734 d->imagePixmap.save(KGlobal::dirs()->saveLocation("cache", QString(QLatin1String("akregator/Media/"))+ Utils::fileNameForUrl(d->xmlUrl) + QLatin1String(".png")),"PNG");
790 d->totalCount = std::count_if( d->articles.constBegin(), d->articles.constEnd(), !bind( &Article::isDeleted, _1 ) );
859 if (d->archiveMode == globalDefault && Settings::archiveMode() == Settings::EnumArchiveMode::limitArticleNumber)
int maxArticleAge() const
returns the maximum age of articles used for expiration by age (used in limitArticleAge archive mode)...
Definition: feed.cpp:333
bool useCustomFetchInterval() const
returns whether this feed uses its own fetch interval or the global setting
Definition: feed.cpp:325
void removeListener(FaviconListener *listener)
Definition: feediconmanager.cpp:136
void setMarkImmediatelyAsRead(bool enabled)
Definition: feed.cpp:345
QDomElement toOPML(QDomElement parent, QDomDocument document) const
exports the feed settings to OPML
Definition: feed.cpp:397
static Feed * fromOPML(QDomElement e, Akregator::Backend::Storage *storage)
creates a Feed object from a description in OPML format
Definition: feed.cpp:132
static QString fileNameForUrl(const QString &url)
returns a file name for a URL, with chars like "/" ":" replaced by "_".
Definition: utils.cpp:42
static bool doNotExpireImportantArticles()
Get Do Not Expire Important Articles.
Definition: akregatorconfig.h:429
void slotNotifyArticle(const Akregator::Article &article)
notifies an article.
Definition: notificationmanager.cpp:61
bool markImmediatelyAsRead() const
if true, new articles are marked immediately as read instead of new/unread.
Definition: feed.cpp:341
Storage is the main interface to the article archive.
Definition: storage.h:43
Definition: feedlist.h:40
void setMaxArticleNumber(int maxArticleNumber)
sets the article count limit used in limitArticleNumber archive mode
Definition: feed.cpp:339
article was fetched in the last fetch of it's feed and not read yet.
Definition: types.h:33
Syndication::ErrorCode fetchErrorCode() const
Definition: feed.cpp:393
static NotificationManager * self()
singleton instance of notification manager
Definition: notificationmanager.cpp:131
ArchiveMode archiveMode() const
returns the archiving mode which is used for this feed
Definition: feed.cpp:738
Definition: articlejobs.h:86
QString xmlUrl() const
returns the url of the actual feed source (rss/rdf/atom file)
Definition: feed.cpp:374
Definition: feedstorage.h:66
Definition: articlejobs.h:46
uint hash() const
returns a hash value used to detect changes in articles with non-hash GUIDs.
Definition: article.cpp:490
bool isArticlesLoaded() const
returns if the article archive of this feed is loaded
Definition: feed.cpp:395
void setLoadLinkedWebsite(bool enabled)
if true, the linked URL is loaded directly in the article viewer instead of showing the description ...
Definition: feed.cpp:362
void appendArticleIds(const Akregator::ArticleIdList &ids)
Definition: articlejobs.cpp:47
virtual void doArticleNotification()
reimplement this in subclasses to do the actual notification called by articlesModified ...
Definition: treenode.cpp:224
void slotAddToFetchQueue(Akregator::FetchQueue *queue, bool intervalFetchOnly=false)
add this feed to the fetch queue queue
Definition: feed.cpp:435
void setXmlUrl(const QString &s)
sets the url of the actual feed source (rss/rdf/atom file)
Definition: feed.cpp:376
Definition: articlejobs.h:67
Definition: treenodevisitor.h:35
static ArchiveMode stringToArchiveMode(const QString &str)
converts strings to ArchiveMode value if parsing fails, it returns ArchiveMode::globalDefault ...
Definition: feed.cpp:272
Represents a folder (containing feeds and/or other folders)
Definition: folder.h:44
void deleteExpiredArticles(Akregator::ArticleDeleteJob *job)
deletes expired articles
Definition: feed.cpp:698
void setArchiveMode(ArchiveMode archiveMode)
sets the archiving mode for this feed
Definition: feed.cpp:743
void addListener(const KUrl &url, FaviconListener *listener)
Definition: feediconmanager.cpp:125
int maxArticleNumber() const
returns the article count limit used in limitArticleNumber archive mode
Definition: feed.cpp:337
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:61
void setMaxArticleAge(int maxArticleAge)
sets the maximum age of articles used for expiration by age (used in limitArticleAge archive mode) ...
Definition: feed.cpp:335
void setHtmlUrl(const QString &s)
sets the URL of the HTML page of this feed
Definition: feed.cpp:385
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:59
Definition: fetchqueue.h:37
void setCustomFetchIntervalEnabled(bool enabled)
set if the feed has its custom fetch interval or uses the global setting
Definition: feed.cpp:327
Definition: article.h:39
virtual bool visitTreeNode(TreeNode *)
Definition: treenodevisitor.h:40
static QString archiveModeToString(ArchiveMode mode)
converts ArchiveMode values to corresponding strings
Definition: feed.cpp:114
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:14 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:14 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.