Open a new document if we have space for it This can hang if called on a unique instance and openUrl pops a messageBox
| 394 | // Open a new document if we have space for it |
| 395 | // This can hang if called on a unique instance and openUrl pops a messageBox |
| 396 | bool Shell::openDocument(const QUrl &url, const QString &serializedOptions) |
| 397 | { |
| 398 | if (m_tabs.size() <= 0) { |
| 399 | return false; |
| 400 | } |
| 401 | |
| 402 | hideWelcomeScreen(); |
| 403 | |
| 404 | KParts::ReadWritePart *const part = m_tabs[0].part; |
| 405 | |
| 406 | // Return false if we can't open new tabs and the only part is occupied |
| 407 | if (!qobject_cast<Okular::ViewerInterface *>(part)->openNewFilesInTabs() && !part->url().isEmpty() && !ShellUtils::unique(serializedOptions)) { |
| 408 | return false; |
| 409 | } |
| 410 | |
| 411 | openUrl(url, serializedOptions); |
| 412 | |
| 413 | return true; |
| 414 | } |
| 415 | |
| 416 | bool Shell::openDocument(const QString &urlString, const QString &serializedOptions) |
| 417 | { |