Notices


Reply
Thread Tools
rooster13's Avatar
Posts: 319 | Thanked: 221 times | Joined on Jan 2010 @ Finland
#31
I am about to release a new version of Shortcut Stash
including fixes for reading bookmarks.

Now when a bookmark is in a folder it gets added to the list.
Directory listing shows the number of folders and files in the folder.

I am also trying to get the description of an application to show in the app list.

Anybody has an idea how to read the application description like shown in the App Manager?

I'd really like to have that fixed too before releasing a new version. So if someone could help with this I'd really appreciate it.
 
rooster13's Avatar
Posts: 319 | Thanked: 221 times | Joined on Jan 2010 @ Finland
#32
Ok, couldn't wait to post the new deb since I got the scalable icons fixed.
Also added descriptions for folders. Now it is showing the number of folders and files in that directory.

For the applications descriptions I still haven't found a way so I am printing the comment field for those apps which have a proper comment.
If someone knows how to get the proper descriptions please let me know.

The bookmark in a folder issue is also fixed.

Please test and post bug reports.
 
pelago's Avatar
Posts: 2,121 | Thanked: 1,540 times | Joined on Mar 2008 @ Oxford, UK
#33
Finding the application description as displayed in Application Manager won't be straightforward. That comes from the list of packages, which won't match one-to-one with the .desktop launcher icons.
 

The Following User Says Thank You to pelago For This Useful Post:
rooster13's Avatar
Posts: 319 | Thanked: 221 times | Joined on Jan 2010 @ Finland
#34
Originally Posted by pelago View Post
Finding the application description as displayed in Application Manager won't be straightforward. That comes from the list of packages, which won't match one-to-one with the .desktop launcher icons.
Thanks, that's what I thought too.

I have experimented with dpkg -l packagename but haven't come up with a desired result. I will continue searching for a solution...
 
rooster13's Avatar
Posts: 319 | Thanked: 221 times | Joined on Jan 2010 @ Finland
#35
Originally Posted by pelago View Post
Finding the application description as displayed in Application Manager won't be straightforward. That comes from the list of packages, which won't match one-to-one with the .desktop launcher icons.
What about the Comment -field in the desktop file?
In most cases there is a gettext msgid in it, like for the browser it is: weba_ap_web_browser_thumb. I've been searching the correct bindtextdomain for it for ages.

So if someone knows what it is and where the .mo -file is located would be most helpful. I thought it was maemo-af-desktop but it wasn't.
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#36
HI rooster13,

I do use maemo-af-desktop in my application search widget to
read the application comment, as long as there isn't a
X-Text-Domain
entry in the .desktop file.
If there is a X-Text-Domain entry in the desktop file, I use this
as the domain name with dgettext.
hope this helps.

Nicolai
 

The Following User Says Thank You to nicolai For This Useful Post:
rooster13's Avatar
Posts: 319 | Thanked: 221 times | Joined on Jan 2010 @ Finland
#37
Hi Nicolai,

I think I tried that approach but I have to check this out once more.
Maybe there was something wrong with my code.

Thank u for this. U don't happen to have small sample code for me to examine?
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#38
Sure, this is what I use in my app-search-widget
(feel free to look at the whole source code and steal
what you need :-))

Code:
#define DESKTOP_ENTRY_CONFIG_GROUP "Desktop Entry" 
#define TEXTDOMAIN_KEY "X-Text-Domain"
#define NAME_KEY "Name"
#define COMMENT_KEY "Comment"
static
gchar* 
_retrieve_app_comment(GKeyFile* key_file)
{
  if(g_key_file_has_key(key_file, DESKTOP_ENTRY_CONFIG_GROUP, TEXTDOMAIN_KEY, NULL) &&
     g_key_file_has_key(key_file, DESKTOP_ENTRY_CONFIG_GROUP, COMMENT_KEY, NULL))
  {
    gchar* text_domain = g_key_file_get_string(key_file, DESKTOP_ENTRY_CONFIG_GROUP, TEXTDOMAIN_KEY, NULL);
    gchar* app_comment_key = g_key_file_get_string(key_file, DESKTOP_ENTRY_CONFIG_GROUP, COMMENT_KEY, NULL);
    gchar* app_comment = g_strdup(dgettext(text_domain, app_comment_key));
    g_free(text_domain);
    if(g_strcmp0(app_comment, app_comment_key) == 0)
    {
      g_free(app_comment);
      app_comment = NULL;
    }
    g_free(app_comment_key);
    return app_comment;
  }
  else if(g_key_file_has_key(key_file, DESKTOP_ENTRY_CONFIG_GROUP, COMMENT_KEY, NULL))
  {
    gchar* app_comment = g_key_file_get_string(key_file, DESKTOP_ENTRY_CONFIG_GROUP, COMMENT_KEY, NULL);
    gchar* comment = g_strdup(dgettext(GETTEXT_PACKAGE, app_comment));
    g_free(app_comment);
    return comment;
  }
  return NULL;
}
You are using QT for your application, right?
I hope this helps anyway, feel free to ask if you have any
questions

Nicolai
 

The Following 3 Users Say Thank You to nicolai For This Useful Post:
rooster13's Avatar
Posts: 319 | Thanked: 221 times | Joined on Jan 2010 @ Finland
#39
Thanks Nicolai!

I will check that.
I am using Qt but am sure this piece of code will help.

One question I have is, where are the domains for gettext defined? The maemo-af-desktop etc.
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#40
Originally Posted by rooster13 View Post
One question I have is, where are the domains for gettext defined? The maemo-af-desktop etc.
I don't remember :-)
I found this one in some example code or in the maemo developer
guide.

Nicolai
 
Reply


 
Forum Jump


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