mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Share link: Fix parsing integer ids #5777
Older ownCloud servers like 8.2.0 used to use integer ids. This broke when switching to QJson because toString() on JSON values is strict and returns "" for integers.
This commit is contained in:
parent
950439e5b8
commit
f2b5fcd706
1 changed files with 2 additions and 2 deletions
|
@ -395,7 +395,7 @@ QSharedPointer<LinkShare> ShareManager::parseLinkShare(const QJsonObject &data)
|
|||
}
|
||||
|
||||
return QSharedPointer<LinkShare>(new LinkShare(_account,
|
||||
data.value("id").toString(),
|
||||
data.value("id").toVariant().toString(), // "id" used to be an integer, support both
|
||||
data.value("path").toString(),
|
||||
data.value("name").toString(),
|
||||
data.value("token").toString(),
|
||||
|
@ -412,7 +412,7 @@ QSharedPointer<Share> ShareManager::parseShare(const QJsonObject &data)
|
|||
(Sharee::Type)data.value("share_type").toInt()));
|
||||
|
||||
return QSharedPointer<Share>(new Share(_account,
|
||||
data.value("id").toString(),
|
||||
data.value("id").toVariant().toString(), // "id" used to be an integer, support both
|
||||
data.value("path").toString(),
|
||||
(Share::ShareType)data.value("share_type").toInt(),
|
||||
(Share::Permissions)data.value("permissions").toInt(),
|
||||
|
|
Loading…
Reference in a new issue