1. 15 Apr, 2014 2 commits
    • Allison Karlitskaya's avatar
      gdesktopappinfo: fix a crasher · afaee8dc
      Allison Karlitskaya authored
      During the time that we are expanding the strv, it is not
      null-terminated.  Use the strv_len variable instead to bound the search
      for duplicates.
      afaee8dc
    • Allison Karlitskaya's avatar
      GDesktopAppInfo: rewrite content type code · 6fd5a8cd
      Allison Karlitskaya authored
      Redo the code for type-based selection of applications (all,
      recommended, default, fallback) based on the new DesktopFileDir
      structures that we introduced last cycle.
      
      At the same time, we expand the functionality to add support for the new
      features of the specification:
      
       - moving ~/.local/share/applications/mimeapps.list to ~/.config/
      
       - per-desktop default applications (via XDG_CURRENT_DESKTOP)
      
       - sysadmin customisation of defaults (via /etc/xdg/mimeapps.list)
      
       - deprecation of the old defaults.list, favouring the use of
         /usr/share/applications/mimeapps.list (or gnome-mimeapps.list) to
         accomplish the same
      
      We modify the mimeapps testcase to check for mimeapps.list having been
      created in XDG_CONFIG_HOME instead of XDG_DATA_HOME.
      
      The modification is a net reduction of code (due to less duplication in
      bookkeeping).  It is also an increase in performance and reduction in
      memory consumption (due to simplified data structures).  Finally, it
      removes the stat-based timestamp checking in favour of the
      GFileMonitor-based approach that was already being used in the
      implementation of DesktopFileDir (in order to know if we had to rescan
      the desktop files themselves).
      
      https://bugzilla.gnome.org/show_bug.cgi?id=728040
      6fd5a8cd
  2. 12 Apr, 2014 3 commits
    • Colin Walters's avatar
      gdesktopappinfo: Don't double free sn_id · 2d965038
      Colin Walters authored
      Not sure why mclasen added a g_free() in that path, it was just wrong.
      We free it correctly later.
      2d965038
    • Colin Walters's avatar
      gdesktopappinfo: Initialize sn_id to NULL · af1772b6
      Colin Walters authored
      Otherwise we'll be freeing a random stack pointer.
      af1772b6
    • Matthias Clasen's avatar
      Deal with startup notify id being NULL · 94e5dafb
      Matthias Clasen authored
      The app launch context may just not support startup notification,
      in which case, g_app_launch_context_get_startup_notify_id() will
      return NULL.
      
      Failure to take this into account leads to criticals like this:
      gnome-session[8489]: GLib-CRITICAL: g_variant_new_take_string: assertion 'string != NULL' failed
      gnome-session[8489]: GLib-CRITICAL: g_variant_new_variant: assertion 'value != NULL' failed
      gnome-session[8489]: GLib-CRITICAL: g_variant_get_type: assertion 'value != NULL' failed
      gnome-session[8489]: GLib-CRITICAL: g_variant_type_is_subtype_of: assertion 'g_variant_type_check (type)' failed
      
      https://bugzilla.gnome.org/show_bug.cgi?id=728066
      94e5dafb
  3. 03 Mar, 2014 1 commit
  4. 20 Feb, 2014 1 commit
  5. 09 Feb, 2014 1 commit
    • Matthias Clasen's avatar
      Docs: Drop entities, switch away from sgml mode · 35066ed6
      Matthias Clasen authored
      Since all element markup is now gone from the doc comments,
      we can turn off the gtk-doc sgml mode, which means that from
      now on, docbook markup is no longer allowed in doc comments.
      
      To make this possible, we have to replace all remaining
      entities in doc comments by their replacement text, & -> &
      and so on.
      35066ed6
  6. 06 Feb, 2014 4 commits
  7. 31 Jan, 2014 1 commit
  8. 13 Jan, 2014 1 commit
  9. 11 Dec, 2013 1 commit
    • Martin Pitt's avatar
      gdesktopappinfo: Add missing annotations · e6c86d58
      Martin Pitt authored
      Add missing (allow-none) annotations to
      g_desktop_app_info_launch_uris_as_manager(). Tested with
      
        python -c "from gi.repository import GLib, Gio; Gio.DesktopAppInfo.new('gcalctool.desktop').launch_uris_as_manager([], None, GLib.SpawnFlags.SEARCH_PATH|GLib.SpawnFlags.STDOUT_TO_DEV_NULL, None, None, None, None)"
      
      which is necessary to do a launch_uris() without leaking stdout.
      
      https://launchpad.net/bugs/1259721
      e6c86d58
  10. 13 Nov, 2013 1 commit
  11. 07 Nov, 2013 1 commit
    • Allison Karlitskaya's avatar
      Add g_desktop_app_info_search() · 3d32d535
      Allison Karlitskaya authored
      The first time this function is called we load all of the keyfiles in
      the directory, ignoring the 'Hidden' ones and build an index out of the
      interesting fields using g_str_tokenize_and_fold().
      
      We do prefix matching on the tokens to find relevent desktop files.
      
      Right now this is implemented as a hashtable that we iterate over,
      checking prefixes on each token.  This could possibly be sped up by
      creating an array, but it's already pretty fast...
      
      https://bugzilla.gnome.org/show_bug.cgi?id=711557
      3d32d535
  12. 06 Nov, 2013 2 commits
    • Allison Karlitskaya's avatar
      Add GAppInfoMonitor · e55d33ed
      Allison Karlitskaya authored
      This is a simple object that emits a "change" signal when the installed
      applications may have changed in some way.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=711556
      e55d33ed
    • Allison Karlitskaya's avatar
      gdesktopappinfo: keep a list of files in the dirs · 86ce3bf4
      Allison Karlitskaya authored
      In each DesktopFileDir, store a list of desktop files for that
      directory.  This speeds up opening desktop files by name because we can
      skip statting in directories that we know don't have the file and also
      speeds up _get_all() because we can avoid enumeration.
      
      This also improves our support for dealing with names like
      'kde4/kate.desktop' (equivalent to kde4-kate.desktop) since we find out
      about all of these files are the start and don't need to guess about
      which '-' to change to a '/'.  It also means that we can easily deal
      with more than one level of such prefixes.
      
      We use a file monitor to watch for changes, invalidating our lists when
      we notice them.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=711520
      86ce3bf4
  13. 04 Oct, 2013 1 commit
  14. 03 Oct, 2013 4 commits
  15. 27 Sep, 2013 1 commit
  16. 30 Jul, 2013 1 commit
  17. 11 Jul, 2013 2 commits
    • Allison Karlitskaya's avatar
      GDesktopAppInfo: remove note about OnlyShowIn · 9ec8ab62
      Allison Karlitskaya authored
      A previous version of the patch had OnlyShowIn support for desktop file
      actions.  This was removed from the spec and the patch rewritten, but
      this bit of documentation slipped through.  Remove it.
      9ec8ab62
    • Allison Karlitskaya's avatar
      Implement the Desktop Action specification · 6dc5c118
      Allison Karlitskaya authored
      For some time, the desktop file specification has supported "additional
      application actions".  This is intended to allow for additional methods
      of starting an app, such as a mail client having a "Compose New Message"
      action that brings up the compose window instead of the folder list.
      
      This patch adds support for this with a relatively minimal API.
      
      In the case that the application is a GApplication and DBusActivatable,
      desktop actions are translated into GActions that have been added to the
      application with g_action_map_add_action().  This more or less closes
      the loop on being able to activate an application with an action
      invocation (instead of 'activate').
      
      https://bugzilla.gnome.org/show_bug.cgi?id=664444
      6dc5c118
  18. 07 Jun, 2013 1 commit
  19. 01 May, 2013 1 commit
  20. 21 Apr, 2013 1 commit
  21. 04 Mar, 2013 1 commit
  22. 29 Jan, 2013 1 commit
    • Colin Walters's avatar
      Add g_close(), use it · f398bec5
      Colin Walters authored
      There are two benefits to this:
      
      1) We can centralize any operating system specific knowledge of
         close-vs-EINTR handling.  For example, while on Linux we should never
         retry, if someone cared enough later about HP-UX, they could come by
         and change this one spot.
      2) For places that do care about the return value and want to provide
         the caller with a GError, this function makes it convenient to do so.
      
      Note that gspawn.c had an incorrect EINTR loop-retry around close().
      
      https://bugzilla.gnome.org/show_bug.cgi?id=682819
      f398bec5
  23. 22 Nov, 2012 2 commits
  24. 23 Sep, 2012 1 commit
  25. 03 Sep, 2012 1 commit
  26. 10 Jul, 2012 1 commit
    • Colin Walters's avatar
      Add g_spawn_check_exit_status() · f7abd3ce
      Colin Walters authored
      Many (if not "almost all") programs that spawn other programs via
      g_spawn_sync() or the like simply want to check whether or not the
      child exited successfully, but doing so requires use of
      platform-specific functionality and there's actually a fair amount of
      boilerplate involved.
      
      This new API will help drain a *lot* of mostly duplicated code in
      GNOME, from gnome-session to gdm.  And we can see that some bits even
      inside GLib were doing it wrong; for example checking the exit status
      on Unix, but ignoring it on Windows.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=679691
      f7abd3ce
  27. 28 Jun, 2012 2 commits
    • Alexander Larsson's avatar
      Fix the mimetype default fix · c35106fc
      Alexander Larsson authored
      We need to ignore the defaults.list item only when there
      was a mimetype handler found in a previous mimetype, not
      if one was found for the same mimetype as the one that
      is listed in defaults.list (same for the new-style defaults).
      c35106fc
    • Alexander Larsson's avatar
      Fix default app lookup wrt parent types and defaults.list · f14c0112
      Alexander Larsson authored
      There was an issue when looking up the default handler
      for a type where a supertype was listed in defaults.list.
      We would pick the default for the parent type even if
      there was a handler for the more specific type.
      
      In the case of the new-style defaults marking (
      "Default Applications" in mimeapps.list) we were already
      checking for a more specific handler befor using a default,
      but we also need to do a similar check for the defaults.list
      case.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=678944
      f14c0112