From be1e95281c398a5d1b1125d12acd22a941494438 Mon Sep 17 00:00:00 2001
From: Simon Werbeck <simon.werbeck@gmail.com>
Date: Sun, 29 Jun 2014 23:02:15 +0200
Subject: [PATCH] Support deprecating properties and their accessors

Now G_PARAM_DEPRECATED can be set for properties. In addition their
accessor methods will be marked as deprecated.
---
 codegen/valaccodebasemodule.vala | 4 ++++
 codegen/valagtypemodule.vala     | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index dae3334..00b12a8 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1514,6 +1514,10 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 			}
 		}
 
+		if (prop.get_attribute ("Deprecated") != null) {
+			function.modifiers |= CCodeModifiers.DEPRECATED;
+		}
+
 		if (prop.is_private_symbol () || (!acc.readable && !acc.writable) || acc.access == SymbolAccessibility.PRIVATE) {
 			function.modifiers |= CCodeModifiers.STATIC;
 		} else if (context.hide_internal && (prop.is_internal_symbol () || acc.access == SymbolAccessibility.INTERNAL)) {
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 02c5b6e..a95f73d 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1955,6 +1955,9 @@ public class Vala.GTypeModule : GErrorModule {
 				}
 			}
 		}
+		if (prop.get_attribute ("Deprecated") != null && context.require_glib_version (2, 25)) {
+			pflags = "%s%s".printf (pflags, " | G_PARAM_DEPRECATED");
+		}
 		cspec.add_argument (new CCodeConstant (pflags));
 
 		return cspec;
-- 
2.0.1

