Merge lp:~mzanetti/reminders-app/load-qml-from-usr into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 78
Merged at revision: 78
Proposed branch: lp:~mzanetti/reminders-app/load-qml-from-usr
Merge into: lp:reminders-app
Diff against target: 16 lines (+6/-1)
1 file modified
src/app/main.cpp (+6/-1)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/load-qml-from-usr
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+208088@code.launchpad.net

Commit message

load qml file from /usr/share if not found in current dir

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

lgtm

review: Approve
Revision history for this message
David Planella (dpm) wrote :

Sorry to comment on an old MR, but I've just come across this one now. A quick question:

- Could /usr/share/reminders/ not be determined using QStandardPaths::DataLocation instead of being hardcoded?

Revision history for this message
Michael Zanetti (mzanetti) wrote :

Yeah... true. Well, I guess DataLocation points to /usr/share only. but yeah, would be better.

Revision history for this message
David Planella (dpm) wrote :

Not a big deal, I just came across the merge proposal and I thought I'd
mention it. If I understand it correctly, QStandardPaths::DataLocation
would point to /usr/share/reminders, whereas
QStandardPaths::GenericDataLocation would point to /usr/share

Cheers,
David.

On Wed, Mar 12, 2014 at 11:13 AM, Michael Zanetti <
<email address hidden>> wrote:

> Yeah... true. Well, I guess DataLocation points to /usr/share only. but
> yeah, would be better.
> --
>
> https://code.launchpad.net/~mzanetti/reminders-app/load-qml-from-usr/+merge/208088
> Your team Ubuntu Reminders app developers is subscribed to branch
> lp:reminders-app.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/main.cpp'
2--- src/app/main.cpp 2014-02-19 00:07:09 +0000
3+++ src/app/main.cpp 2014-02-25 09:47:08 +0000
4@@ -84,7 +84,12 @@
5 view.engine()->rootContext()->setContextProperty("accountPreference", &preferences);
6
7 // load the qml file
8- view.setSource(QUrl::fromLocalFile("qml/reminders.qml"));
9+ QFileInfo fi("qml/reminders.qml");
10+ if (fi.exists()) {
11+ view.setSource(QUrl::fromLocalFile("qml/reminders.qml"));
12+ } else {
13+ view.setSource(QUrl::fromLocalFile("/usr/share/reminders/qml/reminders.qml"));
14+ }
15
16 view.show();
17

Subscribers

People subscribed via source and target branches