Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ set(client_SRCS
lockwatcher.cpp
logbrowser.h
logbrowser.cpp
navigationpanehelper.h
navigationpanehelper.cpp
networksettings.h
networksettings.cpp
ocsnavigationappsjob.h
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,11 @@ void AccountSettings::slotFolderWizardAccepted()
*/
definition.ignoreHiddenFiles = folderMan->ignoreHiddenFiles();

#ifdef Q_OS_WIN
if (folderMan->navigationPaneHelper().showInExplorerNavigationPane()) {
definition.navigationPaneClsid = QUuid::createUuid();
}
#endif

const auto selectiveSyncBlackList = folderWizard->property("selectiveSyncBlackList").toStringList();

Expand Down Expand Up @@ -937,8 +939,10 @@ void AccountSettings::slotEnableVfsCurrentFolder()
return;
}

#ifdef Q_OS_WIN
// we might need to add or remove the panel entry as cfapi brings this feature out of the box
FolderMan::instance()->navigationPaneHelper().scheduleUpdateCloudStorageRegistry();
#endif

// It is unsafe to switch on vfs while a sync is running - wait if necessary.
const auto connection = std::make_shared<QMetaObject::Connection>();
Expand Down Expand Up @@ -1014,8 +1018,10 @@ void AccountSettings::slotDisableVfsCurrentFolder()
return;
}

#ifdef Q_OS_WIN
// we might need to add or remove the panel entry as cfapi brings this feature out of the box
FolderMan::instance()->navigationPaneHelper().scheduleUpdateCloudStorageRegistry();
#endif

// It is unsafe to switch off vfs while a sync is running - wait if necessary.
const auto connection = std::make_shared<QMetaObject::Connection>();
Expand Down
2 changes: 2 additions & 0 deletions src/gui/accountsetupfromcommandlinejob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ void AccountSetupFromCommandLineJob::setupLocalSyncFolder(AccountState *accountS
definition.ignoreHiddenFiles = folderMan->ignoreHiddenFiles();
definition.alias = folderMan->map().size() > 0 ? QString::number(folderMan->map().size()) : QString::number(0);

#ifdef Q_OS_WIN
if (folderMan->navigationPaneHelper().showInExplorerNavigationPane()) {
definition.navigationPaneClsid = QUuid::createUuid();
}
#endif

folderMan->setSyncEnabled(false);

Expand Down
10 changes: 10 additions & 0 deletions src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1257,7 +1259,9 @@ Folder *FolderMan::addFolder(AccountState *accountState, const FolderDefinition
emit folderListChanged(_folderMap);
}

#ifdef Q_OS_WIN
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
#endif
return folder;
}

Expand All @@ -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;
Expand Down Expand Up @@ -1414,7 +1420,9 @@ void FolderMan::removeFolder(Folder *folderToRemove)
delete folderToRemove;
}

#ifdef Q_OS_WIN
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
#endif

emit folderListChanged(_folderMap);
}
Expand Down Expand Up @@ -1551,7 +1559,9 @@ void FolderMan::slotWipeFolderForAccount(AccountState *accountState)
delete f;
}

#ifdef Q_OS_WIN
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
#endif
}

emit folderListChanged(_folderMap);
Expand Down
7 changes: 7 additions & 0 deletions src/gui/folderman.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
#ifndef FOLDERMAN_H
#define FOLDERMAN_H

#include <QByteArray>

Check failure on line 19 in src/gui/folderman.h

View workflow job for this annotation

GitHub Actions / build

src/gui/folderman.h:19:10 [clang-diagnostic-error]

'QByteArray' file not found
#include <QObject>
#include <QQueue>
#include <QList>

#include "folder.h"
#include "folderwatcher.h"
#ifdef Q_OS_WIN
#include "navigationpanehelper.h"
#endif
#include "syncfileitem.h"

class TestFolderMan;
Expand Down Expand Up @@ -149,7 +151,10 @@
static QString unescapeAlias(const QString &);

SocketApi *socketApi();

#ifdef Q_OS_WIN
NavigationPaneHelper &navigationPaneHelper() { return _navigationPaneHelper; }
#endif

/**
* Check if @a path is a valid path for a new folder considering the already sync'ed items.
Expand Down Expand Up @@ -400,7 +405,9 @@
bool _nextSyncShouldStartImmediately = false;

QScopedPointer<SocketApi> _socketApi;
#ifdef Q_OS_WIN
NavigationPaneHelper _navigationPaneHelper;
#endif

QPointer<UpdateE2eeFolderUsersMetadataJob> _removeE2eeShareJob;

Expand Down
3 changes: 3 additions & 0 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,11 @@ void GeneralSettings::slotShowInExplorerNavigationPane(bool checked)
{
ConfigFile cfgFile;
cfgFile.setShowInExplorerNavigationPane(checked);

#ifdef Q_OS_WIN
// Now update the registry with the change.
FolderMan::instance()->navigationPaneHelper().setShowInExplorerNavigationPane(checked);
#endif
}

void GeneralSettings::slotIgnoreFilesEditor()
Expand Down
6 changes: 5 additions & 1 deletion src/gui/owncloudsetupwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* for more details.
*/

#include "accessmanager.h"

Check failure on line 16 in src/gui/owncloudsetupwizard.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/owncloudsetupwizard.cpp:16:10 [clang-diagnostic-error]

'accessmanager.h' file not found
#include "account.h"
#include "accountmanager.h"
#include "clientproxy.h"
Expand Down Expand Up @@ -722,8 +722,12 @@
folderDefinition.virtualFilesMode = bestAvailableVfsMode();
}
#endif
if (folderMan->navigationPaneHelper().showInExplorerNavigationPane())

#ifdef Q_OS_WIN
if (folderMan->navigationPaneHelper().showInExplorerNavigationPane()) {
folderDefinition.navigationPaneClsid = QUuid::createUuid();
}
#endif

auto f = folderMan->addFolder(account, folderDefinition);
if (f) {
Expand Down
Loading