From 223092aa0e1fd5fd1b48a34702d2102fdb1acccf Mon Sep 17 00:00:00 2001 From: Jonathan Doman Date: Thu, 14 May 2015 00:58:21 +0200 Subject: [PATCH] Fix embed mode detection Wow, I have no idea how this happened. I wrote an big test case and spent a lot of time playing with tabs. Stephan Binner even told me about this a month ago, but I didn't quite understand the problem... Broken embed mode detection means that the tabbed interface is disabled. It actually made it into release... ugh REVIEW: 123680 --- core/script/kjs_document.cpp | 2 +- part.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/script/kjs_document.cpp b/core/script/kjs_document.cpp index 4422953b0..b8d7e1c06 100644 --- a/core/script/kjs_document.cpp +++ b/core/script/kjs_document.cpp @@ -125,7 +125,7 @@ static KJSObject docGetExternal( KJSContext *, void *object ) const bool isShell = ( widget && widget->parentWidget() - && widget->parentWidget()->objectName() == QLatin1String( "okular::Shell" ) ); + && widget->parentWidget()->objectName().startsWith( QLatin1String( "okular::Shell" ) ) ); return KJSBoolean( !isShell ); } diff --git a/part.cpp b/part.cpp index fbeda1e65..8dbb8e8b1 100644 --- a/part.cpp +++ b/part.cpp @@ -239,8 +239,8 @@ static Okular::EmbedMode detectEmbedMode( QWidget *parentWidget, QObject *parent Q_UNUSED( parentWidget ); if ( parent - && ( parent->objectName() == QLatin1String( "okular::Shell" ) - || parent->objectName() == QLatin1String( "okular/okular__Shell" ) ) ) + && ( parent->objectName().startsWith( QLatin1String( "okular::Shell" ) ) + || parent->objectName().startsWith( QLatin1String( "okular/okular__Shell" ) ) ) ) return Okular::NativeShellMode; if ( parent