Skip to content

Commit

Permalink
fix part of the review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mgallien committed Jun 22, 2021
1 parent 1fc9daa commit 33f0d8d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 56 deletions.
17 changes: 0 additions & 17 deletions src/libsync/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,6 @@ set(libsync_SRCS
creds/keychainchunk.cpp
)

if (WIN32)
#set(libsync_SRCS ${libsync_SRCS}
#vfs/cfapi/cfapiwrapper.cpp
#vfs/cfapi/hydrationjob.cpp
#vfs/cfapi/vfs_cfapi.cpp
#)
add_definitions(-D_WIN32_WINNT=_WIN32_WINNT_WIN10)
list(APPEND OS_SPECIFIC_LINK_LIBRARIES cldapi)
elseif(LINUX) # elseif(LINUX OR APPLE)
#set(libsync_SRCS ${libsync_SRCS} vfs/xattr/vfs_xattr.cpp)
#if (APPLE)
#set(libsync_SRCS ${libsync_SRCS} vfs/xattr/xattrwrapper_mac.cpp)
#else()
#set(libsync_SRCS ${libsync_SRCS} vfs/xattr/xattrwrapper_linux.cpp)
#endif()
endif()

if(TOKEN_AUTH_ONLY)
set (libsync_SRCS ${libsync_SRCS} creds/tokencredentials.cpp)
else()
Expand Down
63 changes: 32 additions & 31 deletions src/libsync/vfs/cfapi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
if (WIN32)
add_library("${synclib_NAME}_vfs_cfapi" SHARED
cfapiwrapper.cpp
hydrationjob.cpp
vfs_cfapi.cpp
)
add_definitions(-D_WIN32_WINNT=_WIN32_WINNT_WIN10)

target_link_libraries("${synclib_NAME}_vfs_cfapi"
"${synclib_NAME}"
cldapi
)
add_library("${synclib_NAME}_vfs_cfapi" SHARED
cfapiwrapper.cpp
hydrationjob.cpp
vfs_cfapi.cpp
)

set_target_properties("${synclib_NAME}_vfs_cfapi" PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
PREFIX ""
AUTOMOC TRUE
)
target_link_libraries("${synclib_NAME}_vfs_cfapi"
"${synclib_NAME}"
cldapi
)

if(APPLE)
# for being loadable when client run from build dir
set(vfs_buildoutputdir "${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns/")
set_target_properties("${synclib_NAME}_vfs_cfapi"
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${vfs_buildoutputdir}
RUNTIME_OUTPUT_DIRECTORY ${vfs_buildoutputdir}
set_target_properties("${synclib_NAME}_vfs_cfapi" PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
PREFIX ""
AUTOMOC TRUE
)
# For being lodable when client run from install dir (after make macdeployqt)
set(vfs_installdir "${LIB_INSTALL_DIR}/../PlugIns")
else()
set(vfs_installdir "${PLUGINDIR}")
endif()

INSTALL(TARGETS "${synclib_NAME}_vfs_cfapi"
LIBRARY DESTINATION "${vfs_installdir}"
RUNTIME DESTINATION "${vfs_installdir}"
)
if(APPLE)
# for being loadable when client run from build dir
set(vfs_buildoutputdir "${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns/")
set_target_properties("${synclib_NAME}_vfs_cfapi"
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${vfs_buildoutputdir}
RUNTIME_OUTPUT_DIRECTORY ${vfs_buildoutputdir}
)
# For being lodable when client run from install dir (after make macdeployqt)
set(vfs_installdir "${LIB_INSTALL_DIR}/../PlugIns")
else()
set(vfs_installdir "${PLUGINDIR}")
endif()

INSTALL(TARGETS "${synclib_NAME}_vfs_cfapi"
LIBRARY DESTINATION "${vfs_installdir}"
RUNTIME DESTINATION "${vfs_installdir}"
)
endif()
14 changes: 7 additions & 7 deletions src/libsync/vfs/cfapi/cfapiwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class VfsCfApi;
namespace CfApiWrapper
{

class ConnectionKey
class OWNCLOUDSYNC_EXPORT ConnectionKey
{
public:
ConnectionKey();
Expand All @@ -38,7 +38,7 @@ class ConnectionKey
std::unique_ptr<void, void(*)(void *)> _data;
};

class FileHandle
class OWNCLOUDSYNC_EXPORT FileHandle
{
public:
using Deleter = void (*)(void *);
Expand All @@ -53,7 +53,7 @@ class FileHandle
std::unique_ptr<void, void(*)(void *)> _data;
};

class PlaceHolderInfo
class OWNCLOUDSYNC_EXPORT PlaceHolderInfo
{
public:
using Deleter = void (*)(CF_PLACEHOLDER_BASIC_INFO *);
Expand All @@ -71,11 +71,11 @@ class PlaceHolderInfo
std::unique_ptr<CF_PLACEHOLDER_BASIC_INFO, Deleter> _data;
};

Result<void, QString> registerSyncRoot(const QString &path, const QString &providerName, const QString &providerVersion, const QString &folderAlias, const QString &displayName, const QString &accountDisplayName);
Result<void, QString> unregisterSyncRoot(const QString &path, const QString &providerName, const QString &accountDisplayName);
OWNCLOUDSYNC_EXPORT Result<void, QString> registerSyncRoot(const QString &path, const QString &providerName, const QString &providerVersion, const QString &folderAlias, const QString &displayName, const QString &accountDisplayName);
OWNCLOUDSYNC_EXPORT Result<void, QString> unregisterSyncRoot(const QString &path, const QString &providerName, const QString &accountDisplayName);

Result<ConnectionKey, QString> connectSyncRoot(const QString &path, VfsCfApi *context);
Result<void, QString> disconnectSyncRoot(ConnectionKey &&key);
OWNCLOUDSYNC_EXPORT Result<ConnectionKey, QString> connectSyncRoot(const QString &path, VfsCfApi *context);
OWNCLOUDSYNC_EXPORT Result<void, QString> disconnectSyncRoot(ConnectionKey &&key);

bool isSparseFile(const QString &path);

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (WIN32)
nextcloud_add_test(LongWinPath)
nextcloud_add_test(SyncCfApi)
elseif(LINUX) # elseif(LINUX OR APPLE)
#nextcloud_add_test(SyncXAttr)
nextcloud_add_test(SyncXAttr)
endif()

nextcloud_add_benchmark(LargeSync)
Expand Down

0 comments on commit 33f0d8d

Please sign in to comment.