akregator
feed.cpp
Go to the documentation of this file.
137 if( !e.hasAttribute(QLatin1String("xmlUrl")) && !e.hasAttribute(QLatin1String("xmlurl")) && !e.hasAttribute(QLatin1String("xmlURL")) )
140 QString title = e.hasAttribute(QLatin1String("text")) ? e.attribute(QLatin1String("text")) : e.attribute(QLatin1String("title"));
142 QString xmlUrl = e.hasAttribute(QLatin1String("xmlUrl")) ? e.attribute(QLatin1String("xmlUrl")) : e.attribute(QLatin1String("xmlurl"));
146 bool useCustomFetchInterval = e.attribute(QLatin1String("useCustomFetchInterval")) == QLatin1String("true");
154 bool markImmediatelyAsRead = e.attribute(QLatin1String("markImmediatelyAsRead")) == QLatin1String("true");
156 bool loadLinkedWebsite = e.attribute(QLatin1String("loadLinkedWebsite")) == QLatin1String("true");
310 Akregator::Feed::Feed( Backend::Storage* storage ) : TreeNode(), d( new Private( storage, this ) )
337 void Akregator::Feed::setMaxArticleNumber(int maxArticleNumber) { d->maxArticleNumber = maxArticleNumber; }
378 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...
389 bool Akregator::Feed::fetchErrorOccurred() const { return d->fetchErrorCode != Syndication::Success; }
404 el.setAttribute( QLatin1String("useCustomFetchInterval"), (useCustomFetchInterval() ? QLatin1String("true") : QLatin1String("false")) );
416 el.setAttribute( QLatin1String("type"), QLatin1String("rss") ); // despite some additional fields, it is still "rss" OPML
496 // 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.
523 // delete articles with delete flag set completely from archive, which aren't in the current feed source anymore
541 return ( d->archiveMode == globalDefault && Settings::archiveMode() == Settings::EnumArchiveMode::limitArticleAge) || d->archiveMode == limitArticleAge;
549 if ( d->archiveMode == globalDefault && Settings::archiveMode() == Settings::EnumArchiveMode::limitArticleAge)
560 if ( (a.keep() && Settings::doNotExpireImportantArticles()) || ( !usesExpiryByAge() || !isExpired(a) ) ) // if not expired
618 void Akregator::Feed::fetchCompleted(Syndication::Loader *l, Syndication::FeedPtr doc, Syndication::ErrorCode status)
631 else if (d->followDiscovery && (status == Syndication::InvalidXml) && (d->fetchTries < 3) && (l->discoveredFeedURL().isValid()))
656 QString imageFileName = KGlobal::dirs()->saveLocation("cache", QLatin1String("akregator/Media/"))
732 d->imagePixmap.save(KGlobal::dirs()->saveLocation("cache", QString(QLatin1String("akregator/Media/"))+ Utils::fileNameForUrl(d->xmlUrl) + QLatin1String(".png")),"PNG");
788 d->totalCount = std::count_if( d->articles.constBegin(), d->articles.constEnd(), !bind( &Article::isDeleted, _1 ) );
857 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:331
bool useCustomFetchInterval() const
returns whether this feed uses its own fetch interval or the global setting
Definition: feed.cpp:323
iterator remove(iterator pos)
QDomNode appendChild(const QDomNode &newChild)
void removeListener(FaviconListener *listener)
Definition: feediconmanager.cpp:134
void append(const T &value)
void setMarkImmediatelyAsRead(bool enabled)
Definition: feed.cpp:343
QDomElement toOPML(QDomElement parent, QDomDocument document) const
exports the feed settings to OPML
Definition: feed.cpp:395
static Feed * fromOPML(QDomElement e, Akregator::Backend::Storage *storage)
creates a Feed object from a description in OPML format
Definition: feed.cpp:134
QString attribute(const QString &name, const QString &defValue) const
static QString fileNameForUrl(const QString &url)
returns a file name for a URL, with chars like "/" ":" replaced by "_".
Definition: utils.cpp:42
void slotNotifyArticle(const Akregator::Article &article)
notifies an article.
Definition: notificationmanager.cpp:60
bool markImmediatelyAsRead() const
if true, new articles are marked immediately as read instead of new/unread.
Definition: feed.cpp:339
Storage is the main interface to the article archive.
Definition: storage.h:43
void setMaxArticleNumber(int maxArticleNumber)
sets the article count limit used in limitArticleNumber archive mode
Definition: feed.cpp:337
article was fetched in the last fetch of it's feed and not read yet.
Definition: types.h:33
QString number(int n, int base)
void append(const T &value)
bool save(const QString &fileName, const char *format, int quality) const
Syndication::ErrorCode fetchErrorCode() const
Definition: feed.cpp:391
bool hasAttribute(const QString &name) const
Definition: feedlist.h:41
static NotificationManager * self()
singleton instance of notification manager
Definition: notificationmanager.cpp:130
void setAttribute(const QString &name, const QString &value)
int toInt(bool *ok, int base) const
bool isEmpty() const
int removeAll(const T &value)
ArchiveMode archiveMode() const
returns the archiving mode which is used for this feed
Definition: feed.cpp:736
Definition: articlejobs.h:88
QString xmlUrl() const
returns the url of the actual feed source (rss/rdf/atom file)
Definition: feed.cpp:372
Definition: feedstorage.h:66
Definition: article.h:41
Definition: articlejobs.h:48
uint hash() const
returns a hash value used to detect changes in articles with non-hash GUIDs.
Definition: article.cpp:490
iterator end()
bool isArticlesLoaded() const
returns if the article archive of this feed is loaded
Definition: feed.cpp:393
bool isNull() const
void setLoadLinkedWebsite(bool enabled)
if true, the linked URL is loaded directly in the article viewer instead of showing the description ...
Definition: feed.cpp:360
void appendArticleIds(const Akregator::ArticleIdList &ids)
Definition: articlejobs.cpp:47
uint toTime_t() const
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:433
void setXmlUrl(const QString &s)
sets the url of the actual feed source (rss/rdf/atom file)
Definition: feed.cpp:374
QDateTime currentDateTime()
Definition: articlejobs.h:69
int secsTo(const QDateTime &other) const
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:270
Represents a folder (containing feeds and/or other folders)
Definition: folder.h:44
void deleteExpiredArticles(Akregator::ArticleDeleteJob *job)
deletes expired articles
Definition: feed.cpp:696
typedef ConstIterator
void setArchiveMode(ArchiveMode archiveMode)
sets the archiving mode for this feed
Definition: feed.cpp:741
void addListener(const KUrl &url, FaviconListener *listener)
Definition: feediconmanager.cpp:123
int maxArticleNumber() const
returns the article count limit used in limitArticleNumber archive mode
Definition: feed.cpp:335
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:63
const_iterator constEnd() const
QDomElement createElement(const QString &tagName)
const_iterator constBegin() const
void setMaxArticleAge(int maxArticleAge)
sets the maximum age of articles used for expiration by age (used in limitArticleAge archive mode) ...
Definition: feed.cpp:333
void setHtmlUrl(const QString &s)
sets the URL of the HTML page of this feed
Definition: feed.cpp:383
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:58
iterator begin()
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:325
virtual bool visitTreeNode(TreeNode *)
Definition: treenodevisitor.h:40
static QString archiveModeToString(ArchiveMode mode)
converts ArchiveMode values to corresponding strings
Definition: feed.cpp:116
uint toUInt(bool *ok, int base) const
singleShot
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
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.