Skip to content
  • Debarshi Ray's avatar
    Make photos_base_item_download return a GFile instead of a path · e651e8d7
    Debarshi Ray authored
    It's prudent to standardize around GFile across the code because:
      * Being a reference counted object, it's cheaper to pass around. No
        need to allocate little memory buffers to copy strings around.
      * Supports both paths and URIs. Even though, in this particular case,
        it's always going to be a local path, that's not true for other
        areas of the code.
      * Encapsulates all GIO operations that can be performed on a file.
        Rarely, if ever, does the code directly use UNIX system calls or
        the C standard library to operate on files because of the need for
        asynchronous operations, support for cancellation, and nicer error
        handling.
    
    For all these reasons, the new codec API for GeglBuffer is also based
    around GFile.
    
    Exceptions when raw paths or URIs are useful:
      * Serializing and deserializing across D-Bus, databases, etc..
      * Logging error or debug messages.
      * Interacting with GIO-unfriendly APIs like Exiv2.
    
    #63
    e651e8d7