Merge lp:~unity-team/unity-scopes-shell/drop-appid-workaround into lp:unity-scopes-shell

Proposed by Michael Zanetti
Status: Merged
Approved by: Michal Hruby
Approved revision: 114
Merged at revision: 117
Proposed branch: lp:~unity-team/unity-scopes-shell/drop-appid-workaround
Merge into: lp:unity-scopes-shell
Diff against target: 73 lines (+4/-43)
2 files modified
src/Unity/scope.cpp (+4/-19)
tests/previewtest.cpp (+0/-24)
To merge this branch: bzr merge lp:~unity-team/unity-scopes-shell/drop-appid-workaround
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+228427@code.launchpad.net

Commit message

drop appId workaround for shell as dash will now use UAL to launch apps

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.

https://code.launchpad.net/~unity-team/unity8/dash-as-app/+merge/228534

 * Did you perform an exploratory manual test run of your code change and any related functionality?

Yes

 * Did you make sure that your branch does not contain spurious tags?

yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

no

 * If you changed the UI, has there been a design review?

no

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

+1, land when appropriate pls.

review: Approve
Revision history for this message
Michal Hruby (mhr3) wrote :

Yep

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/scope.cpp'
2--- src/Unity/scope.cpp 2014-07-31 13:04:20 +0000
3+++ src/Unity/scope.cpp 2014-08-04 13:20:18 +0000
4@@ -902,30 +902,15 @@
5
6 void Scope::activateUri(QString const& uri)
7 {
8- /* Tries various methods to trigger a sensible action for the given 'uri'.
9- If it has no understanding of the given scheme it falls back on asking
10- Qt to open the uri.
11- */
12+ /*
13+ * If it's a scope URI, perform the query, otherwise ask Qt to open it.
14+ */
15 QUrl url(uri);
16- if (url.scheme() == QLatin1String("application")) {
17- QString path(url.path().isEmpty() ? url.authority() : url.path());
18- if (path.startsWith("/")) {
19- Q_FOREACH(const QString &dir, QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation)) {
20- if (path.startsWith(dir)) {
21- path.remove(0, dir.length());
22- path.replace('/', '-');
23- break;
24- }
25- }
26- }
27-
28- Q_EMIT activateApplication(QFileInfo(path).completeBaseName());
29- } else if (url.scheme() == QLatin1String("scope")) {
30+ if (url.scheme() == QLatin1String("scope")) {
31 qDebug() << "Got scope URI" << uri;
32 performQuery(uri);
33 } else {
34 qDebug() << "Trying to open" << uri;
35- /* Try our luck */
36 QDesktopServices::openUrl(url);
37 }
38 }
39
40=== modified file 'tests/previewtest.cpp'
41--- tests/previewtest.cpp 2014-07-31 11:08:50 +0000
42+++ tests/previewtest.cpp 2014-08-04 13:20:18 +0000
43@@ -167,30 +167,6 @@
44 QCOMPARE(preview->processingAction(), false);
45 }
46
47- void testPreviewUriAction()
48- {
49- QScopedPointer<PreviewStack> preview_stack;
50- QVERIFY(previewForFirstResult(m_scope, QString("layout"), preview_stack));
51-
52- QCOMPARE(preview_stack->rowCount(), 1);
53- QCOMPARE(preview_stack->widgetColumnCount(), 1);
54- auto preview = preview_stack->getPreviewModel(0);
55- QTRY_COMPARE(preview->loaded(), true);
56- QCOMPARE(preview->rowCount(), 1);
57-
58- QSignalSpy spy(m_scope, SIGNAL(activateApplication(QString)));
59- QVariantMap hints;
60- hints["uri"] = QString("application:///tmp/non-existent.desktop");
61- Q_EMIT preview->triggered(QString("actions"), QString("open"), hints);
62- // this is likely to be invoked synchronously
63- if (spy.count() == 0) {
64- QVERIFY(spy.wait());
65- }
66- QList<QVariant> arguments = spy.takeFirst();
67- auto desktopFile = arguments.at(0).value<QString>();
68- QCOMPARE(desktopFile, QString("non-existent"));
69- }
70-
71 void testPreviewReplacingPreview()
72 {
73 QScopedPointer<PreviewStack> preview_stack;

Subscribers

People subscribed via source and target branches

to all changes: