Skip to content
Snippets Groups Projects
Commit 8aa4a60d authored by Marcus Hoffmann's avatar Marcus Hoffmann
Browse files

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'
parent abcbceca
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment