Skip to content

Commit 20361f0

Browse files
authored
Merge pull request #5288 from nextcloud/bugfix/navigationpanehelper-nonwindows
Exclude NavigationPaneHelper from non-Windows compile
2 parents 5e2fa24 + 487855b commit 20361f0

File tree

7 files changed

+42
-6
lines changed

7 files changed

+42
-6
lines changed

src/gui/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ set(client_SRCS
109109
lockwatcher.cpp
110110
logbrowser.h
111111
logbrowser.cpp
112-
navigationpanehelper.h
113-
navigationpanehelper.cpp
114112
networksettings.h
115113
networksettings.cpp
116114
ocsnavigationappsjob.h
@@ -339,13 +337,19 @@ IF( APPLE )
339337
ENDIF()
340338

341339
IF( NOT WIN32 AND NOT APPLE )
342-
set(client_SRCS ${client_SRCS} folderwatcher_linux.cpp)
340+
set(client_SRCS ${client_SRCS} folderwatcher_linux.cpp)
343341
ENDIF()
344342
IF( WIN32 )
345-
set(client_SRCS ${client_SRCS} folderwatcher_win.cpp shellextensionsserver.cpp ${CMAKE_SOURCE_DIR}/src/common/shellextensionutils.cpp)
343+
set(client_SRCS
344+
${client_SRCS}
345+
folderwatcher_win.cpp
346+
navigationpanehelper.h
347+
navigationpanehelper.cpp
348+
shellextensionsserver.cpp
349+
${CMAKE_SOURCE_DIR}/src/common/shellextensionutils.cpp)
346350
ENDIF()
347351
IF( APPLE )
348-
list(APPEND client_SRCS folderwatcher_mac.cpp)
352+
list(APPEND client_SRCS folderwatcher_mac.cpp)
349353
ENDIF()
350354

351355
set(3rdparty_SRC

src/gui/accountsettings.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,11 @@ void AccountSettings::slotFolderWizardAccepted()
839839
*/
840840
definition.ignoreHiddenFiles = folderMan->ignoreHiddenFiles();
841841

842+
#ifdef Q_OS_WIN
842843
if (folderMan->navigationPaneHelper().showInExplorerNavigationPane()) {
843844
definition.navigationPaneClsid = QUuid::createUuid();
844845
}
846+
#endif
845847

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

@@ -937,8 +939,10 @@ void AccountSettings::slotEnableVfsCurrentFolder()
937939
return;
938940
}
939941

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

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

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

10201026
// It is unsafe to switch off vfs while a sync is running - wait if necessary.
10211027
const auto connection = std::make_shared<QMetaObject::Connection>();

src/gui/accountsetupfromcommandlinejob.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,11 @@ void AccountSetupFromCommandLineJob::setupLocalSyncFolder(AccountState *accountS
176176
definition.ignoreHiddenFiles = folderMan->ignoreHiddenFiles();
177177
definition.alias = folderMan->map().size() > 0 ? QString::number(folderMan->map().size()) : QString::number(0);
178178

179+
#ifdef Q_OS_WIN
179180
if (folderMan->navigationPaneHelper().showInExplorerNavigationPane()) {
180181
definition.navigationPaneClsid = QUuid::createUuid();
181182
}
183+
#endif
182184

183185
folderMan->setSyncEnabled(false);
184186

src/gui/folderman.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ FolderMan *FolderMan::_instance = nullptr;
6262
FolderMan::FolderMan(QObject *parent)
6363
: QObject(parent)
6464
, _lockWatcher(new LockWatcher)
65+
#ifdef Q_OS_WIN
6566
, _navigationPaneHelper(this)
67+
#endif
6668
{
6769
ASSERT(!_instance);
6870
_instance = this;
@@ -1257,7 +1259,9 @@ Folder *FolderMan::addFolder(AccountState *accountState, const FolderDefinition
12571259
emit folderListChanged(_folderMap);
12581260
}
12591261

1262+
#ifdef Q_OS_WIN
12601263
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
1264+
#endif
12611265
return folder;
12621266
}
12631267

@@ -1277,10 +1281,12 @@ Folder *FolderMan::addFolderInternal(
12771281

12781282
auto folder = new Folder(folderDefinition, accountState, std::move(vfs), this);
12791283

1284+
#ifdef Q_OS_WIN
12801285
if (_navigationPaneHelper.showInExplorerNavigationPane() && folderDefinition.navigationPaneClsid.isNull()) {
12811286
folder->setNavigationPaneClsid(QUuid::createUuid());
12821287
folder->saveToSettings();
12831288
}
1289+
#endif
12841290

12851291
qCInfo(lcFolderMan) << "Adding folder to Folder Map " << folder << folder->alias();
12861292
_folderMap[folder->alias()] = folder;
@@ -1414,7 +1420,9 @@ void FolderMan::removeFolder(Folder *folderToRemove)
14141420
delete folderToRemove;
14151421
}
14161422

1423+
#ifdef Q_OS_WIN
14171424
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
1425+
#endif
14181426

14191427
emit folderListChanged(_folderMap);
14201428
}
@@ -1551,7 +1559,9 @@ void FolderMan::slotWipeFolderForAccount(AccountState *accountState)
15511559
delete f;
15521560
}
15531561

