summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <arichardson.kde@gmail.com>2015-11-28 15:08:19 (GMT)
committerAlex Richardson <arichardson.kde@gmail.com>2015-11-28 16:04:57 (GMT)
commitab1d3a36cce914e8a831cc702d4eda84ec014f99 (patch)
tree7d90cc8001b3370f9ad01f3eb540fe9c510b4309
parente5383ea2d6c25f628871a7af68022e95b62e8550 (diff)
Set the KXMLGUI component name to okular
Without this the .rc files will not be found by the unit tests or other programs that use okularpart
-rw-r--r--part.cpp4
-rw-r--r--shell/shell.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/part.cpp b/part.cpp
index 4019680..ab11a25 100644
--- a/part.cpp
+++ b/part.cpp
@@ -292,6 +292,10 @@ const QVariantList &args)
m_tempfile( 0 ), m_fileWasRemoved( false ), m_showMenuBarAction( 0 ), m_showFullScreenAction( 0 ), m_actionsSearched( false ),
m_cliPresentation(false), m_cliPrint(false), m_embedMode(detectEmbedMode(parentWidget, parent, args)), m_generatorGuiClient(0), m_keeper( 0 )
{
+ // make sure that the component name is okular otherwise the XMLGUI .rc files are not found
+ // when this part is used in an application other than okular (e.g. unit tests)
+ setComponentName(QStringLiteral("okular"), QString());
+
// first, we check if a config file name has been specified
QString configFileName = detectConfigFileName( args );
if ( configFileName.isEmpty() )
diff --git a/shell/shell.cpp b/shell/shell.cpp
index 339c14d..e69ecbb 100644
--- a/shell/shell.cpp
+++ b/shell/shell.cpp
@@ -65,6 +65,8 @@ Shell::Shell( const QString &serializedOptions )
{
setObjectName( QStringLiteral( "okular::Shell#" ) );
setContextMenuPolicy( Qt::NoContextMenu );
+ // otherwise .rc file won't be found by unit test
+ setComponentName(QStringLiteral("okular"), QString());
// set the shell's ui resource file
setXMLFile(QStringLiteral("shell.rc"));
m_fileformatsscanned = false;