mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #571 from nextcloud/issues/mac-build
Fixes mac build.
This commit is contained in:
commit
ff9177edc3
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,6 +1,6 @@
|
||||
[submodule "src/3rdparty/qtmacgoodies"]
|
||||
path = src/3rdparty/qtmacgoodies
|
||||
url = https://github.com/guruz/qtmacgoodies.git
|
||||
url = https://github.com/camilasan/qtmacgoodies.git
|
||||
[submodule "binary"]
|
||||
path = binary
|
||||
url = git://github.com/owncloud/owncloud-client-binary.git
|
||||
|
||||
@ -58,7 +58,6 @@
|
||||
namespace OCC {
|
||||
|
||||
const char propertyAccountC[] = "oc_account";
|
||||
const char propertyMenuC[] = "oc_account_menu";
|
||||
|
||||
ownCloudGui::ownCloudGui(Application *parent)
|
||||
: QObject(parent)
|
||||
@ -617,11 +616,11 @@ void ownCloudGui::updateContextMenu()
|
||||
_contextMenu->addMenu(accountMenu);
|
||||
|
||||
addAccountContextMenu(account, accountMenu, true);
|
||||
fetchNavigationApps(account, accountMenu);
|
||||
fetchNavigationApps(account);
|
||||
}
|
||||
} else if (accountList.count() == 1) {
|
||||
addAccountContextMenu(accountList.first(), _contextMenu.data(), false);
|
||||
fetchNavigationApps(accountList.first(), _contextMenu.data());
|
||||
fetchNavigationApps(accountList.first());
|
||||
}
|
||||
|
||||
_contextMenu->addSeparator();
|
||||
@ -769,10 +768,9 @@ void ownCloudGui::slotEtagResponseHeaderReceived(const QByteArray &value, int st
|
||||
}
|
||||
}
|
||||
|
||||
void ownCloudGui::fetchNavigationApps(AccountStatePtr account, QMenu *accountMenu){
|
||||
void ownCloudGui::fetchNavigationApps(AccountStatePtr account){
|
||||
OcsNavigationAppsJob *job = new OcsNavigationAppsJob(account->account());
|
||||
job->setProperty(propertyAccountC, QVariant::fromValue(account));
|
||||
job->setProperty(propertyMenuC, QVariant::fromValue(accountMenu));
|
||||
job->addRawHeader("If-None-Match", account->navigationAppsEtagResponseHeader());
|
||||
connect(job, &OcsNavigationAppsJob::appsJobFinished, this, &ownCloudGui::slotNavigationAppsFetched);
|
||||
connect(job, &OcsNavigationAppsJob::etagResponseHeaderReceived, this, &ownCloudGui::slotEtagResponseHeaderReceived);
|
||||
@ -829,9 +827,18 @@ void ownCloudGui::slotNavigationAppsFetched(const QJsonDocument &reply, int stat
|
||||
}
|
||||
}
|
||||
|
||||
if(QObject *accountMenuObj = qvariant_cast<QObject*>(sender()->property(propertyMenuC))){
|
||||
if(QMenu *accountMenu = dynamic_cast<QMenu*>(accountMenuObj))
|
||||
buildNavigationAppsMenu(account, accountMenu);
|
||||
// TODO see pull #523
|
||||
auto accountList = AccountManager::instance()->accounts();
|
||||
if(accountList.size() > 1){
|
||||
// the list of apps will be displayed under the account that it belongs to
|
||||
foreach (QMenu *accountMenu, _accountMenus) {
|
||||
if(accountMenu->title() == account->account()->displayName()){
|
||||
buildNavigationAppsMenu(account, accountMenu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if(accountList.size() == 1){
|
||||
buildNavigationAppsMenu(account, _contextMenu.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ private:
|
||||
void setPauseOnAllFoldersHelper(bool pause);
|
||||
void setupActions();
|
||||
void addAccountContextMenu(AccountStatePtr accountState, QMenu *menu, bool separateMenu);
|
||||
void fetchNavigationApps(AccountStatePtr account, QMenu *accountMenu);
|
||||
void fetchNavigationApps(AccountStatePtr account);
|
||||
void buildNavigationAppsMenu(AccountStatePtr account, QMenu *accountMenu);
|
||||
|
||||
QPointer<Systray> _tray;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user