mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 06:25:56 +03:00
Selective sync ui: Fix #2390
This commit is contained in:
parent
86e13ea06f
commit
1c4072e231
2 changed files with 9 additions and 2 deletions
|
@ -81,7 +81,7 @@ void SelectiveSyncTreeView::recursiveInsert(QTreeWidgetItem* parent, QStringList
|
|||
|| parent->checkState(0) == Qt::PartiallyChecked) {
|
||||
item->setCheckState(0, Qt::Checked);
|
||||
foreach(const QString &str , _oldBlackList) {
|
||||
if (str + "/" == path) {
|
||||
if (str == path) {
|
||||
item->setCheckState(0, Qt::Unchecked);
|
||||
break;
|
||||
} else if (str.startsWith(path)) {
|
||||
|
@ -137,6 +137,9 @@ void SelectiveSyncTreeView::slotUpdateDirectories(const QStringList&list)
|
|||
if (paths.last().isEmpty()) paths.removeLast();
|
||||
if (paths.isEmpty())
|
||||
continue;
|
||||
if (!path.endsWith('/')) {
|
||||
path.append('/');
|
||||
}
|
||||
recursiveInsert(root, paths, path);
|
||||
}
|
||||
root->setExpanded(true);
|
||||
|
@ -223,7 +226,7 @@ QStringList SelectiveSyncTreeView::createBlackList(QTreeWidgetItem* root) const
|
|||
|
||||
switch(root->checkState(0)) {
|
||||
case Qt::Unchecked:
|
||||
return QStringList(root->data(0, Qt::UserRole).toString());
|
||||
return QStringList(root->data(0, Qt::UserRole).toString() + "/");
|
||||
case Qt::Checked:
|
||||
return QStringList();
|
||||
case Qt::PartiallyChecked:
|
||||
|
|
|
@ -29,8 +29,12 @@ class SelectiveSyncTreeView : public QTreeWidget {
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit SelectiveSyncTreeView(Account *account, QWidget* parent = 0);
|
||||
|
||||
/// Returns a list of blacklisted paths, each including the trailing /
|
||||
QStringList createBlackList(QTreeWidgetItem* root = 0) const;
|
||||
void refreshFolders();
|
||||
|
||||
// oldBlackList is a list of excluded paths, each including a trailing /
|
||||
void setFolderInfo(const QString &folderPath, const QString &rootName,
|
||||
const QStringList &oldBlackList = QStringList()) {
|
||||
_folderPath = folderPath;
|
||||
|
|
Loading…
Reference in a new issue