Skip to content

Commit

Permalink
Fix read-only preview
Browse files Browse the repository at this point in the history
Refactor EntryAttachmentsWidget and PreviewEntryAttachmentsDialog to remove unnecessary parent references

Fixes #11506
  • Loading branch information
w15dev committed Jan 9, 2025
1 parent e00aec9 commit 1c1483a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/entry/EntryAttachmentsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void EntryAttachmentsWidget::newAttachments()
return;
}

NewEntryAttachmentsDialog newEntryDialog{m_entryAttachments, this};
NewEntryAttachmentsDialog newEntryDialog{m_entryAttachments};
if (newEntryDialog.exec() == QDialog::Accepted) {
emit widgetUpdated();
}
Expand All @@ -191,7 +191,7 @@ void EntryAttachmentsWidget::previewAttachments()
return;
}

PreviewEntryAttachmentsDialog previewDialog{m_entryAttachments, this};
PreviewEntryAttachmentsDialog previewDialog{m_entryAttachments};
previewDialog.setAttachment(m_attachmentsModel->keyByIndex(index));

previewDialog.exec();
Expand Down
1 change: 1 addition & 0 deletions src/gui/entry/PreviewEntryAttachmentsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PreviewEntryAttachmentsDialog::PreviewEntryAttachmentsDialog(QPointer<EntryAttac

m_ui->titleEdit->setReadOnly(true);
m_ui->attachmentTextEdit->setReadOnly(true);
m_ui->errorLabel->setVisible(false);

m_ui->dialogButtons->clear();
m_ui->dialogButtons->addButton(QDialogButtonBox::Close);
Expand Down

0 comments on commit 1c1483a

Please sign in to comment.