[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegraphics/okular/ui
From:       Eike Hein <hein () kde ! org>
Date:       2010-09-11 13:52:01
Message-ID: 20100911135201.6B217AC888 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1174215 by hein:

Don't show the Web Shortcuts submenu if DRM disallows copying.


 M  +9 -2      pageview.cpp  


--- trunk/KDE/kdegraphics/okular/ui/pageview.cpp #1174214:1174215
@@ -2027,15 +2027,19 @@
             {
                 menu.addTitle( i18np( "Text (1 character)", "Text (%1 characters)", \
                selectedText.length() ) );
                 textToClipboard = menu.addAction( KIcon("edit-copy"), i18n( "Copy to \
                Clipboard" ) );
-                if ( !d->document->isAllowed( Okular::AllowCopy ) )
+                bool copyAllowed = d->document->isAllowed( Okular::AllowCopy );
+                if ( !copyAllowed )
                 {
                     textToClipboard->setEnabled( false );
                     textToClipboard->setText( i18n("Copy forbidden by DRM") );
                 }
                 if ( Okular::Settings::useKTTSD() )
                     speakText = menu.addAction( KIcon("text-speak"), i18n( "Speak \
Text" ) ); +                if ( copyAllowed )
+                {
+                    addWebShortcutsMenu( &menu, selectedText );
             }
-            addWebShortcutsMenu( &menu, selectedText );
+            }
             menu.addTitle( i18n( "Image (%1 by %2 pixels)", selectionRect.width(), \
                selectionRect.height() ) );
             imageToClipboard = menu.addAction( KIcon("image-x-generic"), i18n( "Copy \
                to Clipboard" ) );
             imageToFile = menu.addAction( KIcon("document-save"), i18n( "Save to \
File..." ) ); @@ -2139,7 +2143,10 @@
                         textToClipboard->setEnabled( false );
                         textToClipboard->setText( i18n("Copy forbidden by DRM") );
                     }
+                    else
+                    {
                     addWebShortcutsMenu( &menu, d->selectedText() );
+                    }
                     QAction *choice = menu.exec( e->globalPos() );
                     // check if the user really selected an action
                     if ( choice )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic