InputBar: use X.empty() instead of !X.size()

Suggested-by:

Clang-Tidy: The 'empty' method should be used to check for emptiness instead of 'size'
This commit is contained in:
Marcus Hoffmann 2021-12-03 01:28:01 +01:00
parent abcbcecac1
commit 8aa4a60d12

View file

@ -657,8 +657,8 @@ InputBar::showPreview(const QMimeData &source, const QString& path, const QStrin
previewDialog_->setAttribute(Qt::WA_DeleteOnClose);
// Force SVG to _not_ be handled as an image, but as raw data
if (source.hasImage() && (!formats.size() || formats.front() != "image/svg+xml")) {
if (formats.size() && formats.front().startsWith("image/")) {
if (source.hasImage() && (formats.empty() || formats.front() != "image/svg+xml")) {
if (!formats.empty() && formats.front().startsWith("image/")) {
// known format, keep as-is
previewDialog_->setPreview(qvariant_cast<QImage>(source.imageData()), formats.front());
} else {