jurplel / qView

Practical and minimal image viewer

Home Page:https://interversehq.com/qview/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dot-underscore file on macOS are in playback

yo1995 opened this issue · comments

commented

image

Environment:

  • OS: macOS 14.3
  • qView version: 6.1

Information:

When files are copied over and opened on a flash drive, the "dot-underscore files" are created by macOS. They can be cleaned easily such as dot_clean, but it is kind of annoying to do that each time.

I dig into the code a bit and find the logic around this place it a bit incorrect.

qView/src/qvimagecore.cpp

Lines 273 to 290 in 6c7a99d

if (fileName.endsWith(extension, Qt::CaseInsensitive))
{
matched = true;
break;
}
}
QString mimeType;
if (!matched || sortMode == 4)
{
mimeType = mimeDb.mimeTypeForFile(absoluteFilePath, mimeMatchMode).name();
matched |= mimeTypes.contains(mimeType);
}
// ignore macOS ._ metadata files
if (fileName.startsWith("._"))
{
matched = false;
}

Ideally when the dot file are read, they should not be matched; however because the dot files also have JPG extension, the loop breaks early.

Maybe adjust the order of these conditions, or rewrite the logic a bit?

@yo1995 The logic to ignore dot-underscore files was added after the qView 6.1 release, so it's only present in the nightly builds currently. You can try out the build here which should work; it does for me at least.

Yes looks to me like the feature is already implemented. Nice catch.