Skip to content

Commit

Permalink
Ignore macOS ._ metadata files
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelchips authored and jdpurcell committed Dec 28, 2023
1 parent 2766a1e commit c866b34
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/qvimagecore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void QVImageCore::loadPixmap(const ReadData &readData)
if (!currentFileDetails.isMovieLoaded)
if (auto device = loadedMovie.device())
device->close();

currentFileDetails.timeSinceLoaded.start();

emit fileChanged();
Expand Down Expand Up @@ -290,11 +290,19 @@ QList<QVImageCore::CompatibleFile> QVImageCore::getCompatibleFiles(const QString
const QString suffix = fileInfo.suffix().toLower();
bool matched = !suffix.isEmpty() && extensions.contains("." + suffix);
QString mimeType;

if (!matched || sortMode == Qv::SortMode::Type)
{
mimeType = mimeDb.mimeTypeForFile(absoluteFilePath, mimeMatchMode).name();
matched |= mimeTypes.contains(mimeType) && (suffix.isEmpty() || !disabledExtensions.contains("." + suffix));
}

// ignore macOS ._ metadata files
if (fileName.startsWith("._"))
{
matched = false;
}

if (matched)
{
fileList.append({
Expand Down

0 comments on commit c866b34

Please sign in to comment.