| 461 | } |
| 462 | |
| 463 | void 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 | |
| 500 | void Shell::closeUrl() |
| 501 | { |
no test coverage detected