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
16 changes: 0 additions & 16 deletions src/common/utility_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@
#include "utility_win.h"
#include "utility.h"

#include "asserts.h"
#include "filesystembase.h"

#include <comdef.h>
#include <qt_windows.h>
#include <shlguid.h>
#include <shlobj.h>
#include <string>

#include <QCoreApplication>
#include <QDir>
Expand Down Expand Up @@ -111,18 +107,6 @@ QString Utility::formatWinError(long errorCode)
return QStringLiteral("WindowsError: %1: %2").arg(QString::number(errorCode, 16), QString::fromWCharArray(_com_error(errorCode).ErrorMessage()));
}


Utility::NtfsPermissionLookupRAII::NtfsPermissionLookupRAII()
{
qt_ntfs_permission_lookup++;
}

Utility::NtfsPermissionLookupRAII::~NtfsPermissionLookupRAII()
{
qt_ntfs_permission_lookup--;
}


Utility::Handle::Handle(HANDLE h, std::function<void(HANDLE)> &&close)
: _handle(h)
, _close(std::move(close))
Expand Down
15 changes: 0 additions & 15 deletions src/common/utility_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,5 @@ namespace Utility {
OCSYNC_EXPORT void UnixTimeToLargeIntegerFiletime(time_t t, LARGE_INTEGER *hundredNSecs);

OCSYNC_EXPORT QString formatWinError(long error);

class OCSYNC_EXPORT NtfsPermissionLookupRAII
{
public:
/**
* NTFS permissions lookup is disabled by default for performance reasons
* Enable it and disable it again once we leave the scope
* https://doc.qt.io/Qt-5/qfileinfo.html#ntfs-permissions
*/
NtfsPermissionLookupRAII();
~NtfsPermissionLookupRAII();

private:
Q_DISABLE_COPY(NtfsPermissionLookupRAII);
};
}
}
2 changes: 1 addition & 1 deletion src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ GraphApi::Space *Folder::space() const
bool Folder::checkLocalPath()
{
#ifdef Q_OS_WIN
Utility::NtfsPermissionLookupRAII ntfs_perm;
QNtfsPermissionCheckGuard ntfs_perm;
#endif
const QFileInfo fi(_definition.localPath());
_canonicalLocalPath = fi.canonicalFilePath();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ QString FolderMan::checkPathValidityRecursive(const QString &path, FolderMan::Ne
}

#ifdef Q_OS_WIN
Utility::NtfsPermissionLookupRAII ntfs_perm;
QNtfsPermissionCheckGuard ntfs_perm;
#endif

auto pathLengthCheck = Folder::checkPathLength(path);
Expand Down
2 changes: 0 additions & 2 deletions src/gui/socketapi/socketapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,5 +1009,3 @@ void SocketApiJobV2::setWarning(const QString &warning)
}

} // namespace OCC

#include "socketapi.moc"
2 changes: 1 addition & 1 deletion src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ QString ConfigFile::configPath()
QString ConfigFile::excludeFile(Scope scope) const
{
#ifdef Q_OS_WIN
Utility::NtfsPermissionLookupRAII ntfs_perm;
QNtfsPermissionCheckGuard ntfs_perm;
#endif
// prefer sync-exclude.lst, but if it does not exist, check for
// exclude.lst for compatibility reasons in the user writeable
Expand Down
2 changes: 1 addition & 1 deletion test/testfolderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private Q_SLOTS:
void testCheckPathValidityForNewFolder()
{
#ifdef Q_OS_WIN
Utility::NtfsPermissionLookupRAII ntfs_perm;
QNtfsPermissionCheckGuard ntfs_perm;
#endif
auto dir = TestUtils::createTempDir();
QVERIFY(dir.isValid());
Expand Down