Skip to content

Commit

Permalink
Ensure stripping of suffix vfs placeholder file's suffix when issuing…
Browse files Browse the repository at this point in the history
… delete command to server

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and backportbot[bot] committed Jun 28, 2024
1 parent df5b94c commit fa735fd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/libsync/propagateremotedelete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,19 @@ void PropagateRemoteDelete::start()

void PropagateRemoteDelete::createDeleteJob(const QString &filename)
{
qCInfo(lcPropagateRemoteDelete) << "Deleting file, local" << _item->_file << "remote" << filename;
Q_ASSERT(propagator());
auto remoteFilename = filename;
if (_item->_type == ItemType::ItemTypeVirtualFile) {
if (const auto vfs = propagator()->syncOptions()._vfs; vfs->mode() == Vfs::Mode::WithSuffix) {
// These are compile-time constants so no need to recreate each time
static constexpr auto suffixSize = std::string_view(APPLICATION_DOTVIRTUALFILE_SUFFIX).size();
remoteFilename.chop(suffixSize);
}
}

_job = new DeleteJob(propagator()->account(),
propagator()->fullRemotePath(filename),
this);
qCInfo(lcPropagateRemoteDelete) << "Deleting file, local" << _item->_file << "remote" << remoteFilename;

_job = new DeleteJob(propagator()->account(), propagator()->fullRemotePath(remoteFilename), this);
connect(_job.data(), &DeleteJob::finishedSignal, this, &PropagateRemoteDelete::slotDeleteJobFinished);
propagator()->_activeJobList.append(this);
_job->start();
Expand Down

0 comments on commit fa735fd

Please sign in to comment.