Commit cc908b9f authored by Katarina Behrens's avatar Katarina Behrens Committed by Albert Astals Cid
Browse files

Pass pointer to widget annotation just added down the chain

parent 03381667
......@@ -2701,10 +2701,10 @@ bool Document::canConfigurePrinter() const
return false;
}
void Document::sign()
void Document::sign( const Okular::Annotation* pWhichAnnotation )
{
if (d->m_generator->canSign())
d->m_generator->sign();
d->m_generator->sign( pWhichAnnotation );
}
DocumentInfo Document::documentInfo() const
......
......@@ -1052,7 +1052,7 @@ public Q_SLOTS:
*/
void reloadDocument() const;
void sign();
void sign( const Okular::Annotation* pWhichAnnotation );
/**
* Returns the part of document covered by the given signature @p info.
......
......@@ -309,7 +309,7 @@ public:
virtual bool canSign() const { return false; }
virtual void sign() { return; }
virtual void sign( const Okular::Annotation* /*pWhichAnnotation*/) { return; }
/**
* This method can be called to trigger the generation of
......
......@@ -1854,6 +1854,12 @@ Okular::AnnotationProxy *PDFGenerator::annotationProxy() const
return annotProxy;
}
void PDFGenerator::sign( const Okular::Annotation* pWhichAnnotation )
{
Poppler::Annotation *popplerAnn = qvariant_cast< Poppler::Annotation * >( pWhichAnnotation->nativeId() );
pdfdoc->sign( popplerAnn );
}
#include "generator_pdf.moc"
Q_LOGGING_CATEGORY(OkularPdfDebug, "org.kde.okular.generators.pdf", QtWarningMsg)
......
......@@ -101,7 +101,7 @@ public:
Okular::AnnotationProxy *annotationProxy() const override;
bool canSign() const override {return true;}
void sign() override { return; }
void sign( const Okular::Annotation* pWhichAnnotation ) override;
protected:
SwapBackingFileResult swapBackingFile(QString const &newFileName, QVector<Okular::Page *> &newPagesVector) override;
......
......@@ -923,7 +923,7 @@ QRect PageViewAnnotator::performRouteMouseOrTabletEvent(const AnnotatorEngine::E
m_document->addPageAnnotation(m_lockedItem->pageNumber(), annotation);
if (signatureMode())
m_document->sign();
m_document->sign(annotation);
if (annotation->openDialogAfterCreation())
m_pageView->openAnnotationWindow(annotation, m_lockedItem->pageNumber());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment