Commit 13b401c8 authored by Thomas McGuire's avatar Thomas McGuire

Merged revisions 853769 via svnmerge from

svn+ssh://tmcguire@svn.kde.org/home/kde/branches/kdepim/enterprise4/kdepim

................
  r853769 | ervin | 2008-08-28 11:13:26 +0200 (Thu, 28 Aug 2008) | 38 lines
  
  Merged revisions 736379,736391 via svnmerge from 
  svn+ssh://ervin@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim
  
  ................
    r736379 | pradeepto | 2007-11-14 04:32:14 +0100 (Wed, 14 Nov 2007) | 14 lines
    
    Merged revisions 721755-721843 via svnmerge from 
    svn+ssh://pradeepto@svn.kde.org/home/kde/branches/KDE/3.5/kdepim
    
    ........
      r721755 | ewoerner | 2007-10-06 06:40:08 +0530 (Sat, 06 Oct 2007) | 2 lines
      
      Fix storage backend waking up CPU every 3 seconds, original patch by Alan Jenkins, bump version number
      BUG: 150389
    ........
      r721843 | tstaerk | 2007-10-06 12:39:58 +0530 (Sat, 06 Oct 2007) | 1 line
      
      removing duplicate code
    ........
  ................
    r736391 | pradeepto | 2007-11-14 05:42:23 +0100 (Wed, 14 Nov 2007) | 15 lines
    
    Merged revisions 720156-720287,720289-720299,720302,720304-720927,720929-721118 via svnmerge from 
    svn+ssh://pradeepto@svn.kde.org/home/kde/branches/KDE/3.5/kdepim
    
    ........
      r720156 | orlovich | 2007-10-02 20:45:38 +0530 (Tue, 02 Oct 2007) | 4 lines
      
      Initialize this; as the slots with shortcuts don't have to go 
      through the context menu. The use of uninitialized value is 
      harmless here, but it clutters vg logs.
    ........
      r721118 | jriddell | 2007-10-04 21:51:20 +0530 (Thu, 04 Oct 2007) | 1 line
      
      remove duplicate include
    ........
  ................
................

