Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/subscription/DownloadableSubscription.cpp

Issue 29548581: Issue 4128, 5138 - Add Parser and Serializer implemented in C++ Base URL: https://github.com/adblockplus/adblockpluscore.git
Patch Set: Created Sept. 18, 2017, 5:23 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiled/subscription/DownloadableSubscription.cpp
diff --git a/compiled/subscription/DownloadableSubscription.cpp b/compiled/subscription/DownloadableSubscription.cpp
index f72306356ccddc828cedd2bbc0a81b6818aa2752..0a975fbe60c6fad1d31c5b663c05cf8c2c59b507 100644
--- a/compiled/subscription/DownloadableSubscription.cpp
+++ b/compiled/subscription/DownloadableSubscription.cpp
@@ -17,17 +17,30 @@
#include "DownloadableSubscription.h"
-DownloadableSubscription::DownloadableSubscription(const String& id)
- : Subscription(Type::DOWNLOADABLE, id), mFixedTitle(false), mLastCheck(0),
+DownloadableSubscription::DownloadableSubscription(const String& id, const KeyValues& properties)
+ : Subscription(Type::DOWNLOADABLE, id, properties), mFixedTitle(false), mLastCheck(0),
mHardExpiration(0), mSoftExpiration(0), mLastDownload(0), mLastSuccess(0),
mErrorCount(0), mDataRevision(0), mDownloadCount(0)
{
- SetTitle(id);
sergei 2017/09/18 19:20:07 Why is the title set to ID only for downloadable s
Wladimir Palant 2017/12/21 10:30:38 The ID is only meaningful for downloadable subscri
+ const auto* titleProp = findPropertyValue(properties, u"title"_str);
+ SetTitle(titleProp ? *titleProp : id);
+ parseProperty(properties, mFixedTitle, u"fixedTitle"_str);
+ parseProperty(properties, mHomepage, u"homepage"_str);
+ parseProperty(properties, mLastCheck, u"lastCheck"_str);
+ parseProperty(properties, mHardExpiration, u"expires"_str);
+ parseProperty(properties, mSoftExpiration, u"softExpiration"_str);
+ parseProperty(properties, mLastDownload, u"lastDownload"_str);
+ parseProperty(properties, mDownloadStatus, u"downloadStatus"_str);
+ parseProperty(properties, mLastSuccess, u"lastSuccess"_str);
+ parseProperty(properties, mErrorCount, u"errors"_str);
+ parseProperty(properties, mDataRevision, u"version"_str);
+ parseProperty(properties, mRequiredVersion, u"requiredVersion"_str);
+ parseProperty(properties, mDownloadCount, u"downloadCount"_str);
}
-OwnedString DownloadableSubscription::Serialize() const
+OwnedString DownloadableSubscription::SerializeProperties() const
{
- OwnedString result(Subscription::Serialize());
+ OwnedString result(Subscription::DoSerializeProperties());
if (mFixedTitle)
result.append(u"fixedTitle=true\n"_str);
if (!mHomepage.empty())

Powered by Google App Engine
This is Rietveld