summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2022-06-15 14:31:46 +0000
committerGitHub <noreply@github.com>2022-06-15 14:31:46 +0000
commit835fcf632515cd821d2fe3d38170b6863a474c04 (patch)
treeaf52fd85eb68c3080dc62cb436785991b47956c6 /src/timeline/InputBar.cpp
parentFix failed uploads not removing uploads (diff)
parentSubtle corrections to paste behaviors (diff)
downloadnheko-835fcf632515cd821d2fe3d38170b6863a474c04.tar.xz
Merge pull request #1095 from syldrathecat/subtle-paste-fixes
Subtle corrections to paste behaviors
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index 97fe5cf4..32b523db 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -101,8 +101,8 @@ InputVideoSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType type) } } -void -InputBar::paste(bool fromMouse) +bool +InputBar::tryPasteAttachment(bool fromMouse) { const QMimeData *md = nullptr; @@ -113,14 +113,16 @@ InputBar::paste(bool fromMouse) } if (md) - insertMimeData(md); + return insertMimeData(md); + + return false; } -void +bool InputBar::insertMimeData(const QMimeData *md) { if (!md) - return; + return false; nhlog::ui()->debug("Got mime formats: {}", md->formats().join(QStringLiteral(", ")).toStdString()); @@ -171,7 +173,7 @@ InputBar::insertMimeData(const QMimeData *md) auto data = md->data(QStringLiteral("x-special/gnome-copied-files")).split('\n'); if (data.size() < 2) { nhlog::ui()->warn("MIME format is malformed, cannot perform paste."); - return; + return false; } for (int i = 1; i < data.size(); ++i) { @@ -181,10 +183,13 @@ InputBar::insertMimeData(const QMimeData *md) } } } else if (md->hasText()) { - emit insertText(md->text()); + return false; } else { nhlog::ui()->debug("formats: {}", md->formats().join(QStringLiteral(", ")).toStdString()); + return false; } + + return true; } void