Commit ff4e9f08 authored by Alexandre Janniaux's avatar Alexandre Janniaux

CloudProvider: remove redundant std::move on return

parent f7b5d81c
......@@ -221,7 +221,7 @@ IItem::Pointer Box::toItem(const Json::Value& v) const {
FileId(type == IItem::FileType::Directory, v["id"].asString()),
v["size"].asUInt64(), util::parse_time(v["modified_at"].asString()),
type);
return std::move(item);
return item;
}
void Box::Auth::initialize(IHttp* http, IHttpServerFactory* factory) {
......
......@@ -393,7 +393,7 @@ IItem::Pointer GoogleDrive::toItem(const Json::Value& v) const {
std::vector<std::string> parents;
for (auto id : v["parents"]) parents.push_back(id.asString());
item->set_parents(parents);
return std::move(item);
return item;
}
void GoogleDrive::Auth::initialize(IHttp* http, IHttpServerFactory* factory) {
......
......@@ -905,7 +905,7 @@ IItem::Pointer MegaNz::toItem(MegaNode* node) {
"&name=" + util::Url::escape(util::to_base64(node->getName())) +
"&size=" + std::to_string(node->getSize()) +
"&state=" + util::Url::escape(auth()->state()));
return std::move(item);
return item;
}
std::string MegaNz::randomString(int length) {
......
......@@ -236,7 +236,7 @@ IItem::Pointer OneDrive::toItem(const Json::Value& v) const {
util::parse_time(v["lastModifiedDateTime"].asString()), type);
item->set_url(v["@microsoft.graph.downloadUrl"].asString());
item->set_thumbnail_url(v["thumbnails"][0]["small"]["url"].asString());
return std::move(item);
return item;
}
IItem::List OneDrive::listDirectoryResponse(
......
......@@ -223,7 +223,7 @@ IItem::Pointer PCloud::toItem(const Json::Value& v) const {
if (v["thumb"].asBool())
item->set_thumbnail_url(endpoint() + "/getthumb?fileid=" + item->id() +
"&size=" + THUMBNAIL_SIZE);
return std::move(item);
return item;
}
void PCloud::Auth::initialize(IHttp* http, IHttpServerFactory* factory) {
......
......@@ -221,7 +221,7 @@ IItem::Pointer WebDav::renameItemResponse(const IItem& item,
auto url = util::Url(webdav_url_);
i->set_url(url.protocol() + "://" + user_ + ":" + password_ + "@" +
url.host() + url.path() + i->id() + url.query());
return std::move(i);
return i;
}
IItem::Pointer WebDav::moveItemResponse(const IItem& source, const IItem& dest,
......@@ -233,7 +233,7 @@ IItem::Pointer WebDav::moveItemResponse(const IItem& source, const IItem& dest,
auto url = util::Url(webdav_url_);
i->set_url(url.protocol() + "://" + user_ + ":" + password_ + "@" +
url.host() + url.path() + i->id() + url.query());
return std::move(i);
return i;
}
IItem::List WebDav::listDirectoryResponse(const IItem&, std::istream& stream,
......@@ -281,7 +281,7 @@ IItem::Pointer WebDav::toItem(const tinyxml2::XMLNode* node) const {
timestamp, type);
item->set_url(url.protocol() + "://" + user_ + ":" + password_ + "@" +
url.host() + url.path() + id + url.query());
return std::move(item);
return item;
}
bool WebDav::reauthorize(int code,
......
......@@ -378,7 +378,7 @@ IItem::Pointer YandexDisk::toItem(const Json::Value& v) const {
v.isMember("size") ? v["size"].asUInt64() : IItem::UnknownSize,
util::parse_time(v["modified"].asString()), type);
item->set_thumbnail_url(v["preview"].asString());
return std::move(item);
return item;
}
void YandexDisk::authorizeRequest(IHttpRequest& request) const {
......
......@@ -492,7 +492,7 @@ Item::Pointer YouTube::toItem(const Json::Value& v, std::string kind,
IItem::FileType::Directory);
item->set_thumbnail_url(
v["snippet"]["thumbnails"]["default"]["url"].asString());
return std::move(item);
return item;
} else {
std::string video_id;
if (kind == "youtube#playlistItemListResponse")
......@@ -509,7 +509,7 @@ Item::Pointer YouTube::toItem(const Json::Value& v, std::string kind,
audio ? IItem::FileType::Audio : IItem::FileType::Video);
item->set_thumbnail_url(
v["snippet"]["thumbnails"]["default"]["url"].asString());
return std::move(item);
return item;
}
}
......
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