mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-13 13:11:41 +00:00
move the DRM skip checks to the Document
svn path=/trunk/playground/graphics/okular/; revision=628208
This commit is contained in:
parent
baf1fb2870
commit
23d666cf7f
|
@ -19,6 +19,7 @@
|
|||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
#include <kauthorized.h>
|
||||
#include <kconfigdialog.h>
|
||||
#include <kdebug.h>
|
||||
#include <klibloader.h>
|
||||
|
@ -45,6 +46,8 @@
|
|||
#include "settings.h"
|
||||
#include "sourcereference.h"
|
||||
|
||||
#include <config-okular.h>
|
||||
|
||||
using namespace Okular;
|
||||
|
||||
struct AllocatedPixmap
|
||||
|
@ -1118,6 +1121,11 @@ KUrl Document::currentDocument() const
|
|||
|
||||
bool Document::isAllowed( Permissions flags ) const
|
||||
{
|
||||
#if !OKULAR_FORCE_DRM
|
||||
if ( KAuthorized::authorize( "skip_drm" ) && !Okular::Settings::obeyDRM() )
|
||||
return true;
|
||||
#endif
|
||||
|
||||
return d->m_generator ? d->m_generator->isAllowed( flags ) : false;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <qimage.h>
|
||||
#include <qregexp.h>
|
||||
#include <qtextstream.h>
|
||||
#include <kauthorized.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kpassworddialog.h>
|
||||
|
@ -585,10 +584,6 @@ const QList<Okular::EmbeddedFile*> *PDFGenerator::embeddedFiles() const
|
|||
|
||||
bool PDFGenerator::isAllowed( Okular::Permissions permissions ) const
|
||||
{
|
||||
#if !OKULAR_FORCE_DRM
|
||||
if (KAuthorized::authorize("skip_drm") && !Okular::Settings::obeyDRM()) return true;
|
||||
#endif
|
||||
|
||||
bool b = true;
|
||||
if (permissions & Okular::AllowModify) b = b && pdfdoc->okToChange();
|
||||
if (permissions & Okular::AllowCopy) b = b && pdfdoc->okToCopy();
|
||||
|
|
Loading…
Reference in a new issue