Merge pull request #82 from knocte/cleanup

Various small cleanups in generator and glib
This commit is contained in:
Bertrand Lorentz 2013-10-22 12:52:08 -07:00
commit bd9cde5e61
4 changed files with 3 additions and 4 deletions

View File

@ -160,7 +160,7 @@ namespace GtkSharp.Generation {
void GenerateCtors (StreamWriter sw)
{
// Native GObjects do not implement the *Implementor interfaces
sw.WriteLine ("\t\tGLib.Object implementor;", Name);
sw.WriteLine ("\t\tGLib.Object implementor;");
sw.WriteLine ();
if (!IsConsumeOnly) {

View File

@ -90,7 +90,7 @@ namespace GtkSharp.Generation {
}
Parameters parms = Parameters;
is_get = ((((parms.IsAccessor && retval.IsVoid) || (parms.Count == 0 && !retval.IsVoid)) || (parms.Count == 0 && !retval.IsVoid)) && HasGetterName);
is_get = ((parms.IsAccessor && retval.IsVoid) || (parms.Count == 0 && !retval.IsVoid)) && HasGetterName;
is_set = ((parms.IsAccessor || (parms.VisibleCount == 1 && retval.IsVoid)) && HasSetterName);
call = "(" + (IsStatic ? "" : container_type.CallByName () + (parms.Count > 0 ? ", " : "")) + Body.GetCallString (is_set) + ")";

View File

@ -87,7 +87,7 @@ namespace GtkSharp.Generation {
public string DefaultValue {
get {
if (default_value != null && default_value.Length > 0)
if (!String.IsNullOrEmpty (default_value))
return default_value;
if (IGen == null)
return String.Empty;

View File

@ -552,7 +552,6 @@ namespace GLib {
internal void Update (object val)
{
Type t = GType.LookupType (type);
if (GType.Is (type, GType.Boxed) && !(val is IWrapper)) {
MethodInfo mi = val.GetType ().GetMethod ("Update", BindingFlags.NonPublic | BindingFlags.Instance);
IntPtr boxed_ptr = g_value_get_boxed (ref this);