"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/libsync/vfs/suffix/vfs_suffix.cpp" between
ownCloud-2.9.0.5150.tar.xz and ownCloud-2.9.1.5500.tar.xz

About: ownCloud Client (formerly "mirall") is a tool to synchronize files from ownCloud Server with your desktop client. It uses OCSync as its syncing backend.

vfs_suffix.cpp  (ownCloud-2.9.0.5150.tar.xz):vfs_suffix.cpp  (ownCloud-2.9.1.5500.tar.xz)
skipping to change at line 54 skipping to change at line 54
void VfsSuffix::startImpl(const VfsSetupParams &params) void VfsSuffix::startImpl(const VfsSetupParams &params)
{ {
// It is unsafe for the database to contain any ".owncloud" file entries // It is unsafe for the database to contain any ".owncloud" file entries
// that are not marked as a virtual file. These could be real .owncloud // that are not marked as a virtual file. These could be real .owncloud
// files that were synced before vfs was enabled. // files that were synced before vfs was enabled.
QByteArrayList toWipe; QByteArrayList toWipe;
params.journal->getFilesBelowPath("", [&toWipe](const SyncJournalFileRecord &rec) { params.journal->getFilesBelowPath("", [&toWipe](const SyncJournalFileRecord &rec) {
if (!rec.isVirtualFile() && rec._path.endsWith(APPLICATION_DOTVIRTUALFIL E_SUFFIX)) if (!rec.isVirtualFile() && rec._path.endsWith(APPLICATION_DOTVIRTUALFIL E_SUFFIX))
toWipe.append(rec._path); toWipe.append(rec._path);
}); });
for (const auto &path : toWipe) for (const auto &path : toWipe) {
params.journal->deleteFileRecord(QString::fromUtf8(path)); params.journal->deleteFileRecord(QString::fromUtf8(path));
}
Q_EMIT started();
} }
void VfsSuffix::stop() void VfsSuffix::stop()
{ {
} }
void VfsSuffix::unregisterFolder() void VfsSuffix::unregisterFolder()
{ {
} }
skipping to change at line 80 skipping to change at line 82
Result<Vfs::ConvertToPlaceholderResult, QString> VfsSuffix::updateMetadata(const SyncFileItem &item, const QString &filePath, const QString &) Result<Vfs::ConvertToPlaceholderResult, QString> VfsSuffix::updateMetadata(const SyncFileItem &item, const QString &filePath, const QString &)
{ {
FileSystem::setModTime(filePath, item._modtime); FileSystem::setModTime(filePath, item._modtime);
return Vfs::ConvertToPlaceholderResult::Ok; return Vfs::ConvertToPlaceholderResult::Ok;
} }
Result<void, QString> VfsSuffix::createPlaceholder(const SyncFileItem &item) Result<void, QString> VfsSuffix::createPlaceholder(const SyncFileItem &item)
{ {
// The concrete shape of the placeholder is also used in isDehydratedPlaceho lder() below // The concrete shape of the placeholder is also used in isDehydratedPlaceho lder() below
QString fn = _setupParams.filesystemPath + item._file; const QString fn = _setupParams.filesystemPath + item._file;
if (!fn.endsWith(fileSuffix())) { Q_ASSERT(fn.endsWith(fileSuffix()));
OC_ASSERT_X(false, "vfs file isn't ending with suffix");
return QStringLiteral("vfs file isn't ending with suffix");
}
QFile file(fn); QFile file(fn);
if (file.exists() && file.size() > 1 if (file.exists() && file.size() > 1
&& !FileSystem::verifyFileUnchanged(fn, item._size, item._modtime)) { && !FileSystem::verifyFileUnchanged(fn, item._size, item._modtime)) {
return QStringLiteral("Cannot create a placeholder because a file with t he placeholder name already exist"); return QStringLiteral("Cannot create a placeholder because a file with t he placeholder name already exist");
} }
if (!file.open(QFile::ReadWrite | QFile::Truncate)) if (!file.open(QFile::ReadWrite | QFile::Truncate))
return file.errorString(); return file.errorString();
skipping to change at line 149 skipping to change at line 148
return true; return true;
} }
return false; return false;
} }
Vfs::AvailabilityResult VfsSuffix::availability(const QString &folderPath) Vfs::AvailabilityResult VfsSuffix::availability(const QString &folderPath)
{ {
return availabilityInDb(folderPath); return availabilityInDb(folderPath);
} }
QString VfsSuffix::underlyingFileName(const QString &fileName) const
{
{
if (fileName.endsWith(fileSuffix())) {
return fileName.chopped(fileSuffix().size());
}
return fileName;
}
}
} // namespace OCC } // namespace OCC
 End of changes. 4 change blocks. 
6 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)