MCPcopy Create free account
hub / github.com/KDE/okular / openUrl

Method openUrl

shell/shell.cpp:463–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463void Shell::openUrl(const QUrl &url, const QString &serializedOptions)
464{
465 hideWelcomeScreen();
466
467 const int activeTab = m_tabWidget->currentIndex();
468 KParts::ReadWritePart *const activePart = m_tabs[activeTab].part;
469 if (!activePart->url().isEmpty()) {
470 if (m_unique) {
471 applyOptionsToPart(activePart, serializedOptions);
472 activePart->openUrl(url);
473 } else {
474 if (qobject_cast<Okular::ViewerInterface *>(activePart)->openNewFilesInTabs()) {
475 openNewTab(url, serializedOptions);
476 } else {
477 Shell *newShell = new Shell(serializedOptions);
478 newShell->show();
479 newShell->openUrl(url, serializedOptions);
480 }
481 }
482 } else {
483 m_tabWidget->setTabText(activeTab, url.fileName());
484 m_tabWidget->setTabToolTip(activeTab, url.fileName());
485
486 applyOptionsToPart(activePart, serializedOptions);
487 bool openOk = activePart->openUrl(url);
488 const bool isstdin = url.fileName() == QLatin1String("-") || url.scheme() == QLatin1String("fd");
489 if (!isstdin) {
490 if (openOk) {
491 m_recent->addUrl(url);
492 } else {
493 m_recent->removeUrl(url);
494 closeTab(activeTab);
495 }
496 }
497 }
498}
499
500void Shell::closeUrl()
501{

Callers 2

openNewlySignedFileMethod · 0.45
openNewTabMethod · 0.45

Calls 5

isEmptyMethod · 0.80
openNewFilesInTabsMethod · 0.80
showMethod · 0.80
urlMethod · 0.45
fileNameMethod · 0.45

Tested by

no test coverage detected