Only build NavigationPaneHelper on Windows

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2022-12-19 17:05:13 +01:00
parent ab289c8994
commit 487855b7bb
3 changed files with 23 additions and 5 deletions

View File

@ -109,8 +109,6 @@ set(client_SRCS
lockwatcher.cpp
logbrowser.h
logbrowser.cpp
navigationpanehelper.h
navigationpanehelper.cpp
networksettings.h
networksettings.cpp
ocsnavigationappsjob.h
@ -339,13 +337,19 @@ IF( APPLE )
ENDIF()
IF( NOT WIN32 AND NOT APPLE )
set(client_SRCS ${client_SRCS} folderwatcher_linux.cpp)
set(client_SRCS ${client_SRCS} folderwatcher_linux.cpp)
ENDIF()
IF( WIN32 )
set(client_SRCS ${client_SRCS} folderwatcher_win.cpp shellextensionsserver.cpp ${CMAKE_SOURCE_DIR}/src/common/shellextensionutils.cpp)
set(client_SRCS
${client_SRCS}
folderwatcher_win.cpp
navigationpanehelper.h
navigationpanehelper.cpp
shellextensionsserver.cpp
${CMAKE_SOURCE_DIR}/src/common/shellextensionutils.cpp)
ENDIF()
IF( APPLE )
list(APPEND client_SRCS folderwatcher_mac.cpp)
list(APPEND client_SRCS folderwatcher_mac.cpp)
ENDIF()
set(3rdparty_SRC

View File

@ -62,7 +62,9 @@ FolderMan *FolderMan::_instance = nullptr;
FolderMan::FolderMan(QObject *parent)
: QObject(parent)
, _lockWatcher(new LockWatcher)
#ifdef Q_OS_WIN
, _navigationPaneHelper(this)
#endif
{
ASSERT(!_instance);
_instance = this;
@ -1257,7 +1259,9 @@ Folder *FolderMan::addFolder(AccountState *accountState, const FolderDefinition
emit folderListChanged(_folderMap);
}
#ifdef Q_OS_WIN
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
#endif
return folder;
}
@ -1277,10 +1281,12 @@ Folder *FolderMan::addFolderInternal(
auto folder = new Folder(folderDefinition, accountState, std::move(vfs), this);
#ifdef Q_OS_WIN
if (_navigationPaneHelper.showInExplorerNavigationPane() && folderDefinition.navigationPaneClsid.isNull()) {
folder->setNavigationPaneClsid(QUuid::createUuid());
folder->saveToSettings();
}
#endif
qCInfo(lcFolderMan) << "Adding folder to Folder Map " << folder << folder->alias();
_folderMap[folder->alias()] = folder;
@ -1414,7 +1420,9 @@ void FolderMan::removeFolder(Folder *folderToRemove)
delete folderToRemove;
}
#ifdef Q_OS_WIN
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
#endif
emit folderListChanged(_folderMap);
}
@ -1551,7 +1559,9 @@ void FolderMan::slotWipeFolderForAccount(AccountState *accountState)
delete f;
}
#ifdef Q_OS_WIN
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
#endif
}
emit folderListChanged(_folderMap);

View File

@ -23,7 +23,9 @@
#include "folder.h"
#include "folderwatcher.h"
#ifdef Q_OS_WIN
#include "navigationpanehelper.h"
#endif
#include "syncfileitem.h"
class TestFolderMan;
@ -403,7 +405,9 @@ private:
bool _nextSyncShouldStartImmediately = false;
QScopedPointer<SocketApi> _socketApi;
#ifdef Q_OS_WIN
NavigationPaneHelper _navigationPaneHelper;
#endif
QPointer<UpdateE2eeFolderUsersMetadataJob> _removeE2eeShareJob;