mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
akregator: drop migration code
This commit is contained in:
parent
7c9b7aa06e
commit
870ec81ee7
6 changed files with 0 additions and 38 deletions
|
@ -142,8 +142,6 @@ class FeedStorage : public QObject //krazy:exclude=qobject
|
|||
virtual void close() = 0;
|
||||
virtual void commit() = 0;
|
||||
virtual void rollback() = 0;
|
||||
|
||||
virtual void convertOldArchive() = 0;
|
||||
};
|
||||
|
||||
} // namespace Backend
|
||||
|
|
|
@ -97,37 +97,11 @@ class FeedStorageMK4Impl::FeedStorageMK4ImplPrivate
|
|||
|
||||
bool autoCommit;
|
||||
bool modified;
|
||||
bool convert;
|
||||
QString oldArchivePath;
|
||||
c4_StringProp pguid, ptitle, pdescription, pcontent, plink, pcommentsLink, ptag, pEnclosureType, pEnclosureUrl, pcatTerm, pcatScheme, pcatName, pauthorName, pauthorUri, pauthorEMail;
|
||||
c4_IntProp phash, pguidIsHash, pguidIsPermaLink, pcomments, pstatus, ppubDate, pHasEnclosure, pEnclosureLength;
|
||||
c4_ViewProp ptags, ptaggedArticles, pcategorizedArticles, pcategories;
|
||||
};
|
||||
|
||||
void FeedStorageMK4Impl::convertOldArchive()
|
||||
{
|
||||
if (!d->convert)
|
||||
return;
|
||||
|
||||
d->convert = false;
|
||||
QFile file(d->oldArchivePath);
|
||||
|
||||
if ( !file.open(QIODevice::ReadOnly) )
|
||||
return;
|
||||
|
||||
Syndication::DocumentSource src(file.readAll(), QLatin1String("http://foo"));
|
||||
file.close();
|
||||
Syndication::FeedPtr feed = Syndication::parse(src);
|
||||
|
||||
if (feed)
|
||||
{
|
||||
//QList<Syndication::ItemPtr> items = feed->items();
|
||||
//QList<Syndication::ItemPtr>::ConstIterator it = items.constBegin();
|
||||
//QList<Syndication::ItemPtr>::ConstIterator en = items.constEnd();
|
||||
markDirty();
|
||||
commit();
|
||||
}
|
||||
}
|
||||
|
||||
FeedStorageMK4Impl::FeedStorageMK4Impl(const QString& url, StorageMK4Impl* main)
|
||||
{
|
||||
|
@ -147,8 +121,6 @@ FeedStorageMK4Impl::FeedStorageMK4Impl(const QString& url, StorageMK4Impl* main)
|
|||
QString t = url2;
|
||||
QString t2 = url2;
|
||||
QString filePath = main->archivePath() + QLatin1Char('/') + t.replace(QLatin1Char('/'), QLatin1Char('_')).replace(QLatin1Char(':'), QLatin1Char('_'));
|
||||
d->oldArchivePath = KGlobal::dirs()->saveLocation("data", QLatin1String("akregator/Archive/")) + t2.replace(QLatin1Char('/'), QLatin1Char('_')).replace(QLatin1Char(':'), QLatin1Char('_')) + QLatin1String(".xml");
|
||||
d->convert = !QFile::exists(filePath + QLatin1String(".mk4")) && QFile::exists(d->oldArchivePath);
|
||||
d->storage = new c4_Storage(QString(filePath + QLatin1String(".mk4")).toLocal8Bit(), true);
|
||||
|
||||
d->archiveView = d->storage->GetAs("articles[guid:S,title:S,hash:I,guidIsHash:I,guidIsPermaLink:I,description:S,link:S,comments:I,commentsLink:S,status:I,pubDate:I,tags[tag:S],hasEnclosure:I,enclosureUrl:S,enclosureType:S,enclosureLength:I,categories[catTerm:S,catScheme:S,catName:S],authorName:S,content:S,authorUri:S,authorEMail:S]");
|
||||
|
|
|
@ -100,7 +100,6 @@ class FeedStorageMK4Impl : public FeedStorage
|
|||
void commit();
|
||||
void rollback();
|
||||
|
||||
void convertOldArchive();
|
||||
private:
|
||||
void markDirty();
|
||||
/** finds article by guid, returns -1 if not in archive **/
|
||||
|
|
|
@ -87,7 +87,6 @@ Akregator::Backend::FeedStorageMK4Impl* Akregator::Backend::StorageMK4Impl::Stor
|
|||
archiveView.Add(findrow);
|
||||
modified = true;
|
||||
}
|
||||
fs->convertOldArchive();
|
||||
}
|
||||
return feeds[url];
|
||||
}
|
||||
|
|
|
@ -82,11 +82,6 @@ class FeedStorageDummyImpl::FeedStorageDummyImplPrivate
|
|||
QString url;
|
||||
};
|
||||
|
||||
|
||||
void FeedStorageDummyImpl::convertOldArchive()
|
||||
{
|
||||
}
|
||||
|
||||
FeedStorageDummyImpl::FeedStorageDummyImpl(const QString& url, StorageDummyImpl* main) : d(new FeedStorageDummyImplPrivate)
|
||||
{
|
||||
d->url = url;
|
||||
|
|
|
@ -100,7 +100,6 @@ class FeedStorageDummyImpl : public FeedStorage
|
|||
virtual void commit();
|
||||
virtual void rollback();
|
||||
|
||||
virtual void convertOldArchive();
|
||||
private:
|
||||
/** finds article by guid, returns -1 if not in archive **/
|
||||
int findArticle(const QString& guid) const;
|
||||
|
|
Loading…
Add table
Reference in a new issue