Open tsujigiri opened 4 years ago
while you're right, i've no idea how to do...
The simplest solution that comes to mind is just keeping an object instead of the ´recently-used´ array, with the label as key and the count as value. The number space is limited, of course, but it will probably be large enough? :man_shrugging:
yes and i don't know how to do associative array with gsettings, and keeping 2 simple arrays in parallel feels hacky
i'll search how to do after i'll finally finish updating the emojis to unicode 12
If there is no such thing, serializing it into a string would probably work, too, I guess.
Do you know a good getting started guide for Gnome extension development?
there is a series of blog posts on this topic somewhere on the gnome subreddit
but gsettings isn't specific to GS extensions, the entire GIO libs are common to most GNOME-related projects: iirc defining advanced data structures storable in dconf is what GVariant is for, i've just never used it that way yet
IDK exactly how the recent used is stored, but if it is an array of strings of emoji IDs, it can be changed to an tuple, something like this:
mostUsed = [
["emojia", 23],
["emojib", 21],
["emojic", 10]
]
to display the emoji, you will extract it on your display function const [emoji] = mostUsed[i]
then, when you use an emoji, you currently remove it and put it on the begining of the array. What would you do is just remove it, put it in the array, then run a sort function mostUsed = mostUsed.sort(e => e[1])
if gnome only allows you to store an string, you can always JSON.stringify
it.
If you tell me where in the project the recentEmojis are stored, and displayed, i can try to do a PR
If your plan is really to store JSON as a string in the dconf database, i'll not accept the PR sorry
If your plan is really to store JSON as a string in the dconf database, i'll not accept the PR sorry
again, as i said:
IDK exactly how the recent used is stored, but if it is an array of strings of emoji IDs, it can be changed to an tuple, something like this:
After this:
If you tell me where in the project the recentEmojis are stored, and displayed, i can try to do a PR
I can try to learn and understand how it's done, and try to do an PR 😃
If your plan is really to store JSON as a string in the dconf database, i'll not accept the PR sorry
again, as i said:
IDK exactly how the recent used is stored, but if it is an array of strings of emoji IDs, it can be changed to an tuple, something like this:
After this:
If you tell me where in the project the recentEmojis are stored, and displayed, i can try to do a PR
I can try to learn and understand how it's done, and try to do an PR
If you're actually ready to make a PR, you should check and investigate the code by yourself. It takes less than 2 minutes for me to find this code: https://github.com/maoschanz/emoji-selector-for-gnome/blob/68086f6/emoji-selector%40maestroschan.fr/extension.js#L95-L101
Obviously, this is the place which we should change for this issue.
If you're actually ready to make a PR, you should check and investigate the code by yourself. It takes less than 2 minutes for me to find this code: https://github.com/maoschanz/emoji-selector-for-gnome/blob/68086f6/emoji-selector%40maestroschan.fr/extension.js#L95-L101
Obviously, this is the place which we should change for this issue.
I'm noticing a little toxicity here, it's sad to see this on the linux comunity :disappointed:
I'm noticing a little toxicity here, it's sad to see this on the linux comunity
Sadly that you've noticed such things there. I'm just trying to direct you and anyone else to the correct actions and places, for this case and for future ones. With the best wishes.
IMHO, it would be more useful to see the most used emoji by default instead of the recently used ones. It could also be a combination of both.