diff --git a/moo/mooedit/mooedit.c b/moo/mooedit/mooedit.c index 6243fd72..cdad7868 100644 --- a/moo/mooedit/mooedit.c +++ b/moo/mooedit/mooedit.c @@ -579,6 +579,18 @@ moo_edit_get_encoding (MooEdit *edit) } +char* +moo_edit_get_uri (MooEdit *edit) +{ + g_return_val_if_fail (MOO_IS_EDIT (edit), NULL); + + if (edit->priv->filename) + return g_filename_to_uri (edit->priv->filename, NULL, NULL); + else + return NULL; +} + + static GtkTextBuffer* get_buffer (MooEdit *edit) { diff --git a/moo/mooedit/mooedit.h b/moo/mooedit/mooedit.h index 0e13c37f..17848242 100644 --- a/moo/mooedit/mooedit.h +++ b/moo/mooedit/mooedit.h @@ -116,6 +116,8 @@ const char *moo_edit_get_display_basename (MooEdit *edit); const char *moo_edit_get_encoding (MooEdit *edit); +char *moo_edit_get_uri (MooEdit *edit); + gboolean moo_edit_is_empty (MooEdit *edit); void moo_edit_set_modified (MooEdit *edit, gboolean modified);