move the okular configurations to config-okular.h

create again the options to force the DRM (give -DOKULAR_FORCE_DRM=ON to cmake)
KPDF_FORCE_DRM -> OKULAR_FORCE_DRM

svn path=/branches/work/kde4/playground/graphics/okular/; revision=542815
remotes/origin/old/work/newpageview
Pino Toscano 20 years ago
parent 1e76f54012
commit 64867d5b3c
  1. 16
      CMakeLists.txt
  2. 3
      conf/dlggeneral.cpp
  3. 3
      config-okular.h.cmake
  4. 3
      generators/poppler/generator_pdf.cpp

@ -1,5 +1,21 @@
project(oKular)
OPTION(
OKULAR_FORCE_DRM
"Forces oKular to check for DRM to decide if you can copy/print protected pdf. (default=no)"
OFF
)
if(OKULAR_FORCE_DRM STREQUAL "ON")
set(_OKULAR_FORCE_DRM 1)
else(OKULAR_FORCE_DRM STREQUAL "ON")
set(_OKULAR_FORCE_DRM 0)
endif(OKULAR_FORCE_DRM STREQUAL "ON")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config-okular.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-okular.h
)
add_subdirectory( conf )
add_subdirectory( core )
add_subdirectory( ui )

@ -10,6 +10,7 @@
#include <kauthorized.h>
#include <config.h>
#include <config-okular.h>
#include "ui_dlggeneralbase.h"
@ -24,7 +25,7 @@ DlgGeneral::DlgGeneral( QWidget * parent )
void DlgGeneral::showEvent( QShowEvent * )
{
#if KPDF_FORCE_DRM
#if OKULAR_FORCE_DRM
m_dlg->kcfg_ObeyDRM->hide();
#else
if ( KAuthorized::authorize( "skip_drm" ) )

@ -0,0 +1,3 @@
/* Defines if force the use DRM in oKular */
#define OKULAR_FORCE_DRM ${_OKULAR_FORCE_DRM}

@ -29,6 +29,7 @@
#include "settings.h"
#include <config.h>
#include <config-okular.h>
// id for DATA_READY PDFPixmapGeneratorThread Event
#define TGE_DATAREADY_ID 6969
@ -491,7 +492,7 @@ const DocumentFonts * PDFGenerator::generateDocumentFonts()
bool PDFGenerator::isAllowed( int permissions )
{
#if !KPDF_FORCE_DRM
#if !OKULAR_FORCE_DRM
if (KAuthorized::authorize("skip_drm") && !KpdfSettings::obeyDRM()) return true;
#endif

Loading…
Cancel
Save