* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Alexander Larsson <alexl@redhat.com>
*/
icon = G_FILE_ICON (object);
- g_object_unref (icon->file);
+ if (icon->file)
+ g_object_unref (icon->file);
G_OBJECT_CLASS (g_file_icon_parent_class)->finalize (object);
}
return icon;
}
+static GVariant *
+g_file_icon_serialize (GIcon *icon)
+{
+ GFileIcon *file_icon = G_FILE_ICON (icon);
+
+ return g_variant_new ("(sv)", "file", g_variant_new_take_string (g_file_get_uri (file_icon->file)));
+}
+
static void
g_file_icon_icon_iface_init (GIconIface *iface)
{
iface->equal = g_file_icon_equal;
iface->to_tokens = g_file_icon_to_tokens;
iface->from_tokens = g_file_icon_from_tokens;
+ iface->serialize = g_file_icon_serialize;
}
stream = g_file_read (file_icon->file,
cancellable,
error);
+
+ if (stream && type)
+ *type = NULL;
return G_INPUT_STREAM (stream);
}