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
2 changes: 1 addition & 1 deletion src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ void AccountSettings::slotEnableVfsCurrentFolder()
folder->setRootPinState(PinState::Unspecified);
for (const auto &entry : oldBlacklist) {
folder->journalDb()->schedulePathForRemoteDiscovery(entry);
if (!folder->vfs().setPinState(entry, PinState::OnlineOnly)) {
if (FileSystem::fileExists(entry) && !folder->vfs().setPinState(entry, PinState::OnlineOnly)) {
qCWarning(lcAccountSettings) << "Could not set pin state of" << entry << "to online only";
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "common/syncjournaldb.h"

Check failure on line 7 in src/gui/folder.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/folder.cpp:7:10 [clang-diagnostic-error]

'common/syncjournaldb.h' file not found
#include "config.h"

#include "account.h"
Expand Down Expand Up @@ -598,7 +598,7 @@
return _journal.wipeErrorBlacklist();
}

void Folder::slotWatchedPathChanged(const QStringView &path, const ChangeReason reason)

Check warning on line 601 in src/gui/folder.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/folder.cpp:601:14 [readability-function-cognitive-complexity]

function 'slotWatchedPathChanged' has cognitive complexity of 45 (threshold 25)
{
if (!path.startsWith(this->path())) {
qCDebug(lcFolder) << "Changed path is not contained in folder, ignoring:" << path;
Expand All @@ -610,7 +610,7 @@
if (_vfs) {
if (pathIsIgnored(path.toString())) {
const auto pinState = _vfs->pinState(relativePath.toString());
if (!pinState || *pinState != PinState::Excluded) {
if ((!pinState || *pinState != PinState::Excluded) && FileSystem::fileExists(relativePath.toString())) {
if (!_vfs->setPinState(relativePath.toString(), PinState::Excluded)) {
qCWarning(lcFolder) << "Could not set pin state of" << relativePath << "to excluded";
}
Expand Down Expand Up @@ -646,6 +646,7 @@
qCDebug(lcFolder) << "Changed path was touched by SyncEngine, ignoring:" << path;
return;
}
qCDebug(lcFolder) << "Detected changes in paths:" << path;
#endif

SyncJournalFileRecord record;
Expand Down
1 change: 0 additions & 1 deletion src/gui/folderwatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ void FolderWatcher::changeDetected(const QStringList &paths)
return;
}

qCInfo(lcFolderWatcher) << "Detected changes in paths:" << changedPaths;
for (const auto &path : changedPaths) {
emit pathChanged(path);
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/folderwatcher_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include <QThread>

Check failure on line 7 in src/gui/folderwatcher_win.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/folderwatcher_win.cpp:7:10 [clang-diagnostic-error]

'QThread' file not found
#include <QDir>

#include "common/asserts.h"
Expand Down Expand Up @@ -125,7 +125,7 @@
const auto error = GetLastError();
if (longNameSize > 0) {
longfile = QString::fromWCharArray(fileNameBuffer, longNameSize);
} else {
} else if (error != ERROR_FILE_NOT_FOUND) {
qCWarning(lcFolderWatcher) << "Error converting file name" << longfile << "to full length, keeping original name." << Utility::formatWinError(error);
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/libsync/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ bool FileSystem::removeRecursively(const QString &path,
} else {
removeOk = FileSystem::remove(di.filePath(), &removeError);
}
qCInfo(lcFileSystem()) << "delete" << di.filePath();
if (removeOk) {
if (onDeleted)
onDeleted(di.filePath(), false);
Expand Down Expand Up @@ -330,7 +329,6 @@ bool FileSystem::removeRecursively(const QString &path,
allRemoved = false;
}

qCInfo(lcFileSystem()) << "delete" << path;
if (allRemoved) {
if (onDeleted)
onDeleted(path, true);
Expand Down
6 changes: 5 additions & 1 deletion src/libsync/propagatorjobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ bool PropagateLocalRemove::removeRecursively(const QString &path)
const auto fileInfo = QFileInfo{absolute};
const auto parentFolderPath = fileInfo.dir().absolutePath();
const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite};

qCInfo(lcPropagateLocalRemove()) << "delete" << absolute;

Q_EMIT propagator()->touchedFile(absolute);

const auto success = FileSystem::removeRecursively(absolute,
[&deleted](const QString &path, bool isDir) {
// by prepending, a folder deletion may be followed by content deletions
Expand All @@ -63,7 +68,6 @@ bool PropagateLocalRemove::removeRecursively(const QString &path)
[this] (const QString &itemPath, QString *removeError) -> bool {
auto result = false;

qCInfo(lcPropagateLocalRemove()) << itemPath << _deleteToClientTrashBin;
if (_deleteToClientTrashBin.contains(itemPath)) {
result = FileSystem::moveToTrash(itemPath, removeError);
if (!result) {
Expand Down
2 changes: 2 additions & 0 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,8 @@ void SyncEngine::handleRemnantReadOnlyFolders()
const auto deletionCallback = [this] (const QString &deleteItem, bool) {
slotAddTouchedFile(deleteItem);
};

qCInfo(lcEngine()) << "delete" << _localPath + oneFolder->_file;
FileSystem::removeRecursively(_localPath + oneFolder->_file, deletionCallback, nullptr, deletionCallback);
} else {
FileSystem::remove(_localPath + oneFolder->_file);
Expand Down
4 changes: 4 additions & 0 deletions src/libsync/vfs/cfapi/cfapiwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,10 @@ OCC::CfApiWrapper::FileHandle OCC::CfApiWrapper::handleForPath(const QString &pa

OCC::CfApiWrapper::PlaceHolderInfo OCC::CfApiWrapper::findPlaceholderInfo(const QString &path)
{
if (!FileSystem::fileExists(path)) {
return {};
}

if (auto handle = handleForPath(path)) {
std::vector<char> buffer(512);
DWORD actualSize = {};
Expand Down
Loading