diff --git a/src/csync/csync_exclude.cpp b/src/csync/csync_exclude.cpp index 7517ee218..7a177b840 100644 --- a/src/csync/csync_exclude.cpp +++ b/src/csync/csync_exclude.cpp @@ -84,6 +84,7 @@ static const char *csync_exclude_expand_escapes(const char * input) case '"': out[o++] = '"'; break; case '?': out[o++] = '?'; break; case '\\': out[o++] = '\\'; break; + case '#': out[o++] = '#'; break; case 'a': out[o++] = '\a'; break; case 'b': out[o++] = '\b'; break; case 'f': out[o++] = '\f'; break; diff --git a/src/gui/ignorelisteditor.cpp b/src/gui/ignorelisteditor.cpp index 64c39c48f..3253b2b1e 100644 --- a/src/gui/ignorelisteditor.cpp +++ b/src/gui/ignorelisteditor.cpp @@ -107,6 +107,8 @@ void IgnoreListEditor::slotUpdateLocalIgnoreList() QByteArray prepend; if (deletableItem->checkState() == Qt::Checked) { prepend = "]"; + } else if (patternItem->text().startsWith('#')) { + prepend = "\\"; } ignores.write(prepend + patternItem->text().toUtf8() + '\n'); } diff --git a/sync-exclude.lst b/sync-exclude.lst index bdf6c3441..fe5cbee10 100644 --- a/sync-exclude.lst +++ b/sync-exclude.lst @@ -1,3 +1,5 @@ +# This file contains fixed global exclude patterns + *~ ~$* .~lock.* diff --git a/test/csync/csync_tests/check_csync_exclude.cpp b/test/csync/csync_tests/check_csync_exclude.cpp index 99a771266..0525942ac 100644 --- a/test/csync/csync_tests/check_csync_exclude.cpp +++ b/test/csync/csync_tests/check_csync_exclude.cpp @@ -387,9 +387,9 @@ static void check_csync_exclude_expand_escapes(void **state) (void)state; const char *str = csync_exclude_expand_escapes( - "keep \\' \\\" \\? \\\\ \\a \\b \\f \\n \\r \\t \\v \\z"); + "keep \\' \\\" \\? \\\\ \\a \\b \\f \\n \\r \\t \\v \\z \\#"); assert_true(0 == strcmp( - str, "keep ' \" ? \\ \a \b \f \n \r \t \v \\z")); + str, "keep ' \" ? \\ \a \b \f \n \r \t \v \\z #")); SAFE_FREE(str); str = csync_exclude_expand_escapes("");