Reply
Thread Tools
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1
Hi all, within the Jolla email application, we find a page named Folders, showing inbox/outbox/etc.

I manage multiple accounts (mostly on my PC) but also find it handy to be able to monitor all accounts from my Jolla1.

I have made several unsuccessful attempts to edit 'FoldersListPage.qml' to reflect the desired changes, at worst, the folders page becomes inaccessible.
I thought that by using a line of code** from AccountList.qml (line 90) and inserting into the header title of FoldersListPage.qml (line 38) that I would then see the display name/email address of the account, but it didn't work, I get an error from console;

Code:
** title: displayName != "" ? displayName : emailAddress
Code:
[W] unknown:38 - file:///usr/share/jolla-email//pages/FolderListPage.qml:38: 
    ReferenceError: displayName is not defined
So I tried adding an ID as reference to the original text, but this also doesn't work, the folder title remains blank.

However, the above is just one example of many different attempts

Any ideas appreciated as I am out of ideas, if i cannot crack it myself, I'll possibly post as a feature request on TJC.

Regards,

Before edit......then after
Attached Images
  
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Posts: 62 | Thanked: 319 times | Joined on Jan 2013 @ Grenoble, France
#2
Not tested, but you can try:

title: mailAccountListModel.displayNameFromAccountId(acco untKey)

The email address for the accountid can be retrieved the same way with:
mailAccountListModel.emailAddressFromAccountId(acc ountKey)
 

The Following 7 Users Say Thank You to dcaliste For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#3
Thanks @dcaliste, your code is spot on, bang on the money!

Regards,

p.s. I'm curious as to how you arrived at that particular code?, is this something you basically already knew?
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..

Last edited by Markkyboy; 2019-05-27 at 16:42.
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Posts: 62 | Thanked: 319 times | Joined on Jan 2013 @ Grenoble, France
#4
Happy that it's working. Besides, it's not a bad suggestion, I would say. What do you think about posting a feature request on TJC ? I would like to hear the opinion of other people about this proposition.

If enough people approve, I'll submit a patch to Jolla and try to advocate for the change.

About how I find this, I've access to the email code through NDA. But it is in clear in QML anyway. The solution is based also on nemo-qml-plugin-email (see src/emailAccountListModel.h) which is Open Source and in the SailfishOS git repository.

To fully answer your question, the code you try to paste is from a delegate. So the displayName is an attribute of the model at a given index. It cannot be accessed out of the delegate. But nemo-qml-plugin-email provides accessors to the display name and some other attributes directly from the account id. The mailAccountListModel object I'm using, can be found in the email.qml file. It is a global object that is available in all the app.

Last edited by dcaliste; 2019-05-27 at 16:52.
 

The Following 4 Users Say Thank You to dcaliste For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#5
Originally Posted by dcaliste View Post
Happy that it's working. Besides, it's not a bad suggestion, I would say. What do you think about posting a feature request on TJC ? I would like to hear the opinion of other people about this proposition.

If enough people approve, I'll submit a patch to Jolla and try to advocate for the change.

About how I find this, I've access to the email code through NDA. But it is in clear in QML anyway. The solution is based also on nemo-qml-plugin-email (see src/emailAccountListModel.h) which is Open Source and in the SailfishOS git repository.

To fully answer your question, the code you try to paste is from a delegate. So the displayName is an attribute of the model at a given index. It cannot be accessed out of the delegate. But nemo-qml-plugin-email provides accessors to the display name and some other attributes directly from the account id. The mailAccountListModel object I'm using, can be found in the email.qml file. It is a global object that is available in all the app.
Okay, there's some knowledge for us all, I had little to no idea about the delegate item but looking back at the code, I now understand, thanks.

I'm glad you like the idea, at your suggestion I will certainly post on TJC, it's always nice when Jolla gives the nod and includes end users ideas into the OS/apps.

Thanks again,...
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#6
Posted:

https://together.jolla.com/question/...-folders-page/
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following 3 Users Say Thank You to Markkyboy For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#7
Originally Posted by Markkyboy View Post
Posted:

https://together.jolla.com/question/...-folders-page/
Hmmm, only 14 votes....not much eh, bugger!
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:34.