mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
Never ignore .sync-exclude, even if excludeHidden
That is unless any of the parent folders is hidden. Signed-off-by: Samir Benmendil <me@rmz.io>
This commit is contained in:
parent
758483bc6e
commit
34fcb13e78
3 changed files with 14 additions and 4 deletions
|
@ -343,15 +343,15 @@ bool ExcludedFiles::isExcluded(
|
|||
return true;
|
||||
}
|
||||
|
||||
//TODO this seems a waste, hidden files are ignored before hitting this function it seems
|
||||
if (excludeHidden) {
|
||||
QString path = filePath;
|
||||
// Check all path subcomponents, but to *not* check the base path:
|
||||
// We do want to be able to sync with a hidden folder as the target.
|
||||
while (path.size() > basePath.size()) {
|
||||
QFileInfo fi(path);
|
||||
//TODO probably not ignore `.sync-exclude.lst` files as it makes sense for them to be
|
||||
//synced
|
||||
if (fi.isHidden() || fi.fileName().startsWith(QLatin1Char('.'))) {
|
||||
if (fi.fileName() != ".sync-exclude.lst"
|
||||
&& (fi.isHidden() || fi.fileName().startsWith(QLatin1Char('.')))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,9 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
|
|||
* because it's a hidden file that should not be synced.
|
||||
* This code should probably be in csync_exclude, but it does not have the fs parameter.
|
||||
* Keep it here for now */
|
||||
if (ctx->ignore_hidden_files && (fs->is_hidden)) {
|
||||
if (ctx->ignore_hidden_files
|
||||
&& fs->is_hidden
|
||||
&& !fs->path.endsWith(".sync-exclude.lst")) {
|
||||
qCInfo(lcUpdate, "file excluded because it is a hidden file: %s", fs->path.constData());
|
||||
excluded = CSYNC_FILE_EXCLUDE_HIDDEN;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,14 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent)
|
|||
|
||||
connect(this, &QDialog::accepted, [=]() {
|
||||
ui->ignoreTableWidget->slotWriteIgnoreFile(userConfig);
|
||||
/* handle the hidden file checkbox */
|
||||
|
||||
/* the ignoreHiddenFiles flag is a folder specific setting, but for now, it is
|
||||
* handled globally. Save it to every folder that is defined.
|
||||
* TODO this can now be fixed, simply attach this IgnoreListEditor to top-level account
|
||||
* settings
|
||||
*/
|
||||
FolderMan::instance()->setIgnoreHiddenFiles(ignoreHiddenFiles());
|
||||
});
|
||||
connect(ui->buttonBox, &QDialogButtonBox::clicked,
|
||||
this, &IgnoreListEditor::slotRestoreDefaults);
|
||||
|
|
Loading…
Reference in a new issue