mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-28 16:13:53 +03:00
Determine right account in ownCloudGui::slotShowShareDialog
This commit is contained in:
parent
dbddabfcd7
commit
8390b0b930
1 changed files with 6 additions and 6 deletions
|
@ -639,15 +639,15 @@ void ownCloudGui::raiseDialog( QWidget *raiseWidget )
|
||||||
|
|
||||||
void ownCloudGui::slotShowShareDialog(const QString &sharePath, const QString &localPath, bool resharingAllowed)
|
void ownCloudGui::slotShowShareDialog(const QString &sharePath, const QString &localPath, bool resharingAllowed)
|
||||||
{
|
{
|
||||||
#warning FIXME
|
const auto folder = FolderMan::instance()->folderForPath(localPath);
|
||||||
auto account = AccountManager::instance()->accounts().value(0);
|
if (!folder) {
|
||||||
if (!account) {
|
qDebug() << "Could not open share dialog for" << localPath << "no responsible folder found";
|
||||||
qDebug() << "Could not open share dialog because no account is configured";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const auto accountState = folder->accountState();
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Opening share dialog";
|
qDebug() << Q_FUNC_INFO << "Opening share dialog" << sharePath << localPath;
|
||||||
ShareDialog *w = new ShareDialog(account->account(), sharePath, localPath, resharingAllowed);
|
ShareDialog *w = new ShareDialog(accountState->account(), sharePath, localPath, resharingAllowed);
|
||||||
w->getShares();
|
w->getShares();
|
||||||
w->setAttribute( Qt::WA_DeleteOnClose, true );
|
w->setAttribute( Qt::WA_DeleteOnClose, true );
|
||||||
raiseDialog(w);
|
raiseDialog(w);
|
||||||
|
|
Loading…
Reference in a new issue