Commit graph

231 commits

Author SHA1 Message Date
Matthieu Gallien
4371c0cbfe add headers in cmake files to get them properly detected
qt creator for example requires that headers are explcitly given in the
source lists

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-02-11 14:31:22 +00:00
Camila
5788f35e82
Skip sync exclude file from list of exclude files if it doesn't exist.
The file might not exist anymore because the user deleted it by hand or
the folder where it was located got unchecked in the selective sync
view. It is a fix for #2632.

Signed-off-by: Camila <hello@camila.codes>
2021-10-28 11:37:56 +02:00
Felix Weilbach
a663d235ef Add .sync-exclude.lst to exclude files
Previously the .sync-exclude.lst file of the sync root directory was
not added to the exclude files, because the current logic did only
recognize .sync-exclude.lst files when their containing directory was
discovered during the discovery phase. Therefore the sync root
.sync-exclude.lst file was never discovered. See also
ExcludedFiles::traversalPatternMatch().

Fix: #3830, #2728

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-10-14 14:02:29 +00:00
Matthieu Gallien
833237b2e4 use alias target for internal libraries
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-10-06 07:56:33 +00:00
Matthieu Gallien
c751fd5672 ensure DLL are generated with branded names
cmake distinct runtime and library

on unix dynamic shared libraries are library kind of objects
on windows they are runtime kind of objects

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-10-06 07:56:33 +00:00
Guido Falsi
b0b70d1e77 Check for argp library before depending on it.
Signed-off-by: Guido Falsi <madpilot@freebsd.org>
2021-09-29 15:46:07 +02:00
Guido Falsi
5f036641b9 Add -largp on non linux systems.
Signed-off-by: Guido Falsi <madpilot@freebsd.org>
2021-09-29 15:46:07 +02:00
Felix Weilbach
fb1b3481d1 Fix warnings
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-09-17 13:32:26 +00:00
Nicolas Fella
18ddb9df4a Use CMAKE_INSTALL_DATADIR instead of custom DATADIR
CMake provides what we wan out of the box

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2021-09-01 11:43:03 +00:00
Matthieu Gallien
25669938fd let clang-tidy add missing override after enabling again the check
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-08-31 08:35:56 +00:00
Hannah von Reth
789e0e45d5 Fix Windows long path issue introduced in dd641fae997d71c8396b77def2fa25ad96fdf47f 2021-08-23 09:40:27 +02:00
Klaas Freitag
73549a0529 Ignore the desktop.ini file in every directory, not only in top dir. (#8299)
* Ignore the desktop.ini file in every directory, not only in top dir.

See https://github.com/owncloud/client/issues/8298  for reasons.

* Fix test for ignoring desktop.ini everywhere.

Co-authored-by: Hannah von Reth <hannah.vonreth@owncloud.com>
2021-08-23 09:40:26 +02:00
Nicolas Fella
43cccb0a73 Don't use variables for CMake target identifiers
This makes the code a bit nicer to read and maybe a bit more robust.

Set the relevant OUTPUT_NAME target properties to keep the ability to
customize the names of the installed binaries.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2021-08-19 10:30:23 +00:00
Felix Weilbach
ccd27870a7 Don't compare integers with different signs
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-08-11 20:20:39 +00:00
Felix Weilbach
d72f7e9109 Check result of setPinState()
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-08-11 20:20:39 +00:00
Hannah von Reth
98655ef28b Fix warning by using qsizetype instead of size_t
Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-05-06 07:35:59 +00:00
Matthieu Gallien
20357ca7fa Revert "Add CMake option to enable address sanitizers"
This reverts commit 3000e26640.

This was not intended for a direct push

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-04-19 17:54:09 +02:00
Felix Weilbach
3000e26640 Add CMake option to enable address sanitizers
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-04-19 15:38:59 +02:00
Felix Weilbach
da1e5c448a CMake: Use own SQLite3 on macOS and Windows
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-04-15 08:51:06 +02:00
allexzander
82953d0601 Fix review comments.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander
3fde838bee Fix for Windows long path issue.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-03-18 12:07:07 +02:00
allexzander
3d266b9246 Win tests compilation fix. For Windows, the build was failing because of not being able to locate #include <sqlite3.h> in tests.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-02-03 13:52:10 +02:00
Nicolas Fella
ab064c92b6 Fix build against Qt 5.15.3
Use QLatin1Char to prevent build error due to stricter QT_NO_CAST_FROM_ASCII

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2021-01-25 08:19:49 +00:00
Kevin Ottens
6e51dcf9c6
Provide the path to the current folder to statTypeVirtualFile on unix
Otherwise backends can't get to the actual file which will be needed for
the XAttr backend.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-14 12:57:03 +01:00
Kevin Ottens
0756497c3e
Get the excluded files test to pass again on Windows
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Kevin Ottens
c57eff6fd8
Please the clang-tidy overlord
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Hannah von Reth
4e373ca7ff
Remove now unneeded cmake test and define 2020-12-15 11:01:52 +01:00
Hannah von Reth
ebd8047cb6
Replace custome date parser QDateTime::fromString(value, Qt::RFC2822Date) 2020-12-15 11:01:52 +01:00
Kevin Ottens
2cf76bbcbf
Repair the Windows Build
We now enforce the use of QStringLiteral and friends in some places,
but that feel through the cracks for some of the Windows specific code.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Hannah von Reth
f220151527
Remove the use of goto from src/csync/csync_exclude.cpp 2020-12-15 10:59:19 +01:00
Hannah von Reth
563b347567
csync: apply strict QString handling 2020-12-15 10:59:16 +01:00
Hannah von Reth
4589772393
Remove more legacy C code 2020-12-15 10:59:15 +01:00
Hannah von Reth
3dcbc9fa66
Tests: Port check_vio_ext to Windows 2020-12-15 10:59:15 +01:00
Hannah von Reth
47dc7e6c49
Remove custome string functions 2020-12-15 10:59:15 +01:00
Hannah von Reth
1a1035d516
Remove unused struct 2020-12-15 10:59:11 +01:00
Hannah von Reth
a1d8010eae
Cleanup moc_csync.cpp include 2020-12-15 10:59:11 +01:00
Hannah von Reth
4d615c31da
Rename csync_instructions_e -> SyncInsturctions 2020-12-15 10:59:10 +01:00
Hannah von Reth
8cbdb4451b
Remove now unneede csync_instruction_str 2020-12-15 10:59:10 +01:00
Hannah von Reth
caa04f6adb
Make bit flags better readable 2020-12-15 10:59:10 +01:00
Hannah von Reth
a9728b527a
Remove unused defines 2020-12-15 10:59:08 +01:00
Hannah von Reth
1dd01477c5
Use Q_ENUM_NS to pretty print csync enums 2020-12-15 10:59:07 +01:00
Christian Kamm
590db28541
Vfs: Clear up relationship between _type and pin state
The pin state is a per-item attribute that has an effect on _type:
AlwaysLocal dehydrated files will be marked for hydration and OnlineOnly
hydrated files will be marked for dehydration.

Where exactly this effect materializes depends on how the pin states are
stored. If they're stored in the db (suffix) the dbEntry._type is
changed during the discovery.

If the pin state is stored in the filesystem, the localEntry._type must
be adjusted by the plugin's stat callback.

This patch makes pin states behave more consistently between plugins.
Previously with suffix-vfs pin states only had an effect on new remote
files. Now the effect of pinning or unpinning files or directories is as
documented and similar to other plugins.
2020-12-15 10:58:46 +01:00
Christian Kamm
575935ded0
Windows: Forbid chars 0-31 in filenames #6987 2020-12-15 10:58:42 +01:00
Christian Kamm
5820ac8b41
Discovery: Files can have dehydrate/download actions
This will be used in conjunction with vfs plugins that detect whether a
file has a pending hydration/dehydration through independent means and
communicate that to the discovery through local file type.
2020-12-15 10:58:38 +01:00
Christian Kamm
1cc41427fc
Build fix for mingw64 7.3 (Qt 5.12.0) 2020-12-15 10:58:37 +01:00
Dominik Schmidt
539cef345e
Switch to standard opt-out BUILD_TESTING instead of opt-in UNIT_TESTING
Compare https://cmake.org/cmake/help/v3.0/module/CTest.html
Craft automatically handles BUILD_TESTING, so we don't need to handle it
in our own blueprint.
2020-12-15 10:58:36 +01:00
Olivier Goffart
62ec4c9330
Discovery: Handle the blacklistFiles from the server capabilities
Issue #434

Ideally one could add the blacklist to the exlucde reggexp, but this
is simpler
2020-12-15 10:58:30 +01:00
Olivier Goffart
6da96cd026
Port the exclude test to the QTest Framework
This is just a port to QtTest, I did not change the layout of the test.
I did search and replace to replace the assert with QCOMPARE/QVERIFY
I still call setup and setup_init like before (only explicitly, now)

Also ported the preformence tests to QBENCHMAK because windows don't have
gettimeofday.

Relates #6358
2020-12-15 10:58:29 +01:00
Christian Kamm
b30f79edf6
vfs: Ensure SyncOptions::_vfs is never null
- Create a VfsOff derived class
- Make it a shared pointer shared with Folder::_vfs
2020-12-15 10:58:26 +01:00
Christian Kamm
5b26b739f0
vfs: Document ignored return value. 2020-12-15 10:58:25 +01:00