diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index 224cefb65..35f36cccd 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -66,9 +66,14 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt // check if the file is already inside of a synced folder if( sharePath.isEmpty() ) { - // The file is not yet in ownCloud. It must be copied into first. - _ui->checkBox_shareLink->setEnabled(false); - uploadExternalFile(); + // The file is not yet in an ownCloud synced folder. We could automatically + // copy it over, but that is skipped as not all questions can be anwered that + // are involved in that, see https://github.com/owncloud/client/issues/2732 + // + // _ui->checkBox_shareLink->setEnabled(false); + // uploadExternalFile(); + qDebug() << Q_FUNC_INFO << "Unable to share files not in a sync folder."; + return; } // error label, red box and stuff @@ -344,6 +349,11 @@ void ShareDialog::displayInfo( const QString& msg ) _ui->label_sharePath->setText(msg); } +#if 0 +/* + * This code is disabled for now as we do not have answers for all the questions involved + * here, see https://github.com/owncloud/client/issues/2732 + */ bool ShareDialog::uploadExternalFile() { bool re = false; @@ -446,7 +456,7 @@ void ShareDialog::slotNextSyncFinished( const SyncResult& result ) } _expectedSyncFile.clear(); } - +#endif OcsShareJob::OcsShareJob(const QByteArray &verb, const QUrl &url, AccountPtr account, QObject* parent) : AbstractNetworkJob(account, "", parent), diff --git a/src/gui/sharedialog.h b/src/gui/sharedialog.h index 549321d83..0352ef915 100644 --- a/src/gui/sharedialog.h +++ b/src/gui/sharedialog.h @@ -59,9 +59,6 @@ public: ~ShareDialog(); void getShares(); -public slots: - void slotNextSyncFinished( const SyncResult& result ); - private slots: void slotSharesFetched(const QString &reply); void slotCreateShareFetched(const QString &reply); @@ -77,8 +74,6 @@ private: void displayError(int code); void displayInfo( const QString& msg ); - bool uploadExternalFile(); - Ui::ShareDialog *_ui; AccountPtr _account; QString _sharePath; diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index a6bb074ab..c0fd84cef 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -408,11 +408,8 @@ void SocketApi::command_SHARE(const QString& localFile, SocketType* socket) Folder *shareFolder = FolderMan::instance()->folderForPath(localFile); if (!shareFolder) { - const QString message = QLatin1String("SHARE:OK:")+QDir::toNativeSeparators(localFile); - // FIXME: We could send here a "SHARE:PROGRESS" message back as this op will probably - // take longer. But currently we lack a way of getting a message once that has successfully - // worked. - emit shareCommandReceived(QString(), localFile); + const QString message = QLatin1String("SHARE:NOP:")+QDir::toNativeSeparators(localFile); + // files that are not within a sync folder are not synced. sendMessage(socket, message); } else { const QString message = QLatin1String("SHARE:OK:")+QDir::toNativeSeparators(localFile);