Commit 33f7d056 authored by Philip Withnall's avatar Philip Withnall
Browse files

eds: Nullability fixes

With the EDS annotation fixes in
https://bugzilla.gnome.org/show_bug.cgi?id=667388, this fixes all of the
nullability problems found by compiling with --enable-experimental-non-null.

As mentioned in the previous commit, we can’t use
--enable-experimental-non-null by default yet, but the fixes should work by
themselves.
parent d3385bae
This diff is collapsed.
This diff is collapsed.
......@@ -57,11 +57,15 @@ internal class Edsf.MemoryIcon : Object, Icon, LoadableIcon
* @return `true` if the instances are equal, `false` otherwise
* @since 0.6.0
*/
#if VALA_0_16
public bool equal (Icon? icon2)
#else
public bool equal (Icon icon2)
#endif
{
// This type check be taken care of by the interface wrapper.
var icon = icon2 as MemoryIcon;
assert (icon != null);
/* These type and nullability checks are taken care of by the interface
* wrapper. */
var icon = (MemoryIcon) (!) icon2;
return (this._image_data.length == icon._image_data.length &&
Memory.cmp (this._image_data, icon._image_data,
......@@ -87,7 +91,7 @@ internal class Edsf.MemoryIcon : Object, Icon, LoadableIcon
*
* Basically, this is just a nul-safe version of g_str_hash(). Which is
* calculated over both the image type and image data. */
uint hash = this._image_type != null ? this._image_type.hash () : 0;
uint hash = this._image_type != null ? ((!) this._image_type).hash () : 0;
for (uint i = 0; i < this._image_data.length; i++)
{
......
......@@ -619,7 +619,8 @@ public abstract class Folks.PersonaStore : Object
* return value is purely for convenience, since it can be complicated to
* correlate the provided details with the final Persona.
*
* If the store is offline, this function will throw
* If the store is offline (or {@link PersonaStore.prepare()} hasn't yet been
* called successfully), this function will throw
* {@link PersonaStoreError.STORE_OFFLINE}. It's the responsibility of the
* caller to cache details and re-try this function if it wishes to make
* offline adds work.
......@@ -651,6 +652,12 @@ public abstract class Folks.PersonaStore : Object
* will be signalled through emission of
* {@link PersonaStore.personas_changed}.
*
* If the store is offline (or {@link PersonaStore.prepare()} hasn't yet been
* called successfully), this function will throw
* {@link PersonaStoreError.STORE_OFFLINE}. It's the responsibility of the
* caller to cache details and re-try this function if it wishes to make
* offline removals work.
*
* @param persona the {@link Persona} to remove
* @since 0.1.11
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment