mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-22 20:35:48 +03:00
Merge pull request #6855 from raldone01/fix/cropped_thumbnails
Keep aspect ratio for thumbnails
This commit is contained in:
commit
3d9ed8a7bd
1 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue