Commit 2bffa97d authored by Paweł Wegner's avatar Paweł Wegner

CloudStorage: refactored provider registration.

parent 4a726044
......@@ -166,19 +166,19 @@ class CloudProviderWrapper : public ICloudProvider {
} // namespace
CloudStorage::CloudStorage() {
add([]() { return std::make_shared<GoogleDrive>(); });
add([]() { return std::make_shared<OneDrive>(); });
add([]() { return std::make_shared<Dropbox>(); });
add([]() { return std::make_shared<Box>(); });
add([]() { return std::make_shared<YouTube>(); });
add([]() { return std::make_shared<YandexDisk>(); });
add([]() { return std::make_shared<WebDav>(); });
add([]() { return std::make_shared<AmazonS3>(); });
add([]() { return std::make_shared<PCloud>(); });
add([]() { return std::make_shared<HubiC>(); });
add([]() { return std::make_shared<GooglePhotos>(); });
add<GoogleDrive>();
add<OneDrive>();
add<Dropbox>();
add<Box>();
add<YouTube>();
add<YandexDisk>();
add<WebDav>();
add<AmazonS3>();
add<PCloud>();
add<HubiC>();
add<GooglePhotos>();
#ifdef WITH_MEGA
add([]() { return std::make_shared<MegaNz>(); });
add<MegaNz>();
#endif
}
......
......@@ -44,6 +44,11 @@ class CloudStorage : public ICloudStorage {
private:
void add(CloudProviderFactory);
template <class T>
void add() {
add([]() { return std::make_shared<T>(); });
}
std::map<std::string, CloudProviderFactory> providers_;
};
......
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