Skip to content

Commit

Permalink
parent path
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjv committed Dec 16, 2024
1 parent 797d416 commit cd44186
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/common/syncjournaldb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,11 +824,11 @@ QVector<QByteArray> SyncJournalDb::tableColumns(const QByteArray &table)

qint64 SyncJournalDb::getPHash(const QByteArray &file)
{
qint64 h;
int len = file.length();

h = c_jhash64((uint8_t *)file.data(), len, 0);
return h;
QByteArray normalizedFile = file;
if (Utility::isMac()) {
normalizedFile = QString::fromUtf8(file).normalized(QString::NormalizationForm_C).toUtf8();
}
return c_jhash64((uint8_t *)normalizedFile.data(), normalizedFile.length(), 0);
}

Result<void, QString> SyncJournalDb::setFileRecord(const SyncJournalFileRecord &_record)
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void ProcessDirectoryJob::process()
_serverNormalQueryEntries.clear();

// fetch all the name from the DB
auto pathU8 = _currentFolder._original.toUtf8();
auto pathU8 = Utility::isMac() ? _currentFolder._original.normalized(QString::NormalizationForm_C).toUtf8() : _currentFolder._original.toUtf8(); // XXX
if (!_discoveryData->_statedb->listFilesInPath(pathU8, [&](const SyncJournalFileRecord &rec) {
auto name = pathU8.isEmpty() ? QString::fromUtf8(rec._path) : QString::fromUtf8(rec._path.constData() + (pathU8.size() + 1));
if (rec.isVirtualFile() && isVfsWithSuffix()) {
Expand Down

0 comments on commit cd44186

Please sign in to comment.