Merge lp:~abreu-alexandre/qtcreator-plugin-ubuntu/html5-run-desktop into lp:qtcreator-plugin-ubuntu

Proposed by Alexandre Abreu
Status: Work in progress
Proposed branch: lp:~abreu-alexandre/qtcreator-plugin-ubuntu/html5-run-desktop
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 72 lines (+34/-5)
3 files modified
src/ubuntu/ubuntuconstants.h (+2/-0)
src/ubuntu/ubuntulocalrunconfiguration.cpp (+24/-3)
src/ubuntu/ubuntumenu.cpp (+8/-2)
To merge this branch: bzr merge lp:~abreu-alexandre/qtcreator-plugin-ubuntu/html5-run-desktop
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+269765@code.launchpad.net

Commit message

Fix running html5 app on the host machine. The exec launcher selection is based on the policy version since it has changed between 1.2 and 1.3 from html5-app-launcher to webapp-container.

Description of the change

Fix running html5 app on the host machine. The exec launcher selection is based on the policy version since it has changed between 1.2 and 1.3 from html5-app-launcher to webapp-container.

To post a comment you must log in.

Unmerged revisions

412. By Alexandre Abreu

Handle run html5 apps on desktop

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/ubuntu/ubuntuconstants.h'
--- src/ubuntu/ubuntuconstants.h 2015-08-10 15:36:37 +0000
+++ src/ubuntu/ubuntuconstants.h 2015-09-01 15:02:38 +0000
@@ -158,6 +158,8 @@
158const char UBUNTUHTML_PROJECT_LAUNCHER_EXE[] = "ubuntu-html5-app-launcher";158const char UBUNTUHTML_PROJECT_LAUNCHER_EXE[] = "ubuntu-html5-app-launcher";
159const char UBUNTUWEBAPP_PROJECT_LAUNCHER_EXE[] = "webapp-container";159const char UBUNTUWEBAPP_PROJECT_LAUNCHER_EXE[] = "webapp-container";
160const char UBUNTUSCOPES_PROJECT_LAUNCHER_EXE[] = "qtc_desktop_scoperunner.py";160const char UBUNTUSCOPES_PROJECT_LAUNCHER_EXE[] = "qtc_desktop_scoperunner.py";
161
162const char UBUNTUHTML_WEBAPP_CONTAINER_POLICY_MIN[] = "1.3";
161163
162const char UBUNTU_PROJECT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Ubuntu");164const char UBUNTU_PROJECT_WIZARD_CATEGORY_DISPLAY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Ubuntu");
163165
164166
=== modified file 'src/ubuntu/ubuntulocalrunconfiguration.cpp'
--- src/ubuntu/ubuntulocalrunconfiguration.cpp 2015-06-30 13:34:14 +0000
+++ src/ubuntu/ubuntulocalrunconfiguration.cpp 2015-09-01 15:02:38 +0000
@@ -449,10 +449,31 @@
449 if (ubuntuProject) {449 if (ubuntuProject) {
450 m_workingDir = ubuntuProject->projectDirectory();450 m_workingDir = ubuntuProject->projectDirectory();
451 if (ubuntuProject->mainFile().compare(QString::fromLatin1("www/index.html"), Qt::CaseInsensitive) == 0) {451 if (ubuntuProject->mainFile().compare(QString::fromLatin1("www/index.html"), Qt::CaseInsensitive) == 0) {
452 QString manifestFilePath =
453 UbuntuProjectHelper::getManifestPath (target(),
454 QStringLiteral("manifest.json"));
455
452 Utils::Environment env = Utils::Environment::systemEnvironment();456 Utils::Environment env = Utils::Environment::systemEnvironment();
453 m_executable = env.searchInPath(QString::fromLatin1(Ubuntu::Constants::UBUNTUHTML_PROJECT_LAUNCHER_EXE)).toString();457
454 m_args = QStringList()<<QString::fromLatin1("--www=%0/www").arg(ubuntuProject->projectDirectory().toString())458 UbuntuClickManifest manifest;
455 <<QString::fromLatin1("--inspector");459 if (QFile::exists(manifestFilePath)
460 && manifest.load(manifestFilePath)
461 && manifest.policyVersion() >= QString::fromLatin1(Ubuntu::Constants::UBUNTUHTML_WEBAPP_CONTAINER_POLICY_MIN)) {
462 m_executable =
463 env.searchInPath(QString::fromLatin1(Ubuntu::Constants::UBUNTUWEBAPP_PROJECT_LAUNCHER_EXE)).toString();
464 m_args = QStringList()
465 << QString::fromLatin1("%0/www/index.html")
466 .arg(ubuntuProject->projectDirectory().toString());
467 } else {
468 m_executable =
469 env.searchInPath(QString::fromLatin1(Ubuntu::Constants::UBUNTUHTML_PROJECT_LAUNCHER_EXE)).toString();
470 m_args = QStringList()
471 << QString::fromLatin1("--www=%0/www")
472 .arg(ubuntuProject->projectDirectory().toString());
473 }
474
475 m_args << QString::fromLatin1("--inspector");
476
456 } else if (ubuntuProject->mainFile().endsWith(QStringLiteral(".desktop"), Qt::CaseInsensitive)) {477 } else if (ubuntuProject->mainFile().endsWith(QStringLiteral(".desktop"), Qt::CaseInsensitive)) {
457 Utils::Environment env = Utils::Environment::systemEnvironment();478 Utils::Environment env = Utils::Environment::systemEnvironment();
458479
459480
=== modified file 'src/ubuntu/ubuntumenu.cpp'
--- src/ubuntu/ubuntumenu.cpp 2015-06-19 07:22:31 +0000
+++ src/ubuntu/ubuntumenu.cpp 2015-09-01 15:02:38 +0000
@@ -673,8 +673,14 @@
673 }673 }
674674
675 if (isProperUbuntuHtmlProject(project)) {675 if (isProperUbuntuHtmlProject(project)) {
676 command = command.replace(QLatin1String(Constants::UBUNTU_ACTION_APP_RUNNER_EXECNAME),676 QString launcherExec =
677 QLatin1String(Constants::UBUNTUHTML_PROJECT_LAUNCHER_EXE));677 QLatin1String(Constants::UBUNTUHTML_PROJECT_LAUNCHER_EXE);
678 if (manifest.isInitialized()
679 && manifest.policyVersion() >= QLatin1String(Constants::UBUNTUHTML_WEBAPP_CONTAINER_POLICY_MIN)) {
680 launcherExec = QLatin1String(Constants::UBUNTUWEBAPP_PROJECT_LAUNCHER_EXE);
681 }
682
683 command = command.replace(QLatin1String(Constants::UBUNTU_ACTION_APP_RUNNER_EXECNAME), launcherExec);
678 }684 }
679685
680 QVariant clickTargetRequired = act->property(Constants::UBUNTU_MENUJSON_CLICKTARGETREQUIRED);686 QVariant clickTargetRequired = act->property(Constants::UBUNTU_MENUJSON_CLICKTARGETREQUIRED);

Subscribers

People subscribed via source and target branches