From 870ec81ee7ee949827137f421966d8678338dbae Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 20 Jun 2015 17:01:04 +0300 Subject: [PATCH] akregator: drop migration code --- akregator/interfaces/feedstorage.h | 2 -- .../plugins/mk4storage/feedstoragemk4impl.cpp | 28 ---------------------- akregator/plugins/mk4storage/feedstoragemk4impl.h | 1 - akregator/plugins/mk4storage/storagemk4impl.cpp | 1 - .../src/dummystorage/feedstoragedummyimpl.cpp | 5 ---- akregator/src/dummystorage/feedstoragedummyimpl.h | 1 - 6 files changed, 38 deletions(-) diff --git a/akregator/interfaces/feedstorage.h b/akregator/interfaces/feedstorage.h index b8cc4a9d..4b4dd9ad 100644 --- a/akregator/interfaces/feedstorage.h +++ b/akregator/interfaces/feedstorage.h @@ -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 diff --git a/akregator/plugins/mk4storage/feedstoragemk4impl.cpp b/akregator/plugins/mk4storage/feedstoragemk4impl.cpp index e1d46f94..49f4d3c8 100644 --- a/akregator/plugins/mk4storage/feedstoragemk4impl.cpp +++ b/akregator/plugins/mk4storage/feedstoragemk4impl.cpp @@ -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 items = feed->items(); - //QList::ConstIterator it = items.constBegin(); - //QList::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]"); diff --git a/akregator/plugins/mk4storage/feedstoragemk4impl.h b/akregator/plugins/mk4storage/feedstoragemk4impl.h index 63654bb4..62a3a5cb 100644 --- a/akregator/plugins/mk4storage/feedstoragemk4impl.h +++ b/akregator/plugins/mk4storage/feedstoragemk4impl.h @@ -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 **/ diff --git a/akregator/plugins/mk4storage/storagemk4impl.cpp b/akregator/plugins/mk4storage/storagemk4impl.cpp index 78b81397..2db7c852 100644 --- a/akregator/plugins/mk4storage/storagemk4impl.cpp +++ b/akregator/plugins/mk4storage/storagemk4impl.cpp @@ -87,7 +87,6 @@ Akregator::Backend::FeedStorageMK4Impl* Akregator::Backend::StorageMK4Impl::Stor archiveView.Add(findrow); modified = true; } - fs->convertOldArchive(); } return feeds[url]; } diff --git a/akregator/src/dummystorage/feedstoragedummyimpl.cpp b/akregator/src/dummystorage/feedstoragedummyimpl.cpp index e7b0612d..1da2d67d 100644 --- a/akregator/src/dummystorage/feedstoragedummyimpl.cpp +++ b/akregator/src/dummystorage/feedstoragedummyimpl.cpp @@ -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; diff --git a/akregator/src/dummystorage/feedstoragedummyimpl.h b/akregator/src/dummystorage/feedstoragedummyimpl.h index 1e6c2cae..15e1e05d 100644 --- a/akregator/src/dummystorage/feedstoragedummyimpl.h +++ b/akregator/src/dummystorage/feedstoragedummyimpl.h @@ -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; -- 2.11.0