Skip to content

Commit 64ae12e

Browse files
committed
outline: Minor improvements on "Open with system"
* src/plugins/outline-view/OutlineViewPlugin.cpp: Likewise.
1 parent 472ab5e commit 64ae12e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/plugins/outline-view/OutlineViewPlugin.cpp

+8-10
Original file line numberDiff line numberDiff line change
@@ -424,26 +424,24 @@ void OutlineViewPlugin::validationError(QString pluginID, void *param)
424424

425425
void OutlineViewPlugin::openWithDefaultSystemEditor(QString entityId)
426426
{
427-
QString fullurl;
427+
QString url;
428428
Entity *entity = project->getEntityById(entityId);
429-
qWarning() << entity->getAttribute("src");
430429
QFileInfo projectInfo(project->getLocation());
431430

432431
if(entity->getType() == "media")
433432
{
434-
fullurl = entity->getAttribute("src");
435-
if(!QFile::exists(fullurl))
436-
fullurl = projectInfo.absolutePath() + "/" + entity->getAttribute("src");
433+
url = entity->getAttribute("src");
437434
}
438435
else if(entity->getType() == "importBase")
439436
{
440-
fullurl = entity->getAttribute("documentURI");
441-
if(!QFile::exists(fullurl))
442-
fullurl = projectInfo.absolutePath() + "/" + entity->getAttribute("documentURI");
437+
url = entity->getAttribute("documentURI");
443438
}
444439

445-
if(QFile::exists(fullurl))
446-
QDesktopServices::openUrl(fullurl);
440+
if(!QFile::exists(url))
441+
url = projectInfo.absolutePath() + "/" + url;
442+
443+
if(QFile::exists(url))
444+
QDesktopServices::openUrl(url);
447445
else
448446
QMessageBox::warning(nullptr,
449447
tr("Warning"),

0 commit comments

Comments
 (0)