View | Details | Raw Unified | Return to bug 228199
Collapse All | Expand All

(-)graphics/okular/files/patch-shell-shell.cpp (+29 lines)
Line 0 Link Here
1
--- shell/shell.cpp.orig	2018-05-06 04:09:02 UTC
2
+++ shell/shell.cpp
3
@@ -211,7 +211,7 @@ bool Shell::openDocument( const QUrl& url, const QStri
4
     KParts::ReadWritePart* const part = m_tabs[0].part;
5
 
6
     // Return false if we can't open new tabs and the only part is occupied
7
-    if ( !dynamic_cast<Okular::ViewerInterface*>(part)->openNewFilesInTabs()
8
+    if ( !qobject_cast<Okular::ViewerInterface*>(part)->openNewFilesInTabs()
9
          && !part->url().isEmpty()
10
          && !ShellUtils::unique(serializedOptions))
11
     {
12
@@ -234,7 +234,7 @@ bool Shell::canOpenDocs( int numDocs, int desktop )
13
       return false;
14
 
15
    KParts::ReadWritePart* const part = m_tabs[0].part;
16
-   const bool allowTabs = dynamic_cast<Okular::ViewerInterface*>(part)->openNewFilesInTabs();
17
+   const bool allowTabs = qobject_cast<Okular::ViewerInterface*>(part)->openNewFilesInTabs();
18
 
19
    if( !allowTabs && (numDocs > 1 || !part->url().isEmpty()) )
20
       return false;
21
@@ -261,7 +261,7 @@ void Shell::openUrl( const QUrl & url, const QString &
22
             }
23
             else
24
             {
25
-                if( dynamic_cast<Okular::ViewerInterface *>(activePart)->openNewFilesInTabs() )
26
+                if( qobject_cast<Okular::ViewerInterface *>(activePart)->openNewFilesInTabs() )
27
                 {
28
                     openNewTab( url, serializedOptions );
29
                 }

Return to bug 228199