Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2018-08-30 19:14:13 +0300
committerOlivier Goffart <olivier@woboq.com>2018-08-31 17:01:21 +0300
commit0696805cef30e5029533d8d5d10b66bef694d8ca (patch)
tree700400b82f5129ae9fa405418910bc07af8d7624 /src
parent1e5b632e6084182eae4c88dad87b1c69d94a156c (diff)
Virtual files: Don't show selective sync
Issue #6724
Diffstat (limited to 'src')
-rw-r--r--src/gui/accountsettings.cpp5
-rw-r--r--src/gui/folderstatusmodel.cpp9
2 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index 4c33b0b59..93cea1111 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -287,6 +287,9 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
bool folderPaused = _model->data(index, FolderStatusDelegate::FolderSyncPaused).toBool();
bool folderConnected = _model->data(index, FolderStatusDelegate::FolderAccountConnected).toBool();
auto folderMan = FolderMan::instance();
+ QPointer<Folder> folder = folderMan->folder(alias);
+ if (!folder)
+ return;
QMenu *menu = new QMenu(tv);
@@ -295,7 +298,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
QAction *ac = menu->addAction(tr("Open folder"));
connect(ac, &QAction::triggered, this, &AccountSettings::slotOpenCurrentFolder);
- if (!ui->_folderList->isExpanded(index)) {
+ if (!ui->_folderList->isExpanded(index) && !folder->useVirtualFiles()) {
ac = menu->addAction(tr("Choose what to sync"));
ac->setEnabled(folderConnected);
connect(ac, &QAction::triggered, this, &AccountSettings::doExpand);
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 5d32b8d94..ea0c6d5fd 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -362,6 +362,8 @@ int FolderStatusModel::rowCount(const QModelIndex &parent) const
auto info = infoForIndex(parent);
if (!info)
return 0;
+ if (info->_folder && info->_folder->useVirtualFiles())
+ return 0;
if (info->hasLabel())
return 1;
return info->_subs.count();
@@ -517,6 +519,9 @@ bool FolderStatusModel::hasChildren(const QModelIndex &parent) const
if (!info)
return false;
+ if (info->_folder && info->_folder->useVirtualFiles())
+ return false;
+
if (!info->_fetched)
return true;
@@ -542,6 +547,10 @@ bool FolderStatusModel::canFetchMore(const QModelIndex &parent) const
// Keep showing the error to the user, it will be hidden when the account reconnects
return false;
}
+ if (info->_folder && info->_folder->useVirtualFiles()) {
+ // Selective sync is hidden in that case
+ return false;
+ }
return true;
}