summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-object.c
Commit message (Collapse)AuthorAgeFilesLines
...
* libnm-glib: add "pseudoproperties" for things like Client.GetDevicesDan Winship2012-02-031-0/+176
| | | | | | | Add generic handling for "properties" that consist of a "Get" method, an "Added" signal, and a "Removed" signal, reusing some of the code for handling object-array-valued properties. And load the values of pseudo properties from _nm_object_reload/ensure_properties as well.
* libnm-glib: simplify handling of object and object array propertiesDan Winship2012-02-031-12/+244
| | | | | | | | | | | | Add an "object_type" field to NMPropertiesInfo, and use that with DBUS_TYPE_G_OBJECT_PATH and DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH properties so that we don't need custom marshallers for each one. When creating an NMDevice or NMActiveConnection, we need to fetch an extra property first to figure out the exact subclass to use, so add a bit of infrastructure for that as well. Also, do that preprocessing asynchronously when processing a property change notification, so that it doesn't block the main loop.
* libnm-glib: simplify property getter methodsDan Winship2012-02-031-174/+58
| | | | | | | | | | | | | | Rather than having every property getter method have code to fetch that specific property's value, just call the new _nm_object_ensure_inited() (which makes sure that we've read all the property values on the object at least once), and then return the cached value. (After we've read the initial property values, the PropertiesChanged signal handler will ensure that the values are kept up to date, so we can always just return cached property values after that point.) This then lets us get rid of _nm_object_get_property() and its wrappers.
* libnm-glib: simplify and genericize property declarationDan Winship2012-02-031-74/+85
| | | | | | | | | | | | | | | Rename _nm_object_handle_properties_changed(), etc, to be about properties in general, rather than just property changes. Interpret func==NULL in NMPropertiesInfo as meaning "use _nm_object_demarshal_generic", and then reorder the fields so that you can just leave that field out in the declarations when it's NULL. Add a way to register properties that exist in D-Bus but aren't tracked by the NMObjects, and use that for NMDevice's D-Bus Ip4Address property, replacing the existing hack. Also add a few other missing properties noticed along the way.
* core: fix deprecated usage of g_value_[get|set]_char() (bgo #662694)Dan Williams2011-10-281-12/+13
|
* libnm-glib: allow to constuct NMObject with NULL busTomeu Vizoso2011-08-161-1/+5
|
* libnm-glib: warn early if an object is tried to be instantiated without a pathTomeu Vizoso2011-08-161-2/+2
|
* libnm-glib: handle NULL object paths genericallyDan Williams2011-05-261-5/+26
| | | | | | | Since D-Bus doesn't allow NULL or zero-length object paths, NM uses "/" as a placeholder here. Make sure the generic marshalling code handles that so we don't have to do it in multiple places and simplify handling of NULL objects somewhat.
* build: use -Wundef and fix up cases where stuff wasn't defined (bgo #647157)Dan Williams2011-04-141-0/+1
|
* libnm-glib: allow manual processing of properties changed eventsDan Williams2011-02-161-1/+7
| | | | Mostly for handling the GetAll response.
* libnm-glib: add GError parameter to _nm_object_get_... functionsJiří Klimeš2011-02-151-33/+45
| | | | | It allows us to get the error back and have control over printing the error.
* introspection: add GObject introspection support (bgo #637032)Giovanni Campagna2011-01-211-1/+1
| | | | | | | Add the necessary annotations (the mininum required, that is those on return values. NULL parameters or container types may require more), and the Autotools stuff to get a NetworkManager GIR for libnm-util and a NMClient for libnm-glib.
* libnm-glib: call D-Bus with a timeout when Set()ting propertiesJiří Klimeš2010-10-151-6/+11
| | | | | The caller needs to be authenticated, so wait a bit to be sure it didn't quit too quickly.
* libnm-glib: fix invalid memory access during property notificationDan Williams2010-06-301-7/+12
| | | | | | | | | | | | | If an NMObject listened to property change notifications from other NMObjects and then in response to that queued up other property changes of it's own, those would get added to the property change list that was being iterated through already. Each name in the change list is freed after being notified, but the change list itself is actually freed when all properties have been notified. So an object that queues up another change notification ends up in _nm_object_queue_notify() which iterates the change list where half of the data elements are already freed...
* libnm-glib: tighter warning print checksDan Williams2009-10-201-1/+1
| | | | | | Should be checking for dbus-glib errors of the right type, instead of any error code (dbus-glib or not) that happens to be 4.
* libnm-glib: warning cleanupsDan Williams2009-10-201-9/+22
|
* 2008-11-14 Dan Williams <dcbw@redhat.com>Dan Williams2008-11-141-1/+22
| | | | | | | | Relicense libnm-glib to LGPLv2+ with agreement from contributors git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* Rename private nm_* functions to _nm_*Michael Biebl2008-08-261-23/+23
| | | | git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4012 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-08-12 Tambet Ingo <tambet@gmail.com>Tambet Ingo2008-08-121-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | Start documenting libnm-glib public API using gtk-doc. * libnm-glib/nm-serial-device.c: * libnm-glib/nm-object.c: * libnm-glib/nm-gsm-device.c: * libnm-glib/nm-device.c: * libnm-glib/nm-device-wifi.c: * libnm-glib/nm-device-ethernet.c: * libnm-glib/nm-client.c: * libnm-glib/nm-cdma-device.c: Document the public API. * docs/libnm-glib/libnm-glib.types: Implement. * docs/libnm-glib/Makefile.am: Implement. * autogen.sh: * configure.in: * Makefile.am: Add gtk-doc support. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3932 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* Quiet warning about unhandled property for nowDan Williams2008-07-281-2/+4
| | | | git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3867 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-03-27 Dan Williams <dcbw@redhat.com>Dan Williams2008-03-271-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nm-object.c - (nm_object_queue_notify): don't notify multiple times for the same property * nm-object-private.h - (handle_ptr_array_return): return NULL if the given array is NULL or if it has zero elements * nm-ip4-config.c - (finalize): use g_ptr_array_foreach() when freeing domains - (nm_ip4_config_get_domains): use handle_ptr_array_return() * nm-active-connection.c - (nm_active_connection_get_devices): use handle_ptr_array_return() * nm-device-802-11-wireless.c nm-device-802-11-wireless.h - (nm_device_802_11_wireless_get_access_points): return const; use handle_ptr_array_return() * nm-types.c - (nm_object_array_demarshal): always create an array, even of length zero, to distinguish between "NM returned no items" and "haven't asked NM yet" * nm-client.c - (dispose): free active connections too - (proxy_name_owner_changed): free active connections too when NM goes away - (nm_client_get_devices): return const; use handle_ptr_array_return() - (nm_client_get_active_connections): use handle_ptr_array_return() git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3506 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-03-25 Dan Williams <dcbw@redhat.com>Dan Williams2008-03-251-3/+47
| | | | | | | | | | | | * libnm-glib/nm-object.c libnm-glib/nm-object-private.h - (nm_object_queue_notify): add helper to batch & postpone GObject notify signals to an idle handler - (nm_object_get_property): add a timeout to the D-Bus method call git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3501 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2008-03-24 Dan Williams <dcbw@redhat.com>Dan Williams2008-03-241-24/+148
| | | | | | | | | | | | | | | | | Massive fixup of libnm-glib to: a) have all objects (with the exception of VPN) cache their properties and update them asynchronously on PropertiesChanged signals from NM b) return internal const data for most attributes/properties instead of allocated values that the caller must free c) cache wrapped objects such that a given D-Bus path will always map to the same GObject returned by libnm-glib d) remove a few signals and move them to GObject property notifications e) match recent NM D-Bus API changes for activation/deactivation f) remove some private functions from libnm-glib headers git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3491 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2007-12-07 Dan Williams <dcbw@redhat.com>Dan Williams2007-12-071-1/+3
| | | | | | | | | | | Noticed by Christian Persch <chpe@gnome.org> Always chain up to parent object in dispose and finalize handlers. (gnome.org #433112) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3154 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2007-11-26 Dan Williams <dcbw@redhat.com>Dan Williams2007-11-261-1/+1
| | | | | | | | * Fix warnings so everything compiles with --enable-more-warnings git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3108 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* More descriptive error messageDan Williams2007-10-291-1/+5
| | | | git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3052 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2007-10-12 Tambet Ingo <tambet@gmail.com>Tambet Ingo2007-10-121-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | Rework the "properties-changed" signal listening implementation. Add a generic implementation to NMObject class that listens for the signal and calls property setters of the target NMObject. * libnm-glib/nm-object.c (nm_object_handle_properties_changed): * Implement. * libnm-glib/nm-device-802-11-wireless.c: Move the GObject * consturction code to the end of file so that all the static functions are available without extra declarations. Remove the "properties-changed" signal handling and use the framework from NMObject. Implement property setters for properties that change with "properties-changed" signal. * libnm-glib/nm-access-point.c: Ditto. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2972 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2007-09-06 Dan Williams <dcbw@redhat.com>Dan Williams2007-09-061-7/+22
| | | | | | | | | | | | | | | * libnm-glib/nm-object.c - (nm_object_get_string_property, nm_object_get_object_path_property, nm_object_get_int_property, nm_object_get_uint_property, nm_object_get_boolean_property, nm_object_get_byte_property, nm_object_get_double_property, nm_object_get_byte_array_property): clear GValues after copying their contents, fixes memory leaks after every property access because dbus-glib copies the values from the DBusMessage into the GValue already. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2767 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* Fix some warnings and other errorsDan Williams2007-08-301-3/+3
| | | | git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2755 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2007-08-09 Tambet Ingo <tambet@gmail.com>Tambet Ingo2007-08-091-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Based on patch by Helmut Schaa <hschaa@suse.de>] * libnm-glib/nm-client.h: * libnm-glib/nm-object.h: * libnm-glib/nm-vpn-connection.h: * libnm-glib/nm-settings.h: * libnm-glib/nm-device.h: * libnm-glib/nm-ip4-config.h: * libnm-glib/nm-access-point.h: * libnm-glib/nm-device-802-3-ethernet.h: * libnm-util/nm-setting.h: * libnm-util/nm-connection.h: Add G_BEGIN_DECLS / G_END_DECLS to * support C++. * libnm-glib/nm-object.c (nm_object_get_byte_property): * Implement. * libnm-glib/nm-access-point.c: Strength has type char. * gnome/vpn-properties/Makefile.am: Remove * GNOME_DISABLE_DEPRECTATED for now to fix build. GnomeDruid is deprecated in recent libgnomeui. * introspection/nm-access-point.xml: Strength property is char, * not int. * src/NetworkManagerAP.c (set_property): Set strength from char. (get_property): Handle hidden APs (with empty SSID). Get strength value from char. (nm_ap_class_init): Strength property has char type. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2659 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2007-06-27 Dan Williams <dcbw@redhat.com>Dan Williams2007-06-271-0/+24
| | | | | | | | | | * Make SSIDs GByteArrays everywhere * Rename "essid" -> "ssid" everywhere that's appropriate * Refcount activation_ap member of the 802.11 wireless device class git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2620 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 2007-06-27 Tambet Ingo <tambet@ximian.com>Tambet Ingo2007-06-271-0/+303
* libnm-glib/nm-object.[ch]: Add these to the SVN, oops. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2619 4912f4e0-d625-0410-9fb7-b9a5a253dbdc