diff options
author | saturneric <[email protected]> | 2024-01-08 07:39:58 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-08 07:39:58 +0000 |
commit | d4eb21eae9b26ceb5d915b53650964d6e129e8cf (patch) | |
tree | e7cc3ee1ec9289c669d9523389a45af3da5a3424 /src/ui/widgets/TextEdit.cpp | |
parent | feat: select a directory before entering into the File Browser (diff) | |
download | GpgFrontend-d4eb21eae9b26ceb5d915b53650964d6e129e8cf.tar.gz GpgFrontend-d4eb21eae9b26ceb5d915b53650964d6e129e8cf.zip |
fix: slove issue #123 "Append fingerprint to editor" crashes if there is no editor open
Diffstat (limited to 'src/ui/widgets/TextEdit.cpp')
-rw-r--r-- | src/ui/widgets/TextEdit.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp index 2bc25376..76bede8c 100644 --- a/src/ui/widgets/TextEdit.cpp +++ b/src/ui/widgets/TextEdit.cpp @@ -396,6 +396,11 @@ PlainTextEditorPage* TextEdit::CurTextPage() const { return qobject_cast<PlainTextEditorPage*>(tab_widget_->currentWidget()); } +void TextEdit::SlotAppendText2CurTextPage(const QString& text) { + if (CurTextPage() == nullptr) SlotNewTab(); + CurTextPage()->GetTextPage()->appendPlainText(text); +} + FilePage* TextEdit::CurFilePage() const { auto* curFilePage = qobject_cast<FilePage*>(tab_widget_->currentWidget()); if (curFilePage != nullptr) { |