1562+
#ifdef Q_OS_WIN
15541563
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
1564+
#endif
15551565
}
15561566

15571567
emit folderListChanged(_folderMap);

src/gui/folderman.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323

2424
#include "folder.h"
2525
#include "folderwatcher.h"
26+
#ifdef Q_OS_WIN
2627
#include "navigationpanehelper.h"
28+
#endif
2729
#include "syncfileitem.h"
2830

2931
class TestFolderMan;
@@ -149,7 +151,10 @@ class FolderMan : public QObject
149151
static QString unescapeAlias(const QString &);
150152

151153
SocketApi *socketApi();
154+
155+
#ifdef Q_OS_WIN
152156
NavigationPaneHelper &navigationPaneHelper() { return _navigationPaneHelper; }
157+
#endif
153158

154159
/**
155160
* Check if @a path is a valid path for a new folder considering the already sync'ed items.
@@ -400,7 +405,9 @@ private slots:
400405
bool _nextSyncShouldStartImmediately = false;
401406

402407
QScopedPointer<SocketApi> _socketApi;
408+
#ifdef Q_OS_WIN
403409
NavigationPaneHelper _navigationPaneHelper;
410+
#endif
404411

405412
QPointer<UpdateE2eeFolderUsersMetadataJob> _removeE2eeShareJob;
406413

src/gui/generalsettings.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,11 @@ void GeneralSettings::slotShowInExplorerNavigationPane(bool checked)
580580
{
581581
ConfigFile cfgFile;
582582
cfgFile.setShowInExplorerNavigationPane(checked);
583+
584+
#ifdef Q_OS_WIN
583585
// Now update the registry with the change.
584586
FolderMan::instance()->navigationPaneHelper().setShowInExplorerNavigationPane(checked);
587+
#endif
585588
}
586589

587590
void GeneralSettings::slotIgnoreFilesEditor()

src/gui/owncloudsetupwizard.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,12 @@ void OwncloudSetupWizard::slotAssistantFinished(int result)
722722
folderDefinition.virtualFilesMode = bestAvailableVfsMode();
723723
}
724724
#endif
725-
if (folderMan->navigationPaneHelper().showInExplorerNavigationPane())
725+
726+
#ifdef Q_OS_WIN
727+
if (folderMan->navigationPaneHelper().showInExplorerNavigationPane()) {
726728
folderDefinition.navigationPaneClsid = QUuid::createUuid();
729+
}
730+
#endif
727731

728732
auto f = folderMan->addFolder(account, folderDefinition);
729733
if (f) {

0 commit comments

Comments
 (0)