From e75d77c27c56a512128f00c381795438cfe61728 Mon Sep 17 00:00:00 2001 From: raldone01 Date: Fri, 28 Jun 2024 18:06:30 +0200 Subject: [PATCH] Fixes cropped thumbnails #6154 Signed-off-by: raldone01 --- src/gui/shellextensionsserver.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/shellextensionsserver.cpp b/src/gui/shellextensionsserver.cpp index 1150a3107b7a..5f5da92fb16d 100644 --- a/src/gui/shellextensionsserver.cpp +++ b/src/gui/shellextensionsserver.cpp @@ -155,7 +155,7 @@ void ShellExtensionsServer::processCustomStateRequest(QLocalSocket *socket, cons } _customStateSocketConnections.remove(socket->socketDescriptor()); } - + const auto folder = FolderMan::instance()->folder(folderAlias); SyncJournalFileRecord record; if (!folder || !folder->journalDb()->getFileRecord(filePathRelative, &record) || !record.isValid()) { @@ -219,7 +219,7 @@ void ShellExtensionsServer::processCustomStateRequest(QLocalSocket *socket, cons _runningLsColJobsForPaths.removeOne(lsColJobPath); emit directoryListingIterationFinished(folderAlias); }); - + _runningLsColJobsForPaths.push_back(lsColJobPath); lsColJob->start(); } @@ -251,6 +251,7 @@ void ShellExtensionsServer::processThumbnailRequest(QLocalSocket *socket, const queryItems.addQueryItem(QStringLiteral("fileId"), record._fileId); queryItems.addQueryItem(QStringLiteral("x"), QString::number(thumbnailRequestInfo.size.width())); queryItems.addQueryItem(QStringLiteral("y"), QString::number(thumbnailRequestInfo.size.height())); + queryItems.addQueryItem(QStringLiteral("a"), QStringLiteral("true")); // Keep aspect ratio const QUrl jobUrl = Utility::concatUrlPath(folder->accountState()->account()->url(), getFetchThumbnailPath(), queryItems); const auto job = new SimpleNetworkJob(folder->accountState()->account()); job->startRequest(QByteArrayLiteral("GET"), jobUrl); @@ -260,7 +261,7 @@ void ShellExtensionsServer::processThumbnailRequest(QLocalSocket *socket, const sendEmptyDataAndCloseSession(socket); return; } - + auto messageReplyWithThumbnail = QVariantMap { {VfsShellExtensions::Protocol::ThumnailProviderDataKey, reply->readAll().toBase64()} }; @@ -319,7 +320,7 @@ void ShellExtensionsServer::parseCustomStateRequest(QLocalSocket *socket, const sendEmptyDataAndCloseSession(socket); return; } - + const auto customStateRequestInfo = CustomStateRequestInfo { itemFilePath, foundFolderAlias