[Pkg-owncloud-commits] [owncloud-client] 41/498: Determine right account in ownCloudGui::slotShowShareDialog

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 8390b0b9307dfc7790d27b9d4583008dec89faed
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Thu Apr 23 14:14:28 2015 +0200

    Determine right account in ownCloudGui::slotShowShareDialog
---
 src/gui/owncloudgui.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp
index e5f3961..365db01 100644
--- a/src/gui/owncloudgui.cpp
+++ b/src/gui/owncloudgui.cpp
@@ -639,15 +639,15 @@ void ownCloudGui::raiseDialog( QWidget *raiseWidget )
 
 void ownCloudGui::slotShowShareDialog(const QString &sharePath, const QString &localPath, bool resharingAllowed)
 {
-#warning FIXME
-    auto account = AccountManager::instance()->accounts().value(0);
-    if (!account) {
-        qDebug() << "Could not open share dialog because no account is configured";
+    const auto folder = FolderMan::instance()->folderForPath(localPath);
+    if (!folder) {
+        qDebug() << "Could not open share dialog for" << localPath << "no responsible folder found";
         return;
     }
+    const auto accountState = folder->accountState();
 
-    qDebug() << Q_FUNC_INFO << "Opening share dialog";
-    ShareDialog *w = new ShareDialog(account->account(), sharePath, localPath, resharingAllowed);
+    qDebug() << Q_FUNC_INFO << "Opening share dialog" << sharePath << localPath;
+    ShareDialog *w = new ShareDialog(accountState->account(), sharePath, localPath, resharingAllowed);
     w->getShares();
     w->setAttribute( Qt::WA_DeleteOnClose, true );
     raiseDialog(w);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list