rygel r557 - trunk/src/rygel
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r557 - trunk/src/rygel
- Date: Mon, 9 Feb 2009 22:29:11 +0000 (UTC)
Author: zeeshanak
Date: Mon Feb 9 22:29:10 2009
New Revision: 557
URL: http://svn.gnome.org/viewvc/rygel?rev=557&view=rev
Log:
Put SimpleAsyncResult in separate file.
Added:
trunk/src/rygel/rygel-simple-async-result.vala
Modified:
trunk/src/rygel/Makefile.am
trunk/src/rygel/rygel-media-container.vala
Modified: trunk/src/rygel/Makefile.am
==============================================================================
--- trunk/src/rygel/Makefile.am (original)
+++ trunk/src/rygel/Makefile.am Mon Feb 9 22:29:10 2009
@@ -62,6 +62,8 @@
rygel-media-object.h \
rygel-media-container.c \
rygel-media-container.h \
+ rygel-simple-async-result.c \
+ rygel-simple-async-result.h \
rygel-media-item.c \
rygel-media-item.h
@@ -110,6 +112,8 @@
rygel-media-object.h \
rygel-media-container.c \
rygel-media-container.h \
+ rygel-simple-async-result.c \
+ rygel-simple-async-result.h \
rygel-media-item.c \
rygel-media-item.h
@@ -143,6 +147,7 @@
rygel-plugin.vala \
rygel-media-object.vala \
rygel-media-container.vala \
+ rygel-simple-async-result.vala \
rygel-media-item.vala \
rygel-browse.vala \
rygel-didl-lite-writer.vala
Modified: trunk/src/rygel/rygel-media-container.vala
==============================================================================
--- trunk/src/rygel/rygel-media-container.vala (original)
+++ trunk/src/rygel/rygel-media-container.vala Mon Feb 9 22:29:10 2009
@@ -85,60 +85,3 @@
throws Error;
}
-/**
- * A simple implementation of GLib.AsyncResult, very similar to
- * GLib.SimpleAsyncResult that provides holders for a string, object and
- * error reference.
- */
-public class Rygel.SimpleAsyncResult : GLib.Object, GLib.AsyncResult {
- private Object source_object;
- private AsyncReadyCallback callback;
-
- public string str;
- public Object obj;
-
- public Error error;
-
- public SimpleAsyncResult (Object source_object,
- AsyncReadyCallback callback,
- Object? obj,
- string? str) {
- this.source_object = source_object;
- this.callback = callback;
-
- this.obj = obj;
- this.str = str;
- }
-
- public SimpleAsyncResult.from_error (Object source_object,
- AsyncReadyCallback callback,
- Error error) {
- this.source_object = source_object;
- this.callback = callback;
-
- this.error = error;
- }
-
- public unowned GLib.Object get_source_object () {
- return this.source_object;
- }
-
- public void* get_user_data () {
- return null;
- }
-
- public void complete () {
- this.callback (this.source_object, this);
- }
-
- public void complete_in_idle () {
- Idle.add_full (Priority.DEFAULT, idle_func);
- }
-
- private bool idle_func () {
- this.complete ();
-
- return false;
- }
-}
-
Added: trunk/src/rygel/rygel-simple-async-result.vala
==============================================================================
--- (empty file)
+++ trunk/src/rygel/rygel-simple-async-result.vala Mon Feb 9 22:29:10 2009
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2009 Zeeshan Ali <zeenix gmail com>.
+ *
+ * Author: Zeeshan Ali <zeenix gmail com>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * A simple implementation of GLib.AsyncResult, very similar to
+ * GLib.SimpleAsyncResult that provides holders for a string, object and
+ * error reference.
+ */
+public class Rygel.SimpleAsyncResult : GLib.Object, GLib.AsyncResult {
+ private Object source_object;
+ private AsyncReadyCallback callback;
+
+ public string str;
+ public Object obj;
+
+ public Error error;
+
+ public SimpleAsyncResult (Object source_object,
+ AsyncReadyCallback callback,
+ Object? obj,
+ string? str) {
+ this.source_object = source_object;
+ this.callback = callback;
+
+ this.obj = obj;
+ this.str = str;
+ }
+
+ public SimpleAsyncResult.from_error (Object source_object,
+ AsyncReadyCallback callback,
+ Error error) {
+ this.source_object = source_object;
+ this.callback = callback;
+
+ this.error = error;
+ }
+
+ public unowned GLib.Object get_source_object () {
+ return this.source_object;
+ }
+
+ public void* get_user_data () {
+ return null;
+ }
+
+ public void complete () {
+ this.callback (this.source_object, this);
+ }
+
+ public void complete_in_idle () {
+ Idle.add_full (Priority.DEFAULT, idle_func);
+ }
+
+ private bool idle_func () {
+ this.complete ();
+
+ return false;
+ }
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]