Changeset View
Changeset View
Standalone View
Standalone View
shell/shell.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 73 | { | |||
---|---|---|---|---|---|
77 | setComponentName(QStringLiteral("okular"), QString()); | 77 | setComponentName(QStringLiteral("okular"), QString()); | ||
78 | // set the shell's ui resource file | 78 | // set the shell's ui resource file | ||
79 | setXMLFile(QStringLiteral("shell.rc")); | 79 | setXMLFile(QStringLiteral("shell.rc")); | ||
80 | m_fileformatsscanned = false; | 80 | m_fileformatsscanned = false; | ||
81 | m_showMenuBarAction = nullptr; | 81 | m_showMenuBarAction = nullptr; | ||
82 | // this routine will find and load our Part. it finds the Part by | 82 | // this routine will find and load our Part. it finds the Part by | ||
83 | // name which is a bad idea usually.. but it's alright in this | 83 | // name which is a bad idea usually.. but it's alright in this | ||
84 | // case since our Part is made for this Shell | 84 | // case since our Part is made for this Shell | ||
85 | KPluginLoader loader(QStringLiteral("okularpart")); | 85 | KPluginLoader loader(QStringLiteral("kf5/parts/okularpart")); | ||
86 | m_partFactory = loader.factory(); | 86 | m_partFactory = loader.factory(); | ||
87 | if (!m_partFactory) | 87 | if (!m_partFactory) | ||
88 | { | 88 | { | ||
89 | // if we couldn't find our Part, we exit since the Shell by | 89 | // if we couldn't find our Part, we exit since the Shell by | ||
90 | // itself can't do anything useful | 90 | // itself can't do anything useful | ||
91 | m_isValid = false; | 91 | m_isValid = false; | ||
92 | KMessageBox::error(this, i18n("Unable to find the Okular component: %1", loader.errorString())); | 92 | KMessageBox::error(this, i18n("Unable to find the Okular component: %1", loader.errorString())); | ||
93 | return; | 93 | return; | ||
▲ Show 20 Lines • Show All 301 Lines • ▼ Show 20 Line(s) | 394 | { | |||
395 | setActiveTab( desiredTab ); | 395 | setActiveTab( desiredTab ); | ||
396 | } | 396 | } | ||
397 | } | 397 | } | ||
398 | 398 | | |||
399 | QStringList Shell::fileFormats() const | 399 | QStringList Shell::fileFormats() const | ||
400 | { | 400 | { | ||
401 | QStringList supportedPatterns; | 401 | QStringList supportedPatterns; | ||
402 | 402 | | |||
403 | QString constraint( QStringLiteral("(Library == 'okularpart')") ); | 403 | QString constraint( QStringLiteral("(Library == 'kf5/parts/okularpart')") ); | ||
404 | QLatin1String basePartService( "KParts/ReadOnlyPart" ); | 404 | QLatin1String basePartService( "KParts/ReadOnlyPart" ); | ||
405 | KService::List offers = KServiceTypeTrader::self()->query( basePartService, constraint ); | 405 | KService::List offers = KServiceTypeTrader::self()->query( basePartService, constraint ); | ||
406 | KService::List::ConstIterator it = offers.constBegin(), itEnd = offers.constEnd(); | 406 | KService::List::ConstIterator it = offers.constBegin(), itEnd = offers.constEnd(); | ||
407 | for ( ; it != itEnd; ++it ) | 407 | for ( ; it != itEnd; ++it ) | ||
408 | { | 408 | { | ||
409 | KService::Ptr service = *it; | 409 | KService::Ptr service = *it; | ||
410 | QStringList mimeTypes = service->mimeTypes(); | 410 | QStringList mimeTypes = service->mimeTypes(); | ||
411 | 411 | | |||
▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines |