[gnome-builder/wip/project-selector] file: add internal getter for content-type
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/project-selector] file: add internal getter for content-type
- Date: Wed, 8 Apr 2015 02:24:45 +0000 (UTC)
commit e47a01baf368c280bdd59e3704c3467d381cd4cb
Author: Christian Hergert <christian hergert me>
Date: Tue Apr 7 19:23:19 2015 -0700
file: add internal getter for content-type
libide/ide-file.c | 11 +++++++++++
libide/ide-internal.h | 1 +
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-file.c b/libide/ide-file.c
index a58841b..7662b64 100644
--- a/libide/ide-file.c
+++ b/libide/ide-file.c
@@ -52,6 +52,17 @@ G_DEFINE_TYPE (IdeFile, ide_file, IDE_TYPE_OBJECT)
static GParamSpec *gParamSpecs [LAST_PROP];
+const gchar *
+_ide_file_get_content_type (IdeFile *self)
+{
+ g_return_val_if_fail (IDE_IS_FILE (self), NULL);
+
+ if (self->content_type != NULL)
+ return self->content_type;
+
+ return "text/plain";
+}
+
void
_ide_file_set_content_type (IdeFile *self,
const gchar *content_type)
diff --git a/libide/ide-internal.h b/libide/ide-internal.h
index 0d089b2..dce6f68 100644
--- a/libide/ide-internal.h
+++ b/libide/ide-internal.h
@@ -76,6 +76,7 @@ void _ide_diagnostician_add_provider (IdeDiagnostician *s
void _ide_diagnostician_remove_provider (IdeDiagnostician *self,
IdeDiagnosticProvider *provider);
IdeDiagnostics *_ide_diagnostics_new (GPtrArray *ar);
+const gchar *_ide_file_get_content_type (IdeFile *self);
GtkSourceFile *_ide_file_set_content_type (IdeFile *self,
const gchar *content_type);
GtkSourceFile *_ide_file_get_source_file (IdeFile *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]