diff --git a/TODO b/TODO index bfd4db0f2..84f73c977 100644 --- a/TODO +++ b/TODO @@ -75,6 +75,7 @@ More items (first items will enter 'In progress list' first): Done (newest features come first): -- merging from kdpf_annotations branch -- +-> ADD: Obey DRM is now a configuration option -> FIX: leakfix when closing document while thread was running (no more leaks now) -> FIX: direct hi-performance pixels manipulation for highlighting (instead of the obsoleted setRasterOp) -> CHG: new search api. supports multiple searches at once, multiple highlighs per page diff --git a/conf/dlggeneral.ui b/conf/dlggeneral.ui index 603228d78..9a7bb2c16 100644 --- a/conf/dlggeneral.ui +++ b/conf/dlggeneral.ui @@ -9,7 +9,7 @@ 0 0 320 - 169 + 300 @@ -32,7 +32,7 @@ - layout6 + layout4 @@ -111,6 +111,14 @@ Show &hints and info messages + + + kcfg_ObeyDRM + + + &Obey DRM limitations + + @@ -194,7 +202,11 @@ kdialog.h kiconloader.h + dlggeneral.ui.h + + showEvent( QShowEvent * ) + DesktopIcon diff --git a/conf/dlggeneral.ui.h b/conf/dlggeneral.ui.h new file mode 100644 index 000000000..6d96d78ef --- /dev/null +++ b/conf/dlggeneral.ui.h @@ -0,0 +1,19 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + +#include + +void DlgGeneral::showEvent( QShowEvent * ) +{ + if (kapp->authorize("skip_drm")) kcfg_ObeyDRM->show(); + else kcfg_ObeyDRM->hide(); +} diff --git a/conf/kpdf.kcfg b/conf/kpdf.kcfg index 12a92b8c0..64d343250 100644 --- a/conf/kpdf.kcfg +++ b/conf/kpdf.kcfg @@ -53,6 +53,9 @@ true + + true + diff --git a/configure.in.in b/configure.in.in index 62f5b415d..a5cdfac20 100644 --- a/configure.in.in +++ b/configure.in.in @@ -112,6 +112,6 @@ AC_ARG_ENABLE(kpdf-drm, ;; esac ] -, AC_DEFINE(KPDF_HAVE_DRM, 1, [Defines if use DRM in kpdf]) +, AC_DEFINE(KPDF_HAVE_DRM, 0, [Defines if use DRM in kpdf]) ) diff --git a/core/generator_pdf/generator_pdf.cpp b/core/generator_pdf/generator_pdf.cpp index 24c288381..44771df16 100644 --- a/core/generator_pdf/generator_pdf.cpp +++ b/core/generator_pdf/generator_pdf.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -213,6 +214,8 @@ const DocumentSynopsis * PDFGenerator::generateDocumentSynopsis() bool PDFGenerator::isAllowed( int permissions ) { + if (kapp->authorize("skip_drm") && !Settings::obeyDRM()) return true; + bool b = true; if (permissions & KPDFDocument::AllowModify) b = b && pdfdoc->okToChange(); if (permissions & KPDFDocument::AllowCopy) b = b && pdfdoc->okToCopy();