InactiveSyncSource: simpler implementation

When deriving from DummySyncSource we need to implement less
pure virtual functions. Only the ones where the behavior
needs to differ from DummySyncSource are needed.
This commit is contained in:
Patrick Ohly 2014-08-20 15:12:23 +02:00
parent 6770237424
commit e06d39b5bd
1 changed files with 2 additions and 7 deletions

View File

@ -280,19 +280,14 @@ RegisterSyncSource::RegisterSyncSource(const string &shortDescr,
registry.push_back(this);
}
class InactiveSyncSource : public SyncSource
class InactiveSyncSource : public DummySyncSource
{
public:
InactiveSyncSource(const SyncSourceParams &params) : SyncSource(params) {}
InactiveSyncSource(const SyncSourceParams &params) : DummySyncSource(params) {}
virtual bool isInactive() const { return true; }
virtual void enableServerMode() {}
virtual bool serverModeEnabled() const { return false; }
virtual void getSynthesisInfo(SyncEvo::SyncSourceBase::SynthesisInfo&, SyncEvo::XMLConfigFragments&) { throwError(SE_HERE, "inactive"); }
virtual Databases getDatabases() { throwError(SE_HERE, "inactive"); return Databases(); }
virtual void open() { throwError(SE_HERE, "inactive"); }
virtual void close() { throwError(SE_HERE, "inactive"); }
virtual std::string getPeerMimeType() const { return ""; }
};
SyncSource *RegisterSyncSource::InactiveSource(const SyncSourceParams &params)