[gnome-builder] clang: use ide_file_new()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] clang: use ide_file_new()
- Date: Sat, 13 Jan 2018 12:08:04 +0000 (UTC)
commit a34d5b3052ab77edd299d93b4b92a43957a010b9
Author: Christian Hergert <chergert redhat com>
Date: Sat Jan 13 03:38:07 2018 -0800
clang: use ide_file_new()
src/plugins/clang/ide-clang-translation-unit.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/plugins/clang/ide-clang-translation-unit.c b/src/plugins/clang/ide-clang-translation-unit.c
index 8b5290ca5..40df7ee1f 100644
--- a/src/plugins/clang/ide-clang-translation-unit.c
+++ b/src/plugins/clang/ide-clang-translation-unit.c
@@ -882,8 +882,6 @@ ide_clang_translation_unit_lookup_symbol (IdeClangTranslationUnit *self,
CXCursor cursor;
CXFile cxfile;
IdeSymbol *ret = NULL;
- IdeFile *file;
- GFile *gfile;
guint line;
guint line_offset;
@@ -944,18 +942,14 @@ ide_clang_translation_unit_lookup_symbol (IdeClangTranslationUnit *self,
if (path != NULL)
{
+ g_autoptr(IdeFile) file = NULL;
+ g_autoptr(GFile) gfile = NULL;
+
gfile = g_file_new_for_path (path);
- file = g_object_new (IDE_TYPE_FILE,
- "context", context,
- "file", gfile,
- "path", path,
- NULL);
+ file = ide_file_new (context, gfile);
g_clear_pointer (&definition, ide_symbol_unref);
declaration = ide_source_location_new (file, 0, 0, 0);
-
- g_clear_object (&file);
- g_clear_object (&gfile);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]