svn path=/trunk/KDE/kdepim/akregator/; revision=855175
parent 64809602
Akregator ChangeLog
===================
(c) 2004, 2005 the Akregator authors.
(c) 2004-2007 the Akregator authors.
Changes after 1.2.7:
-----------------------------
Bug fixes:
2007/10/05 Fix storage backend waking up CPU every 3 seconds (#150389) -ew
Original patch by Alan Jenkins
Changes after 1.2.6:
-----------------------------
Bug fixes:
2007/02/24 fix crash when using "Load the full website when reading articles" and an error (e.g. 404)
is returned (2nd try) (#126812) -fo
Changes after 1.2.5:
-----------------------------
Bug fixes:
2006/11/30 Use "firefox %u" as default for the alternative browser command (#115777)
2006/11/24 Add session management for browser tabs (#100964) Patch by Carsten Pfeiffer <pfeiffer at kde.org> -fo
2006/11/10 Fix crash in Konqueror icon plugin sometimes happening when switching parts (#134929) -fo
2006/10/31 Fix group name encoding bug when adding feeds from commandline (e.g., using the Konq plugin) (#136559)
Patch by Andrey Cherepanov.
Changes after 1.2.4:
-----------------------------
Bug fixes:
2006/09/18 Set default font sizes, prevents use of font size 1 in article viewer on first startup -fo
2006/08/28 Do not create multiple items in the feed lists when dragging feeds to a folder
that was moved before (#124303) -fo
2006/08/26 Fix a possible crash in the internal browser when going forward -fo
2006/08/26 show error messages while browsing as HTML, not as annoying popups (#107740) -fo
2006/08/25 Show title of selected feed in window caption (#111471) -fo
2006/08/25 Konqueror plugins: correctly enable/disable icon when enabling/disabling the plugin (#132823) -fo
2006/08/21 Don't crash on very long URLs (>255 chars) used for feed logos (#130849) -fo
2006/08/20 Konqueror plugins: Fix crash when using the Akregator plugin in file manager mode (#124891) -fo
2006/08/20 Feed detection: Fix detection when relative URLs are used in the link tags (#132687) -fo
2006/08/17 Speak selected text in internal browser when using the "Speak Text" button (#132505) -fo
Changes after 1.2.3:
-----------------------------
Bug fixes:
2006/07/07 Remove tray icon when disabling Akregator part in Kontact (#130127) -fo
2006/07/07 Fix a crash on shutdown occurring in ProgressManager (#130377) -fo
2006/06/25 Fix context menus in browser tab, show appriopriate entries when
text is selected (copy action) or the cursor is over a link
(#121957) -fo
Changes after 1.2.2:
-----------------------------
New features:
2006/05/01 add author information to article header (in the article pane only) -fo
Bug fixes:
2006/05/20 Select oldest item instead of newest when jumping to the next feed using previous [unread]
article actions (#126316) -fo
2006/05/20 Disable Apply-Button in config dialog correctly if no changes were made (#103820) -fo
2006/05/20 Don't reset article status to New when the article changed (#101907) -fo
2006/05/10 Always show feed logos; load them on startup, not on first fetch -fo
2006/05/10 fix crash when using "Load the full website when reading articles" and an error (e.g. 404)
is returned (#126812) -fo
2006/04/29 Do not crash on startup when Combined View mode is activated (Happened only when experimental tagging is
activated) -fo
2006/03/22 Prevent "Akregator is running" messages on startup (reset PID to -1 when closing akregator) -fo
Changes after 1.2.1:
-----------------------------
Bug fixes:
2006/03/09 Read more feed metadata for Atom feeds (title, link) (#123140) -fo
2006/03/09 Use "refresh" cache mode as default, ignoring konq settings.
("refresh" == Use cache after verifying with server)
This should make disabling the "Use browser cache" option unnecessary. -fo
2006/02/21 Set "rel" attribute default to "alternate", as requested by Atom specification (#122409) -ew
2006/02/21 Disable category and tag support (unless experimental GUI is enabled) in the metakit backend,
so it supports about 1000 feeds (500 with tags enabled) instead of 340
now with the default 1024 open files limit on most systems. -fo
2006/02/15 Combined View: Do not crash on "Next/Prev Unread Article" (#121999) -fo
2006/01/31 RSS parser: ignore unknown or invalid version attribute value in the <rss> tag and
just assume RSS 2.0. The older formats are compatible to 2.0, so this should work.
(at least better than refusing to parse the feeds) (#118793) -fo
Changes after 1.2:
-----------------------------
Bug fixes:
2006/01/17 Do not open binary files in the HTML viewer but externally.
Fix Save Link As for binary files (regression introduced after 1.2)
(#120087 (partially)) -fo
2006/01/16 Fix article order in Combined View: sort by date (reversed) (#118055) -fo
2006/01/15 Fix parsing of Atom 1.0 feeds with escaped HTML in it: Don't show tags
as text (#112491, #117938) -fo
2006/01/10 Select next item in article list when deleting the selected article
(single selection mode only) (#119724) -fo
2006/01/10 Fix item handling in the feed list, avoid crashes as happening
after moving a folder and deleting a subitem afterwards
(#118659) -fo
2006/01/08 Fix problems with keyboard navigation getting stuck on duplicated
articles and prevent creation of new items when selecting an unread
dupe (#114997) -fo
2005/12/05 Wait 30 minutes before retrying fetching when fetching failed (host
down, parsing error) (#113358) -fo
Changes after 1.0:
-----------------------------
......
......@@ -128,7 +128,7 @@ void FeedStorageMK4Impl::convertOldArchive()
QList<Syndication::ItemPtr> items = feed->items();
QList<Syndication::ItemPtr>::ConstIterator it = items.begin();
QList<Syndication::ItemPtr>::ConstIterator en = items.end();
d->modified = true;
markDirty();
commit();
}
}
......@@ -179,6 +179,16 @@ FeedStorageMK4Impl::~FeedStorageMK4Impl()
delete d; d = 0;
}
void FeedStorageMK4Impl::markDirty()
{
if (!d->modified)
{
d->modified = true;
// Tell this to mainStorage
d->mainStorage->markDirty();
}
}
void FeedStorageMK4Impl::commit()
{
if (d->modified)
......@@ -286,7 +296,7 @@ void FeedStorageMK4Impl::addEntry(const QString& guid)
if (!contains(guid))
{
d->archiveView.Add(row);
d->modified = true;
markDirty();
setTotalCount(totalCount()+1);
}
}
......@@ -314,7 +324,7 @@ void FeedStorageMK4Impl::deleteArticle(const QString& guid)
removeTag(guid, *it);
setTotalCount(totalCount()-1);
d->archiveView.RemoveAt(findidx);
d->modified = true;
markDirty();
}
}
......@@ -369,7 +379,7 @@ void FeedStorageMK4Impl::setDeleted(const QString& guid)
d->pauthorEMail(row) = "";
d->pcommentsLink(row) = "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
QString FeedStorageMK4Impl::link(const QString& guid) const
......@@ -399,7 +409,7 @@ void FeedStorageMK4Impl::setStatus(const QString& guid, int status)
row = d->archiveView.GetAt(findidx);
d->pstatus(row) = status;
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
QString FeedStorageMK4Impl::title(const QString& guid) const
......@@ -430,7 +440,7 @@ void FeedStorageMK4Impl::setPubDate(const QString& guid, uint pubdate)
row = d->archiveView.GetAt(findidx);
d->ppubDate(row) = pubdate;
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::setGuidIsHash(const QString& guid, bool isHash)
......@@ -442,7 +452,7 @@ void FeedStorageMK4Impl::setGuidIsHash(const QString& guid, bool isHash)
row = d->archiveView.GetAt(findidx);
d->pguidIsHash(row) = isHash;
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::setLink(const QString& guid, const QString& link)
......@@ -454,7 +464,7 @@ void FeedStorageMK4Impl::setLink(const QString& guid, const QString& link)
row = d->archiveView.GetAt(findidx);
d->plink(row) = !link.isEmpty() ? link.toAscii() : "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::setHash(const QString& guid, uint hash)
......@@ -466,7 +476,7 @@ void FeedStorageMK4Impl::setHash(const QString& guid, uint hash)
row = d->archiveView.GetAt(findidx);
d->phash(row) = hash;
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::setTitle(const QString& guid, const QString& title)
......@@ -478,7 +488,7 @@ void FeedStorageMK4Impl::setTitle(const QString& guid, const QString& title)
row = d->archiveView.GetAt(findidx);
d->ptitle(row) = !title.isEmpty() ? title.toUtf8().data() : "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::setDescription(const QString& guid, const QString& description)
......@@ -490,7 +500,7 @@ void FeedStorageMK4Impl::setDescription(const QString& guid, const QString& desc
row = d->archiveView.GetAt(findidx);
d->pdescription(row) = !description.isEmpty() ? description.toUtf8().data() : "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::setContent(const QString& guid, const QString& content)
......@@ -502,7 +512,7 @@ void FeedStorageMK4Impl::setContent(const QString& guid, const QString& content)
row = d->archiveView.GetAt(findidx);
d->pcontent(row) = !content.isEmpty() ? content.toUtf8().data() : "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::setAuthorName(const QString& guid, const QString& author)
......@@ -514,7 +524,7 @@ void FeedStorageMK4Impl::setAuthorName(const QString& guid, const QString& autho
row = d->archiveView.GetAt(findidx);
d->pauthorName(row) = !author.isEmpty() ? author.toUtf8().data() : "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
......@@ -527,7 +537,7 @@ void FeedStorageMK4Impl::setAuthorUri(const QString& guid, const QString& author
row = d->archiveView.GetAt(findidx);
d->pauthorUri(row) = !author.isEmpty() ? author.toUtf8().data() : "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
......@@ -540,7 +550,7 @@ void FeedStorageMK4Impl::setAuthorEMail(const QString& guid, const QString& auth
row = d->archiveView.GetAt(findidx);
d->pauthorEMail(row) = !author.isEmpty() ? author.toUtf8().data() : "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
QString FeedStorageMK4Impl::authorName(const QString& guid) const
......@@ -571,7 +581,7 @@ void FeedStorageMK4Impl::setCommentsLink(const QString& guid, const QString& com
row = d->archiveView.GetAt(findidx);
d->pcommentsLink(row) = !commentsLink.isEmpty() ? commentsLink.toUtf8().data() : "";
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::setComments(const QString& guid, int comments)
......@@ -583,7 +593,7 @@ void FeedStorageMK4Impl::setComments(const QString& guid, int comments)
row = d->archiveView.GetAt(findidx);
d->pcomments(row) = comments;
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
......@@ -596,7 +606,7 @@ void FeedStorageMK4Impl::setGuidIsPermaLink(const QString& guid, bool isPermaLin
row = d->archiveView.GetAt(findidx);
d->pguidIsPermaLink(row) = isPermaLink;
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::addCategory(const QString& guid, const Category& cat)
......@@ -648,7 +658,7 @@ void FeedStorageMK4Impl::addCategory(const QString& guid, const Category& cat)
d->catView.SetAt(catidx2, catrow2);
}
d->modified = true;
markDirty();
}
}
......@@ -735,7 +745,7 @@ void FeedStorageMK4Impl::addTag(const QString& guid, const QString& tag)
d->ptaggedArticles(tagrow) = tagView2;
d->tagView.SetAt(tagidx2, tagrow);
}
d->modified = true;
markDirty();
}
}
......@@ -777,7 +787,7 @@ void FeedStorageMK4Impl::removeTag(const QString& guid, const QString& tag)
}
}
d->modified = true;
markDirty();
}
}
......@@ -855,7 +865,7 @@ void FeedStorageMK4Impl::setEnclosure(const QString& guid, const QString& url, c
d->pEnclosureLength(row) = length;
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::removeEnclosure(const QString& guid)
......@@ -871,7 +881,7 @@ void FeedStorageMK4Impl::removeEnclosure(const QString& guid)
d->pEnclosureLength(row) = -1;
d->archiveView.SetAt(findidx, row);
d->modified = true;
markDirty();
}
void FeedStorageMK4Impl::enclosure(const QString& guid, bool& hasEnclosure, QString& url, QString& type, int& length) const
......@@ -897,7 +907,7 @@ void FeedStorageMK4Impl::clear()
d->storage->RemoveAll();
d->tagStorage->RemoveAll();
setUnread(0);
d->modified = true;
markDirty();
}
} // namespace Backend
......
......@@ -102,6 +102,7 @@ class FeedStorageMK4Impl : public FeedStorage
void convertOldArchive();
private:
void markDirty();
/** finds article by guid, returns -1 if not in archive **/
int findArticle(const QString& guid) const;
void setTotalCount(int total);
......
......@@ -56,7 +56,6 @@ class Akregator::Backend::StorageMK4Impl::StorageMK4ImplPrivate
QStringList feedURLs;
c4_StringProp purl, pFeedList, pTagSet;
c4_IntProp punread, ptotalCount, plastFetch;
QTimer* commitTimer;
QString archivePath;
c4_Storage* feedListStorage;
......@@ -69,10 +68,6 @@ Akregator::Backend::StorageMK4Impl::StorageMK4Impl() : d(new StorageMK4ImplPriva
{
d->q = this;
setArchivePath(QString::null); // set path to default //krazy:exclude=nullstrassign for old broken gcc
// commit changes every 3 seconds
d->commitTimer = new QTimer(this);
connect(d->commitTimer, SIGNAL(timeout()), this, SLOT(slotCommit()));
d->commitTimer->start(3000);
}
Akregator::Backend::FeedStorageMK4Impl* Akregator::Backend::StorageMK4Impl::StorageMK4ImplPrivate::createFeedStorage( const QString& url )
......@@ -120,7 +115,7 @@ QString Akregator::Backend::StorageMK4Impl::archivePath() const
return d->archivePath;
}
QString Akregator::Backend::StorageMK4Impl::defaultArchivePath()
QString Akregator::Backend::StorageMK4Impl::defaultArchivePath()
{
return KGlobal::dirs()->saveLocation("data", "akregator")+"Archive";
}
......@@ -155,8 +150,6 @@ bool Akregator::Backend::StorageMK4Impl::autoCommit() const
bool Akregator::Backend::StorageMK4Impl::close()
{
d->commitTimer->stop();
QMap<QString, FeedStorageMK4Impl*>::Iterator it;
QMap<QString, FeedStorageMK4Impl*>::Iterator end(d->feeds.end() ) ;
for (it = d->feeds.begin(); it != end; ++it)
......@@ -167,9 +160,9 @@ bool Akregator::Backend::StorageMK4Impl::close()
if(d->autoCommit)
d->storage->Commit();
delete d->storage;
delete d->storage;
d->storage = 0;
d->feedListStorage->Commit();
delete d->feedListStorage;
d->feedListStorage = 0;
......@@ -208,7 +201,7 @@ bool Akregator::Backend::StorageMK4Impl::rollback()
return false;
}
int Akregator::Backend::StorageMK4Impl::unreadFor(const QString &url) const
int Akregator::Backend::StorageMK4Impl::unreadFor(const QString &url) const
{
c4_Row findrow;
d->purl(findrow) = url.toAscii();
......@@ -227,10 +220,10 @@ void Akregator::Backend::StorageMK4Impl::setUnreadFor(const QString &url, int un
findrow = d->archiveView.GetAt(findidx);
d->punread(findrow) = unread;
d->archiveView.SetAt(findidx, findrow);
d->modified = true;
markDirty();
}
int Akregator::Backend::StorageMK4Impl::totalCountFor(const QString &url) const
int Akregator::Backend::StorageMK4Impl::totalCountFor(const QString &url) const
{
c4_Row findrow;
d->purl(findrow) = url.toAscii();
......@@ -249,10 +242,10 @@ void Akregator::Backend::StorageMK4Impl::setTotalCountFor(const QString &url, in
findrow = d->archiveView.GetAt(findidx);
d->ptotalCount(findrow) = total;
d->archiveView.SetAt(findidx, findrow);
d->modified = true;
markDirty();
}
int Akregator::Backend::StorageMK4Impl::lastFetchFor(const QString& url) const
int Akregator::Backend::StorageMK4Impl::lastFetchFor(const QString& url) const
{
c4_Row findrow;
d->purl(findrow) = url.toAscii();
......@@ -271,13 +264,23 @@ void Akregator::Backend::StorageMK4Impl::setLastFetchFor(const QString& url, int
findrow = d->archiveView.GetAt(findidx);
d->plastFetch(findrow) = lastFetch;
d->archiveView.SetAt(findidx, findrow);
d->modified = true;
markDirty();
}
void Akregator::Backend::StorageMK4Impl::markDirty()
{
if (!d->modified)
{
d->modified = true;
// commit changes after 3 seconds
QTimer::singleShot(3000, this, SLOT(slotCommit()));
}
}
void Akregator::Backend::StorageMK4Impl::slotCommit()
{
if (d->modified)
commit();
commit();
d->modified = false;
}
......@@ -327,7 +330,7 @@ void Akregator::Backend::StorageMK4Impl::clear()
void Akregator::Backend::StorageMK4Impl::storeFeedList(const QString& opmlStr)
{
if (d->feedListView.GetSize() == 0)
{
c4_Row row;
......@@ -341,7 +344,7 @@ void Akregator::Backend::StorageMK4Impl::storeFeedList(const QString& opmlStr)
d->pFeedList(row) = !opmlStr.isEmpty() ? opmlStr.toUtf8().data() : "";
d->feedListView.SetAt(0, row);
}
d->modified = true;
markDirty();
}
QString Akregator::Backend::StorageMK4Impl::restoreFeedList() const
......@@ -355,7 +358,7 @@ QString Akregator::Backend::StorageMK4Impl::restoreFeedList() const
void Akregator::Backend::StorageMK4Impl::storeTagSet(const QString& xmlStr)
{
if (d->feedListView.GetSize() == 0)
{
c4_Row row;
......@@ -369,7 +372,7 @@ void Akregator::Backend::StorageMK4Impl::storeTagSet(const QString& xmlStr)
d->pTagSet(row) = !xmlStr.isEmpty() ? xmlStr.toUtf8().data() : "";
d->feedListView.SetAt(0, row);
}
d->modified = true;
markDirty();
}
QString Akregator::Backend::StorageMK4Impl::restoreTagSet() const
......
......@@ -114,6 +114,8 @@ class StorageMK4Impl : public Storage
/** deletes all feed storages in this archive */
void clear();
void markDirty();
protected slots:
void slotCommit();
......
......@@ -92,6 +92,7 @@ TabWidget::TabWidget(QWidget * parent)
{
d->parent = this;
d->currentMaxLength = 30;
d->currentItem = 0;
setMinimumSize(250,150);
setTabReorderingEnabled(false);
connect( this, SIGNAL( currentChanged(QWidget *) ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment