mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 08:47:22 +03:00
Merge pull request #523 from nextcloud/fix-navigation-apps
Fixes crash on mac OS and linux.
This commit is contained in:
commit
00e2d4ef93
1 changed files with 13 additions and 14 deletions
|
@ -818,23 +818,22 @@ void ownCloudGui::buildNavigationAppsMenu(AccountStatePtr account, QMenu *accoun
|
|||
|
||||
void ownCloudGui::slotNavigationAppsFetched(const QJsonDocument &reply, int statusCode)
|
||||
{
|
||||
auto account = qvariant_cast<AccountStatePtr>(sender()->property(propertyAccountC));
|
||||
auto accountMenu = qvariant_cast<QMenu*>(sender()->property(propertyMenuC));
|
||||
|
||||
if (statusCode == 304) {
|
||||
qCWarning(lcApplication) << "Status code " << statusCode << " Not Modified - No new navigation apps.";
|
||||
} else {
|
||||
if(!reply.isEmpty()){
|
||||
auto element = reply.object().value("ocs").toObject().value("data");
|
||||
auto navLinks = element.toArray();
|
||||
if(account){
|
||||
if(auto account = qvariant_cast<AccountStatePtr>(sender()->property(propertyAccountC))){
|
||||
if (statusCode == 304) {
|
||||
qCWarning(lcApplication) << "Status code " << statusCode << " Not Modified - No new navigation apps.";
|
||||
} else {
|
||||
if(!reply.isEmpty()){
|
||||
auto element = reply.object().value("ocs").toObject().value("data");
|
||||
auto navLinks = element.toArray();
|
||||
_navApps.insert(account, navLinks);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(accountMenu)
|
||||
buildNavigationAppsMenu(account, accountMenu);
|
||||
if(QObject *accountMenuObj = qvariant_cast<QObject*>(sender()->property(propertyMenuC))){
|
||||
if(QMenu *accountMenu = dynamic_cast<QMenu*>(accountMenuObj))
|
||||
buildNavigationAppsMenu(account, accountMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ownCloudGui::slotOcsError(int statusCode, const QString &message)
|
||||
|
|
Loading…
Reference in a new issue