-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 5c7e541..aae9ab0 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp @@ -465,39 +465,44 @@ void DrawPad::updateUndoRedoToolButtons() void DrawPad::updateNavigationToolButtons() { m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); } void DrawPad::updateCaption() { uint pagePosition = m_pDrawPadCanvas->pagePosition(); uint pageCount = m_pDrawPadCanvas->pageCount(); setCaption(tr("DrawPad") + " - " + tr("Page") + " " + QString::number(pagePosition) + "/" + QString::number(pageCount)); } void DrawPad::importPage() { ImportDialog importDialog(this); importDialog.showMaximized(); if (importDialog.exec() == QDialog::Accepted) { - m_pDrawPadCanvas->importPage(importDialog.selected()->file()); + const DocLnk* docLnk = importDialog.selected(); + + if (docLnk) { + m_pDrawPadCanvas->importPage(docLnk->file()); + delete docLnk; + } } } void DrawPad::exportPage() { ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); exportDialog.showMaximized(); if (exportDialog.exec() == QDialog::Accepted) { m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), exportDialog.selectedName(), exportDialog.selectedFormat()); } } |