summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-30 02:10:33 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-30 02:10:33 +0100
commit203ddb20de4c1c3c2e17e6d0f5f703381cc51a5d (patch)
tree8d541edc624200e80cca758875913d1ac65bcf16 /src/timeline/InputBar.cpp
parentReduce allocations and time spent creating delegates by half (diff)
downloadnheko-203ddb20de4c1c3c2e17e6d0f5f703381cc51a5d.tar.xz
Fix crash after sending image caused by the recent refactor
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index 767dccc3..02693538 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -712,7 +712,7 @@ InputBar::showPreview(const QMimeData &source, const QString &path, const QStrin QSize dimensions; QString blurhash; - auto mimeClass = mime.splitRef(u'/')[0]; + auto mimeClass = mime.left(mime.indexOf(u'/')); nhlog::ui()->debug("Mime: {}", mime.toStdString()); if (mimeClass == u"image") { QImage img = utils::readImage(data); @@ -760,11 +760,11 @@ InputBar::showPreview(const QMimeData &source, const QString &path, const QStrin if (encryptedFile) encryptedFile->url = res.content_uri; - if (mimeClass == "image") + if (mimeClass == u"image") image(filename, encryptedFile, url, mime, size, dimensions, blurhash); - else if (mimeClass == "audio") + else if (mimeClass == u"audio") audio(filename, encryptedFile, url, mime, size); - else if (mimeClass == "video") + else if (mimeClass == u"video") video(filename, encryptedFile, url, mime, size); else file(filename, encryptedFile, url, mime, size);