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

Method openDocument

shell/shell.cpp:396–414  ·  view source on GitHub ↗

Open a new document if we have space for it This can hang if called on a unique instance and openUrl pops a messageBox

Source from the content-addressed store, hash-verified

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
396bool 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
416bool Shell::openDocument(const QString &urlString, const QString &serializedOptions)
417{

Callers 2

mainFunction · 0.45
forMethod · 0.45

Calls 6

uniqueFunction · 0.85
openNewFilesInTabsMethod · 0.80
isEmptyMethod · 0.80
QUrlClass · 0.70
sizeMethod · 0.45
urlMethod · 0.45

Tested by

no test coverage detected