From 5a83636f81dfa28aae5099f1050cf603d43ee47e Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 16 Mar 2015 16:26:35 +0100 Subject: [PATCH] Only show share dialog if we are connected. --- src/gui/socketapi.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index 025abe3b6..0f42154a8 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) by Dominik Schmidt * Copyright (C) by Klaas Freitag + * Copyright (C) by Roeland Jago Douma * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,6 +25,7 @@ #include "syncfileitem.h" #include "filesystem.h" #include "version.h" +#include "accountstate.h" #include #include @@ -425,6 +427,10 @@ void SocketApi::command_SHARE(const QString& localFile, QLocalSocket* socket) const QString message = QLatin1String("SHARE:NOP:")+QDir::toNativeSeparators(localFile); // files that are not within a sync folder are not synced. sendMessage(socket, message); + } else if (!shareFolder->accountState()->isConnected()) { + const QString message = QLatin1String("SHARE:NOTCONNECTED:")+QDir::toNativeSeparators(localFile); + // if the folder isn't connected, don't open the share dialog + sendMessage(socket, message); } else { const QString folderForPath = shareFolder->path(); const QString remotePath = shareFolder->remotePath() + localFile.right(localFile.count()-folderForPath.count()+1); -- 2.30.2