Comparar commits
20 Commits
2.2.3
...
share_via_email
| Autor | SHA1 | Data | |
|---|---|---|---|
| b6dd13f353 | |||
| e031f7d090 | |||
| d4b72132d6 | |||
| 763016bd8f | |||
| 7f0cc5b699 | |||
| d3a93cbaeb | |||
| 85d3c7a263 | |||
| 159535fe90 | |||
| 088a294fac | |||
| 813bc15a78 | |||
| 567fe87e98 | |||
| a1ba23eea9 | |||
| 194db066b6 | |||
| 129c17651a | |||
| 0469236d80 | |||
| 93e0d52dd3 | |||
| 9f3e576348 | |||
| 5479aaeb5b | |||
| 8dc178a9f3 | |||
| 35d4b96339 |
+2
-2
@@ -1,6 +1,6 @@
|
||||
set( MIRALL_VERSION_MAJOR 2 )
|
||||
set( MIRALL_VERSION_MINOR 2 )
|
||||
set( MIRALL_VERSION_PATCH 1 )
|
||||
set( MIRALL_VERSION_MINOR 3 )
|
||||
set( MIRALL_VERSION_PATCH 0 )
|
||||
set( MIRALL_VERSION_YEAR 2016 )
|
||||
set( MIRALL_SOVERSION 0 )
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Z
|
||||
StrCpy $UNINSTALLER_FILE_Detail "Zapisuji odinstal tor"
|
||||
StrCpy $UNINSTALLER_REGISTRY_Detail "Zapisuji instal tor do registr…"
|
||||
StrCpy $UNINSTALLER_FINISHED_Detail "DokonŸeno"
|
||||
StrCpy $UNINSTALL_MESSAGEBOX "Nezd se, §e ${APPLICATION_NAME} je nainstalov na ve slo§ce '$INSTDIR'.$\n$\nChcete pokraŸovat (nedoporuŸuje se)?"
|
||||
StrCpy $UNINSTALL_MESSAGEBOX "Nezd se, §e ${APPLICATION_NAME} je nainstalov na v adres ýi '$INSTDIR'.$\n$\nChcete pokraŸovat (nedoporuŸuje se)?"
|
||||
StrCpy $UNINSTALL_ABORT "Odinstalace zruçena u§ivatelem"
|
||||
StrCpy $INIT_NO_QUICK_LAUNCH "Z stupce rychl‚ho spuçtØn¡ (nen¡ k dispozici)"
|
||||
StrCpy $INIT_NO_DESKTOP "Z stupce na ploçe (pýep¡çe existuj¡c¡)"
|
||||
|
||||
@@ -3,12 +3,12 @@ StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Mostrar notas de lançamento"
|
||||
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Existem ${APPLICATION_EXECUTABLE} processo(s) em execução que precisa(m) de ser interrompido(s).$\nDeseja que o instalador o(s) termine automaticamente?"
|
||||
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "A terminar os processos ${APPLICATION_EXECUTABLE}."
|
||||
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Não foi encontrado o processo a terminar!"
|
||||
StrCpy $PageReinstall_NEW_Field_1 "Uma versão antiga de ${APPLICATION_NAME} está instalada no sistema. É recomendado que você desinstale a versão atual antes de instalar a mais recente. Selecione a operação que deseja executar e clique em $\"Avançar$\" para continuar."
|
||||
StrCpy $PageReinstall_NEW_Field_1 "Uma versão antiga de ${APPLICATION_NAME} está instalada no sistema. É recomendado que desinstale a versão atual antes de instalar a mais recente. Selecione a operação que deseja executar e clique em $\"Avançar$\" para continuar."
|
||||
StrCpy $PageReinstall_NEW_Field_2 "Desinstalar antes de instalar"
|
||||
StrCpy $PageReinstall_NEW_Field_3 "Não desinstale"
|
||||
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Já instalado"
|
||||
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Escolha como pretende instalar ${APPLICATION_NAME}."
|
||||
StrCpy $PageReinstall_OLD_Field_1 "Uma versão mais recente do ${APPLICATION_NAME} já está instalada! Não é recomendada a instalação de uma versão mais antiga. Se realmente deseja instalar esta versão, aconselha-se a desinstalação da versão atual primeiro. Selecione a operação que deseja executar e clique em Avançar para continuar."
|
||||
StrCpy $PageReinstall_OLD_Field_1 "Uma versão mais recente da aplicação ${APPLICATION_NAME} já está instalada! Não é recomendada a instalação de uma versão mais antiga. Se realmente deseja instalar esta versão, aconselha-se a desinstalação da versão atual primeiro. Selecione a operação que deseja executar e clique em Avançar para continuar."
|
||||
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} já está instalada.$\nSelecione a operação que deseja realizar e clique em 'Seguinte' para continuar."
|
||||
StrCpy $PageReinstall_SAME_Field_2 "Adicionar/Reinstalar Componentes"
|
||||
StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
|
||||
@@ -25,12 +25,12 @@ StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Atalho de início rápido"
|
||||
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "A criar atalho de início rápido"
|
||||
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "O essencial de ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "Atalho de ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Atalho no ambiente de trabalho de ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Atalho do ambiente de trabalho para ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Atalho de início rápido de ${APPLICATION_NAME}."
|
||||
StrCpy $UNINSTALLER_FILE_Detail "A escrever o Desinstalador"
|
||||
StrCpy $UNINSTALLER_REGISTRY_Detail "A escrever chaves de registo do instalador"
|
||||
StrCpy $UNINSTALLER_FINISHED_Detail "Terminado"
|
||||
StrCpy $UNINSTALL_MESSAGEBOX "Não parece que ${APPLICATION_NAME} esteja instalado no diretório '$INSTDIR'.$\n$\nContinuar na mesma (não recomendado)?"
|
||||
StrCpy $UNINSTALL_MESSAGEBOX "Não parece que a aplicação ${APPLICATION_NAME} esteja instalada no diretório '$INSTDIR'.$\n$\nContinuar na mesma (não recomendado)?"
|
||||
StrCpy $UNINSTALL_ABORT "Desinstalação cancelada pelo utilizador"
|
||||
StrCpy $INIT_NO_QUICK_LAUNCH "Atalho de Início Rápido (N/A)"
|
||||
StrCpy $INIT_NO_DESKTOP "Atalho do Ambiente de Trabalho (sobrepõe o existente)"
|
||||
|
||||
@@ -9,6 +9,7 @@ StrCpy $PageReinstall_NEW_Field_3 "Avinstallera inte"
|
||||
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Redan installerad"
|
||||
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Välj hur du vill installera ${APPLICATION_NAME}."
|
||||
StrCpy $PageReinstall_OLD_Field_1 "En nyare version av ${APPLICATION_NAME} är redan installerad! Det rekommenderas inte att du installerar en äldre version. Om du verkligen vill installera denna äldre versionen, är det bättre att du avinstallerar den nuvarande versionen först. Välj den åtgärd du vill utföra och klicka Nästa för att fortsätta."
|
||||
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} är redan installerad.$\n$\nVälj den åtgärd du vill utföra och klicka på Nästa för att fortsätta."
|
||||
StrCpy $PageReinstall_SAME_Field_2 "Lägg till/Ominstallera komponenter"
|
||||
StrCpy $PageReinstall_SAME_Field_3 "Avinstallera ${APPLICATION_NAME}"
|
||||
StrCpy $UNINSTALLER_APPDATA_TITLE "Avinstallera ${APPLICATION_NAME}"
|
||||
@@ -40,4 +41,3 @@ StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Detta avinstallationsprogram kräver adm
|
||||
StrCpy $UAC_ERROR_LOGON_SERVICE "Login-service körs inte, avbryter!"
|
||||
StrCpy $INIT_UNINSTALLER_RUNNING "Avinstallationsprogrammet körs redan."
|
||||
StrCpy $SectionGroup_Shortcuts "Genvägar"
|
||||
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.$\r$\nSelect the operation you want to perform and click Next to continue."
|
||||
|
||||
@@ -31,6 +31,13 @@ use strict;
|
||||
|
||||
print "Hello, this is t6, a tester for csync with ownCloud.\n";
|
||||
|
||||
# Checking CURL is installed to avoid misleading errors later...
|
||||
system(("curl", "--help", ">", "/dev/null"));
|
||||
if ($? != 0) {
|
||||
print "CURL is needed for this script, aborting with error\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
initTesting();
|
||||
|
||||
sub createPostUpdateScript($)
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ logs.
|
||||
|
||||
1. Output of `owncloud --logwindow` or `owncloud --logfile log.txt`
|
||||
(On Windows using `cmd.exe`, you might need to first `cd` into the ownCloud directory)
|
||||
(See also http://doc.owncloud.org/desktop/1.8/troubleshooting.html#client-logfile )
|
||||
(See also http://doc.owncloud.org/desktop/2.2/troubleshooting.html#client-logfile )
|
||||
|
||||
2. Web server error log:
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ set(client_SRCS
|
||||
settingsdialog.cpp
|
||||
share.cpp
|
||||
sharedialog.cpp
|
||||
shareemailwidget.cpp
|
||||
sharelinkwidget.cpp
|
||||
shareusergroupwidget.cpp
|
||||
sharee.cpp
|
||||
|
||||
@@ -248,6 +248,9 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
|
||||
QHash<QString, int> accNotified;
|
||||
QString listAccountName;
|
||||
|
||||
// Whether a new notification widget was added to the notificationLayout.
|
||||
bool newNotificationShown = false;
|
||||
|
||||
foreach( auto activity, list ) {
|
||||
if( _blacklistedNotifications.contains(activity)) {
|
||||
qDebug() << Q_FUNC_INFO << "Activity in blacklist, skip";
|
||||
@@ -271,6 +274,7 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
|
||||
_ui->_notifyScroll->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow);
|
||||
#endif
|
||||
_widgetForNotifId[activity.ident()] = widget;
|
||||
newNotificationShown = true;
|
||||
}
|
||||
|
||||
widget->setActivity( activity );
|
||||
@@ -365,6 +369,10 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
|
||||
const QString log = tr("%1 Notifications - Action Required").arg(Theme::instance()->appNameGUI());
|
||||
emit guiLog( log, msg);
|
||||
}
|
||||
|
||||
if (newNotificationShown) {
|
||||
emit newNotification();
|
||||
}
|
||||
}
|
||||
|
||||
void ActivityWidget::slotSendNotificationRequest(const QString& accountName, const QString& link, const QByteArray& verb)
|
||||
@@ -517,6 +525,7 @@ ActivitySettings::ActivitySettings(QWidget *parent)
|
||||
connect(_activityWidget, SIGNAL(copyToClipboard()), this, SLOT(slotCopyToClipboard()));
|
||||
connect(_activityWidget, SIGNAL(hideActivityTab(bool)), this, SLOT(setActivityTabHidden(bool)));
|
||||
connect(_activityWidget, SIGNAL(guiLog(QString,QString)), this, SIGNAL(guiLog(QString,QString)));
|
||||
connect(_activityWidget, SIGNAL(newNotification()), SLOT(slotShowActivityTab()));
|
||||
|
||||
_protocolWidget = new ProtocolWidget(this);
|
||||
_tab->insertTab(1, _protocolWidget, Theme::instance()->syncStateIcon(SyncResult::Success), tr("Sync Protocol"));
|
||||
@@ -582,6 +591,13 @@ void ActivitySettings::slotShowIssueItemCount(int cnt)
|
||||
_tab->setTabText(_syncIssueTabId, cntText);
|
||||
}
|
||||
|
||||
void ActivitySettings::slotShowActivityTab()
|
||||
{
|
||||
if (_activityTabId != -1) {
|
||||
_tab->setCurrentIndex(_activityTabId);
|
||||
}
|
||||
}
|
||||
|
||||
void ActivitySettings::slotCopyToClipboard()
|
||||
{
|
||||
QString text;
|
||||
|
||||
@@ -81,7 +81,7 @@ signals:
|
||||
void copyToClipboard();
|
||||
void rowsInserted();
|
||||
void hideActivityTab(bool);
|
||||
void newNotificationList(const ActivityList& list);
|
||||
void newNotification();
|
||||
|
||||
private slots:
|
||||
void slotBuildNotificationDisplay(const ActivityList& list);
|
||||
@@ -143,6 +143,7 @@ private slots:
|
||||
void setActivityTabHidden(bool hidden);
|
||||
void slotRegularNotificationCheck();
|
||||
void slotShowIssueItemCount(int cnt);
|
||||
void slotShowActivityTab();
|
||||
|
||||
signals:
|
||||
void guiLog(const QString&, const QString&);
|
||||
|
||||
@@ -179,6 +179,8 @@ Application::Application(int &argc, char **argv) :
|
||||
|
||||
connect(FolderMan::instance()->socketApi(), SIGNAL(shareCommandReceived(QString, QString, bool)),
|
||||
_gui, SLOT(slotShowShareDialog(QString, QString, bool)));
|
||||
connect(FolderMan::instance()->socketApi(), SIGNAL(shareEmailCommandReceived(QString,QString,bool)),
|
||||
_gui, SLOT(slowSendShareLink(QString, QString, bool)));
|
||||
|
||||
// startup procedure.
|
||||
connect(&_checkConnectionTimer, SIGNAL(timeout()), this, SLOT(slotCheckConnection()));
|
||||
|
||||
@@ -1001,7 +1001,7 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel)
|
||||
void Folder::slotAboutToRestoreBackup(bool *restore)
|
||||
{
|
||||
QString msg =
|
||||
tr("This sync would reset the files to an erlier time in the sync folder '%1'.\n"
|
||||
tr("This sync would reset the files to an earlier time in the sync folder '%1'.\n"
|
||||
"This might be because a backup was restored on the server.\n"
|
||||
"Continuing the sync as normal will cause all your files to be overwritten by an older "
|
||||
"file in an earlier state. "
|
||||
|
||||
@@ -584,7 +584,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
|
||||
QStringList sortedSubfolders = list;
|
||||
// skip the parent item (first in the list)
|
||||
sortedSubfolders.erase(sortedSubfolders.begin());
|
||||
sortedSubfolders.sort();
|
||||
Utility::sortFilenames(sortedSubfolders);
|
||||
|
||||
QVarLengthArray<int, 10> undecidedIndexes;
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ void FolderWizardRemotePath::slotUpdateDirectories(const QStringList &list)
|
||||
root->setData(0, Qt::UserRole, "/");
|
||||
}
|
||||
QStringList sortedList = list;
|
||||
sortedList.sort();
|
||||
Utility::sortFilenames(sortedList);
|
||||
foreach (QString path, sortedList) {
|
||||
path.remove(webdavFolder);
|
||||
QStringList paths = path.split('/');
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "progressdispatcher.h"
|
||||
#include "owncloudsetupwizard.h"
|
||||
#include "sharedialog.h"
|
||||
#include "shareemailwidget.h"
|
||||
#if defined(Q_OS_MAC)
|
||||
# include "settingsdialogmac.h"
|
||||
# include "macwindow.h" // qtmacgoodies
|
||||
@@ -911,5 +912,27 @@ void ownCloudGui::slotRemoveDestroyedShareDialogs()
|
||||
}
|
||||
}
|
||||
|
||||
void ownCloudGui::slowSendShareLink(const QString &sharePath, const QString &localPath, bool resharingAllowed)
|
||||
{
|
||||
const auto folder = FolderMan::instance()->folderForPath(localPath);
|
||||
if (!folder) {
|
||||
qDebug() << "Could not open share email widget for" << localPath << "no responsible folder found";
|
||||
return;
|
||||
}
|
||||
|
||||
// For https://github.com/owncloud/client/issues/3783
|
||||
_settingsDialog->hide();
|
||||
|
||||
if (!resharingAllowed) {
|
||||
qDebug() << "Could not open share email widget for" << localPath << "no reshare permissions";
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << Q_FUNC_INFO << "Opening share email widget" << sharePath << localPath;
|
||||
ShareEmailWidget *w = new ShareEmailWidget(folder->accountState()->account(), sharePath);
|
||||
w->setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
raiseDialog(w);
|
||||
}
|
||||
|
||||
|
||||
} // end namespace
|
||||
|
||||
@@ -79,6 +79,7 @@ public slots:
|
||||
void slotTrayMessageIfServerUnsupported(Account *account);
|
||||
void slotShowShareDialog(const QString &sharePath, const QString &localPath, bool resharingAllowed);
|
||||
void slotRemoveDestroyedShareDialogs();
|
||||
void slowSendShareLink(const QString &sharePath, const QString &localPath, bool resharingAllowed);
|
||||
|
||||
private slots:
|
||||
void slotDisplayIdle();
|
||||
|
||||
@@ -222,7 +222,7 @@ void SelectiveSyncTreeView::slotUpdateDirectories(QStringList list)
|
||||
}
|
||||
}
|
||||
|
||||
list.sort();
|
||||
Utility::sortFilenames(list);
|
||||
foreach (QString path, list) {
|
||||
auto size = job ? job->_sizes.value(path) : 0;
|
||||
path.remove(pathToRemove);
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#include "shareemailwidget.h"
|
||||
#include "share.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QSharedPointer>
|
||||
#include <QUrl>
|
||||
|
||||
namespace OCC {
|
||||
|
||||
ShareEmailWidget::ShareEmailWidget(AccountPtr account,
|
||||
const QString &sharePath,
|
||||
QWidget *parent)
|
||||
: QWidget(parent),
|
||||
_account(account),
|
||||
_sharePath(sharePath)
|
||||
{
|
||||
resize(200,200);
|
||||
|
||||
_layout.addWidget(&_spinner);
|
||||
_layout.addWidget(&_label);
|
||||
|
||||
_label.setText(tr("Fetching share link"));
|
||||
_spinner.startAnimation();
|
||||
|
||||
setLayout(&_layout);
|
||||
|
||||
/*
|
||||
* Create the share manager and connect it properly
|
||||
*/
|
||||
_manager = new ShareManager(_account, this);
|
||||
connect(_manager, SIGNAL(linkShareCreated(QSharedPointer<LinkShare>)), this, SLOT(slotLinkShareCreated(QSharedPointer<LinkShare>)));
|
||||
|
||||
_manager->createLinkShare(_sharePath);
|
||||
}
|
||||
|
||||
ShareEmailWidget::~ShareEmailWidget()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ShareEmailWidget::slotLinkShareCreated(const QSharedPointer<LinkShare> share)
|
||||
{
|
||||
QUrl mailto("mailto:");
|
||||
|
||||
QString body = tr("I shared a file with you at %1.").arg(share->getLink().toString());
|
||||
|
||||
if (share->getExpireDate().isValid()) {
|
||||
body += tr("\nThis share expires at %1.").arg(share->getExpireDate().toString());
|
||||
}
|
||||
|
||||
mailto.setQuery("body?"+body);
|
||||
|
||||
// Open app
|
||||
QDesktopServices::openUrl(mailto);
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef SHAREEMAILDIALOG_H
|
||||
#define SHAREEMAILDIALOG_H
|
||||
|
||||
#include "accountfwd.h"
|
||||
#include "QProgressIndicator.h"
|
||||
#include "share.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QSharedPointer>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
namespace OCC {
|
||||
|
||||
class ShareManager;
|
||||
|
||||
class ShareEmailWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
|
||||
explicit ShareEmailWidget(AccountPtr account,
|
||||
const QString &sharePath,
|
||||
QWidget *parent = 0);
|
||||
~ShareEmailWidget();
|
||||
|
||||
private slots:
|
||||
void slotLinkShareCreated(const QSharedPointer<LinkShare> share);
|
||||
void slotPasswordEnterd();
|
||||
void slotPasswordRequired();
|
||||
|
||||
private:
|
||||
void share(const QString &sharePath, const QString &password);
|
||||
|
||||
AccountPtr _account;
|
||||
QString _sharePath;
|
||||
|
||||
QHBoxLayout _layout;
|
||||
QLabel _label;
|
||||
QProgressIndicator _spinner;
|
||||
|
||||
ShareManager *_manager;
|
||||
};
|
||||
|
||||
}
|
||||
#endif // SHAREEMAILDIALOG_H
|
||||
@@ -72,9 +72,7 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account,
|
||||
|
||||
_completer->setModel(_completerModel);
|
||||
_completer->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
||||
_completer->setFilterMode(Qt::MatchContains);
|
||||
#endif
|
||||
_completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
|
||||
_ui->shareeLineEdit->setCompleter(_completer);
|
||||
|
||||
_manager = new ShareManager(_account, this);
|
||||
|
||||
@@ -453,6 +453,66 @@ void SocketApi::command_SHARE_MENU_TITLE(const QString &, QIODevice* socket)
|
||||
sendMessage(socket, QLatin1String("SHARE_MENU_TITLE:") + tr("Share with %1", "parameter is ownCloud").arg(Theme::instance()->appNameGUI()));
|
||||
}
|
||||
|
||||
void SocketApi::command_SHARE_EMAIL(const QString& localFile, QIODevice* socket)
|
||||
{
|
||||
if (!socket) {
|
||||
qDebug() << Q_FUNC_INFO << "No valid socket object.";
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << Q_FUNC_INFO << localFile;
|
||||
|
||||
auto theme = Theme::instance();
|
||||
|
||||
Folder *shareFolder = FolderMan::instance()->folderForPath(localFile);
|
||||
if (!shareFolder) {
|
||||
const QString message = QLatin1String("SHARE_EMAIL: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_EMAIL:NOTCONNECTED:")+QDir::toNativeSeparators(localFile);
|
||||
// if the folder isn't connected, don't open the share dialog
|
||||
sendMessage(socket, message);
|
||||
} else if (!theme->linkSharing()) {
|
||||
const QString message = QLatin1String("SHARE_EMAIL:NOP:")+QDir::toNativeSeparators(localFile);
|
||||
sendMessage(socket, message);
|
||||
} else {
|
||||
const QString localFileClean = QDir::cleanPath(localFile);
|
||||
const QString file = localFileClean.mid(shareFolder->cleanPath().length()+1);
|
||||
SyncFileStatus fileStatus = shareFolder->syncEngine().syncFileStatusTracker().fileStatus(file);
|
||||
|
||||
// Verify the file is on the server (to our knowledge of course)
|
||||
if (fileStatus.tag() != SyncFileStatus::StatusUpToDate) {
|
||||
const QString message = QLatin1String("SHARE:NOTSYNCED:")+QDir::toNativeSeparators(localFile);
|
||||
sendMessage(socket, message);
|
||||
return;
|
||||
}
|
||||
|
||||
const QString remotePath = QDir(shareFolder->remotePath()).filePath(file);
|
||||
|
||||
// Can't share root folder
|
||||
if (remotePath == "/") {
|
||||
const QString message = QLatin1String("SHARE_EMAIL:CANNOTSHAREROOT:")+QDir::toNativeSeparators(localFile);
|
||||
sendMessage(socket, message);
|
||||
return;
|
||||
}
|
||||
|
||||
SyncJournalFileRecord rec = shareFolder->journalDb()->getFileRecord(localFileClean);
|
||||
|
||||
bool allowReshare = true; // lets assume the good
|
||||
if( rec.isValid() ) {
|
||||
// check the permission: Is resharing allowed?
|
||||
if( !rec._remotePerm.contains('R') ) {
|
||||
allowReshare = false;
|
||||
}
|
||||
}
|
||||
const QString message = QLatin1String("SHARE_EMAIL:OK:")+QDir::toNativeSeparators(localFile);
|
||||
sendMessage(socket, message);
|
||||
|
||||
emit shareEmailCommandReceived(remotePath, localFileClean, allowReshare);
|
||||
}
|
||||
}
|
||||
|
||||
QString SocketApi::buildRegisterPathMessage(const QString& path)
|
||||
{
|
||||
QFileInfo fi(path);
|
||||
|
||||
@@ -56,6 +56,7 @@ public slots:
|
||||
signals:
|
||||
void shareCommandReceived(const QString &sharePath, const QString &localPath, bool resharingAllowed);
|
||||
void shareUserGroupCommandReceived(const QString &sharePath, const QString &localPath, bool resharingAllowed);
|
||||
void shareEmailCommandReceived(const QString &sharePath, const QString &localPath, bool resharingAllowed);
|
||||
|
||||
private slots:
|
||||
void slotNewConnection();
|
||||
@@ -70,6 +71,7 @@ private:
|
||||
Q_INVOKABLE void command_RETRIEVE_FOLDER_STATUS(const QString& argument, QIODevice* socket);
|
||||
Q_INVOKABLE void command_RETRIEVE_FILE_STATUS(const QString& argument, QIODevice* socket);
|
||||
Q_INVOKABLE void command_SHARE(const QString& localFile, QIODevice* socket);
|
||||
Q_INVOKABLE void command_SHARE_EMAIL(const QString& localFile, QIODevice* socket);
|
||||
|
||||
Q_INVOKABLE void command_VERSION(const QString& argument, QIODevice* socket);
|
||||
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
#else
|
||||
#include <QStandardPaths>
|
||||
#endif
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
||||
#include <QCollator>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <sys/statvfs.h>
|
||||
@@ -541,4 +545,16 @@ quint64 Utility::StopWatch::durationOfLap( const QString& lapName ) const
|
||||
return _lapTimes.value(lapName, 0);
|
||||
}
|
||||
|
||||
void Utility::sortFilenames(QStringList& fileNames)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
||||
QCollator collator;
|
||||
collator.setNumericMode(true);
|
||||
collator.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
qSort(fileNames.begin(), fileNames.end(), collator);
|
||||
#else
|
||||
fileNames.sort(Qt::CaseInsensitive);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace OCC
|
||||
|
||||
@@ -136,6 +136,11 @@ namespace Utility
|
||||
quint64 durationOfLap( const QString& lapName ) const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Sort a QStringList in a way that's appropriate for filenames
|
||||
*/
|
||||
OWNCLOUDSYNC_EXPORT void sortFilenames(QStringList& fileNames);
|
||||
|
||||
}
|
||||
/** @} */ // \addtogroup
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário