Merge lp:~dobey/ubuntuone-client/slay-the-C-beast into lp:ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 1396
Merged at revision: 1396
Proposed branch: lp:~dobey/ubuntuone-client/slay-the-C-beast
Merge into: lp:ubuntuone-client
Diff against target: 8810 lines (+7/-8515)
48 files modified
Makefile.am (+1/-1)
autogen.sh (+1/-1)
configure.ac (+5/-52)
docs/Makefile.am (+0/-1)
docs/reference/Makefile.am (+0/-62)
docs/reference/libsyncdaemon-docs.sgml (+0/-48)
libsyncdaemon/Makefile.am (+0/-114)
libsyncdaemon/libsyncdaemon-1.0.pc.in (+0/-11)
libsyncdaemon/libsyncdaemon.h (+0/-50)
libsyncdaemon/syncdaemon-authentication.c (+0/-298)
libsyncdaemon/syncdaemon-authentication.h (+0/-75)
libsyncdaemon/syncdaemon-config-interface.c (+0/-276)
libsyncdaemon/syncdaemon-config-interface.h (+0/-83)
libsyncdaemon/syncdaemon-credentials.c (+0/-215)
libsyncdaemon/syncdaemon-credentials.h (+0/-75)
libsyncdaemon/syncdaemon-daemon.c (+0/-1477)
libsyncdaemon/syncdaemon-daemon.h (+0/-172)
libsyncdaemon/syncdaemon-events-interface.c (+0/-130)
libsyncdaemon/syncdaemon-events-interface.h (+0/-71)
libsyncdaemon/syncdaemon-file-info.c (+0/-236)
libsyncdaemon/syncdaemon-file-info.h (+0/-78)
libsyncdaemon/syncdaemon-filesystem-interface.c (+0/-190)
libsyncdaemon/syncdaemon-filesystem-interface.h (+0/-84)
libsyncdaemon/syncdaemon-folder-info.c (+0/-176)
libsyncdaemon/syncdaemon-folder-info.h (+0/-73)
libsyncdaemon/syncdaemon-folders-interface.c (+0/-494)
libsyncdaemon/syncdaemon-folders-interface.h (+0/-76)
libsyncdaemon/syncdaemon-interface.c (+0/-274)
libsyncdaemon/syncdaemon-interface.h (+0/-70)
libsyncdaemon/syncdaemon-marshal.list (+0/-5)
libsyncdaemon/syncdaemon-metadata.c (+0/-284)
libsyncdaemon/syncdaemon-metadata.h (+0/-79)
libsyncdaemon/syncdaemon-publicfiles-interface.c (+0/-259)
libsyncdaemon/syncdaemon-publicfiles-interface.h (+0/-73)
libsyncdaemon/syncdaemon-share-info.c (+0/-357)
libsyncdaemon/syncdaemon-share-info.h (+0/-91)
libsyncdaemon/syncdaemon-shares-interface.c (+0/-497)
libsyncdaemon/syncdaemon-shares-interface.h (+0/-79)
libsyncdaemon/syncdaemon-status-info.c (+0/-259)
libsyncdaemon/syncdaemon-status-info.h (+0/-80)
libsyncdaemon/syncdaemon-status-interface.c (+0/-448)
libsyncdaemon/syncdaemon-status-interface.h (+0/-71)
libsyncdaemon/syncdaemon-transfer-info.c (+0/-247)
libsyncdaemon/syncdaemon-transfer-info.h (+0/-78)
libsyncdaemon/test-libsyncdaemon.c (+0/-536)
libsyncdaemon/utils.c (+0/-60)
libsyncdaemon/utils.h (+0/-48)
po/POTFILES.in (+0/-1)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/slay-the-C-beast
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve
Mike McCracken (community) Approve
Review via email: mp+167631@code.launchpad.net

Commit message

Drop libsyncdaemon from the tree.

Description of the change

This branch removes libsyncdaemon and the necessary related parts from the tree and build. It doesn't move away from autotools yet, as that is a very large change, and would be best done in a branch after this.

To post a comment you must log in.
Revision history for this message
Mike McCracken (mikemc) :
review: Approve
Revision history for this message
Brian Curtin (brian.curtin) wrote :

Looks good.

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (3.3 KiB)

The attempt to merge lp:~dobey/ubuntuone-client/slay-the-C-beast into lp:ubuntuone-client failed. Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
  testing autoconf2.50... not found.
  testing autoconf... found 2.69
checking for automake >= 1.10...
  testing automake-1.12... not found.
  testing automake-1.11... found 1.11.6
checking for intltool >= 0.30...
  testing intltoolize... found 0.50.2
checking for pkg-config >= 0.14.0...
  testing pkg-config... found 0.26
Checking for required M4 macros...
Checking for forbidden M4 macros...
Processing ./configure.ac
Running intltoolize...
Running aclocal-1.11...
Running autoconf...
Running automake-1.11...
Running ./configure --enable-gtk-doc --enable-debug ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... yes
checking whether NLS is requested... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... none
checking for intltool >= 0.40.0... 0.50.2 found
checking for intltool-update... /usr/bin/intltool-update
checking for intltool-merge... /usr/bin/intltool-merge
checking for intltool-extract... /usr/bin/intltool-extract
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for perl... /usr/bin/perl
checking for perl >= 5.8.1... 5.14.2
checking for XML::Parser... ok
checking for lndir... /usr/bin/lndir
checking development series build... no
checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/dist-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
checking for ubuntu-sso-client... using system path
checking for ubuntuone-storage-protocol... using system path
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for DBUS... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating data/Makefile
config.status: creating po/Makefile.in
config.status: creating docs/Makefile
config.status: executing depfiles commands
config.status: executing po/stamp-it commands
Now type `make' to compile ubuntuone-client

configure.ac:8: installing `./install-sh'
configure.ac:8: installing `./missing'
conf...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.am'
2--- Makefile.am 2013-05-29 13:45:19 +0000
3+++ Makefile.am 2013-06-05 20:11:30 +0000
4@@ -1,4 +1,4 @@
5-SUBDIRS = data libsyncdaemon po docs
6+SUBDIRS = data po docs
7
8 # Shut libtoolize up
9 ACLOCAL_AMFLAGS = -I m4
10
11=== modified file 'autogen.sh'
12--- autogen.sh 2012-01-03 12:52:20 +0000
13+++ autogen.sh 2013-06-05 20:11:30 +0000
14@@ -17,5 +17,5 @@
15 echo "You need to install gnome-common from the GNOME source repository"
16 exit 1
17 }
18-
19+mkdir -p "$srcdir/m4"
20 USE_GNOME2_MACROS=1 . gnome-autogen.sh
21
22=== modified file 'configure.ac'
23--- configure.ac 2013-02-21 20:59:11 +0000
24+++ configure.ac 2013-06-05 20:11:30 +0000
25@@ -3,17 +3,16 @@
26
27 # We need to omit the trailing newline when catting the VERSION file
28 AC_INIT([ubuntuone-client], m4_esyscmd([cat VERSION | tr -d '\012']))
29-AC_CONFIG_SRCDIR([config.h.in])
30+AC_CONFIG_SRCDIR([VERSION])
31
32 AM_INIT_AUTOMAKE([1.10 foreign tar-ustar])
33-AM_CONFIG_HEADER([config.h])
34
35 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
36
37-AC_ISC_POSIX
38-AC_PROG_CC
39-AC_PROG_LIBTOOL
40-PKG_PROG_PKG_CONFIG([0.19])
41+# Workaround to make aclocal get the right flags
42+AC_CONFIG_MACRO_DIR([m4])
43+AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS} -I m4")
44+
45 IT_PROG_INTLTOOL([0.40.0])
46
47 GETTEXT_PACKAGE="${PACKAGE}"
48@@ -23,10 +22,6 @@
49 localedir='$(prefix)/$(DATADIRNAME)/locale'
50 AC_SUBST(localedir)
51
52-# Workaround to make aclocal get the right flags
53-AC_CONFIG_MACRO_DIR([m4])
54-AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS} -I m4")
55-
56 # Need lndir for builddir != srcdir builds, because Python is not sane
57 AC_PATH_PROG([LNDIR], [lndir], [])
58 if test "x$LNDIR" = "x"; then
59@@ -102,45 +97,6 @@
60 AC_SUBST(DBUS_CFLAGS)
61 AC_SUBST(DBUS_LIBS)
62
63-##################################################
64-# Check for gtk-doc.
65-##################################################
66-GTK_DOC_CHECK(1.0)
67-DISTCHECK_CONFIGURE_FLAGS="--enable-gtk-doc --enable-debug"
68-AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
69-
70-##################################################
71-# Check for introspection
72-##################################################
73-GOBJECT_INTROSPECTION_CHECK([0.6.4])
74-AC_MSG_CHECKING([if gobject-introspection requires new options])
75-$PKG_CONFIG --atleast-version=0.9.4 gobject-introspection-1.0
76-new_introspection=$?
77-if test "x$new_introspection" = "x0"; then
78- AC_MSG_RESULT([yes])
79-else
80- AC_MSG_RESULT([no])
81-fi
82-AM_CONDITIONAL([HAVE_NEW_INTROSPECTION], [test "x$new_introspection" = "x0"])
83-
84-# Fix up some junk from GIR
85-if test "x$found_introspection" = "xyes"; then
86- INTROSPECTION_GIRDIR_NAME="`basename ${INTROSPECTION_GIRDIR}`"
87- INTROSPECTION_TYPELIBDIR_NAME="`basename ${INTROSPECTION_TYPELIBDIR}`"
88- AC_SUBST(INTROSPECTION_GIRDIR_NAME)
89- AC_SUBST(INTROSPECTION_TYPELIBDIR_NAME)
90-fi
91-
92-dnl glib-genmarshal
93-AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
94-
95-LIBSYNCDAEMON_CURRENT=1
96-LIBSYNCDAEMON_REVISION=0
97-LIBSYNCDAEMON_AGE=0
98-AC_SUBST(LIBSYNCDAEMON_CURRENT)
99-AC_SUBST(LIBSYNCDAEMON_REVISION)
100-AC_SUBST(LIBSYNCDAEMON_AGE)
101-
102 dnl ---------------------------------------------------------------------------
103 dnl - Are we specifying a different dbus root ?
104 dnl ---------------------------------------------------------------------------
105@@ -169,11 +125,8 @@
106 AC_CONFIG_FILES([
107 Makefile
108 data/Makefile
109-libsyncdaemon/Makefile
110-libsyncdaemon/libsyncdaemon-1.0.pc
111 po/Makefile.in
112 docs/Makefile
113-docs/reference/Makefile
114 ])
115
116 if [[ -n "$(lsb_release -r | grep -v '1[2-9].[0-9][0-9]')" ]]; then
117
118=== modified file 'docs/Makefile.am'
119--- docs/Makefile.am 2012-03-13 16:53:57 +0000
120+++ docs/Makefile.am 2013-06-05 20:11:30 +0000
121@@ -1,4 +1,3 @@
122-SUBDIRS = reference
123
124 manfilesdir = $(mandir)/man1
125 manfiles_DATA = \
126
127=== removed directory 'docs/reference'
128=== removed file 'docs/reference/Makefile.am'
129--- docs/reference/Makefile.am 2010-10-19 15:38:45 +0000
130+++ docs/reference/Makefile.am 1970-01-01 00:00:00 +0000
131@@ -1,62 +0,0 @@
132-## Process this file with automake to produce Makefile.in
133-
134-# Dummy targets we need to make distcheck and check pass
135-test test-report perf-report full-report:
136- ## Ignore
137-
138-# automake requirements
139-AUTOMAKE_OPTIONS = 1.7
140-
141-# The name of the module
142-DOC_MODULE=libsyncdaemon
143-
144-# The top-level SGML file. You can change this if you want to.
145-DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
146-
147-# The directory containing the source code. Relative to $(srcdir).
148-DOC_SOURCE_DIR=../../libsyncdaemon
149-
150-# Extra options to pass to gtkdoc-scangobj. Not normally needed.
151-SCANGOBJ_OPTIONS=
152-
153-# Extra options to supply to gtkdoc-scan.
154-# Fx --rebuild-types --rebuild-sections
155-SCAN_OPTIONS=
156-
157-# Extra options to supply to gtkdoc-mkdb.
158-MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files=trio
159-
160-# Extra options to supply to gtkdoc-fixref. Not normally needed.
161-FIXXREF_OPTIONS=
162-
163-# Used for dependencies. The docs will be rebuilt if any of these change.
164-HFILE_GLOB=$(top_srcdir)/libsyncdaemon/syncdaemon-*.h
165-CFILE_GLOB=$(top_srcdir)/libsyncdaemon/syncdaemon-*.c
166-
167-# Header files to ignore when scanning.
168-IGNORE_HFILES= \
169- utils.h
170-
171-# Images to copy into HTML directory.
172-HTML_IMAGES=
173-
174-# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
175-content_files =
176-
177-# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
178-INCLUDES=-I$(top_srcdir)/libsyncdaemon \
179- $(DBUS_CFLAGS)
180-
181-GTKDOC_LIBS=$(DBUS_LIBS) \
182- $(top_builddir)/libsyncdaemon/libsyncdaemon-1.0.la
183-
184-# This includes the standard gtk-doc make rules, copied by gtkdocize.
185-include $(top_srcdir)/gtk-doc.make
186-
187-# Other files to distribute
188-# e.g. EXTRA_DIST += version.xml.in
189-EXTRA_DIST += \
190- libsyncdaemon.types \
191- libsyncdaemon-docs.sgml
192-# libsyncdaemon-sections.txt
193-
194
195=== removed file 'docs/reference/libsyncdaemon-docs.sgml'
196--- docs/reference/libsyncdaemon-docs.sgml 2010-10-19 13:28:23 +0000
197+++ docs/reference/libsyncdaemon-docs.sgml 1970-01-01 00:00:00 +0000
198@@ -1,48 +0,0 @@
199-<?xml version="1.0"?>
200-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
201- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
202-[
203- <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
204-]>
205-<book id="index">
206- <bookinfo>
207- <title>libsyncdaemon Reference Manual</title>
208- <releaseinfo>
209- for libsyncdaemon [VERSION].
210- The latest version of this documentation can be found on-line at
211- <ulink role="online-location" url="http://[SERVER]/libsyncdaemon/index.html">http://[SERVER]/libsyncdaemon/</ulink>.
212- </releaseinfo>
213- </bookinfo>
214-
215- <chapter>
216- <title>[Insert title here]</title>
217- <xi:include href="xml/syncdaemon-metadata.xml"/>
218- <xi:include href="xml/syncdaemon-events-interface.xml"/>
219- <xi:include href="xml/syncdaemon-file-info.xml"/>
220- <xi:include href="xml/syncdaemon-transfer-info.xml"/>
221- <xi:include href="xml/syncdaemon-share-info.xml"/>
222- <xi:include href="xml/syncdaemon-filesystem-interface.xml"/>
223- <xi:include href="xml/syncdaemon-status-interface.xml"/>
224- <xi:include href="xml/syncdaemon-config-interface.xml"/>
225- <xi:include href="xml/syncdaemon-publicfiles-interface.xml"/>
226- <xi:include href="xml/syncdaemon-authentication.xml"/>
227- <xi:include href="xml/syncdaemon-shares-interface.xml"/>
228- <xi:include href="xml/syncdaemon-credentials.xml"/>
229- <xi:include href="xml/syncdaemon-folders-interface.xml"/>
230- <xi:include href="xml/syncdaemon-daemon.xml"/>
231- <xi:include href="xml/syncdaemon-interface.xml"/>
232- <xi:include href="xml/syncdaemon-folder-info.xml"/>
233- <xi:include href="xml/syncdaemon-status-info.xml"/>
234-
235- </chapter>
236- <chapter id="object-tree">
237- <title>Object Hierarchy</title>
238- <xi:include href="xml/tree_index.sgml"/>
239- </chapter>
240- <index id="api-index-full">
241- <title>API Index</title>
242- <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
243- </index>
244-
245- <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
246-</book>
247
248=== removed directory 'libsyncdaemon'
249=== removed file 'libsyncdaemon/Makefile.am'
250--- libsyncdaemon/Makefile.am 2012-09-17 19:18:24 +0000
251+++ libsyncdaemon/Makefile.am 1970-01-01 00:00:00 +0000
252@@ -1,114 +0,0 @@
253-CLEANFILES = $(NULL)
254-
255-lib_LTLIBRARIES = libsyncdaemon-1.0.la
256-
257-noinst_PROGRAMS = test-libsyncdaemon
258-
259-INCLUDES = \
260- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
261- -I$(top_srcdir) \
262- $(DBUS_CFLAGS)
263-
264-# Marshallers
265-MARSHAL_GENERATED = syncdaemon-marshal.c syncdaemon-marshal.h
266-
267-syncdaemon-marshal.h: syncdaemon-marshal.list $(GLIB_GENMARSHAL)
268- $(GLIB_GENMARSHAL) $< --header --prefix=_syncdaemon_marshal > $@
269-
270-syncdaemon-marshal.c: syncdaemon-marshal.list $(GLIB_GENMARSHAL) syncdaemon-marshal.h
271- $(GLIB_GENMARSHAL) $< --body --prefix=_syncdaemon_marshal > $@
272-
273-syncdaemonincludedir = $(includedir)/libsyncdaemon-1.0/libsyncdaemon
274-syncdaemoninclude_HEADERS = \
275- libsyncdaemon.h \
276- syncdaemon-authentication.h \
277- syncdaemon-daemon.h \
278- syncdaemon-config-interface.h \
279- syncdaemon-credentials.h \
280- syncdaemon-events-interface.h \
281- syncdaemon-file-info.h \
282- syncdaemon-filesystem-interface.h \
283- syncdaemon-folder-info.h \
284- syncdaemon-folders-interface.h \
285- syncdaemon-metadata.h \
286- syncdaemon-publicfiles-interface.h \
287- syncdaemon-share-info.h \
288- syncdaemon-shares-interface.h \
289- syncdaemon-status-info.h \
290- syncdaemon-status-interface.h \
291- syncdaemon-transfer-info.h \
292- syncdaemon-interface.h
293-
294-libsyncdaemon_1_0_la_SOURCES = \
295- syncdaemon-marshal.c \
296- syncdaemon-authentication.c \
297- syncdaemon-daemon.c \
298- syncdaemon-config-interface.c \
299- syncdaemon-credentials.c \
300- syncdaemon-events-interface.c \
301- syncdaemon-file-info.c \
302- syncdaemon-filesystem-interface.c \
303- syncdaemon-folder-info.c \
304- syncdaemon-folders-interface.c \
305- syncdaemon-metadata.c \
306- syncdaemon-publicfiles-interface.c \
307- syncdaemon-share-info.c \
308- syncdaemon-shares-interface.c \
309- syncdaemon-status-info.c \
310- syncdaemon-status-interface.c \
311- syncdaemon-transfer-info.c \
312- syncdaemon-interface.c \
313- utils.c
314-
315-libsyncdaemon_1_0_la_LIBADD = \
316- $(DBUS_LIBS)
317-libsyncdaemon_1_0_la_LDFLAGS = -version-info $(LIBSYNCDAEMON_CURRENT):$(LIBSYNCDAEMON_REVISION):$(LIBSYNCDAEMON_AGE)
318-
319-test_libsyncdaemon_SOURCES = test-libsyncdaemon.c
320-test_libsyncdaemon_LDADD = libsyncdaemon-1.0.la $(DBUS_LIBS)
321-
322-pkgconfigdir = $(libdir)/pkgconfig
323-pkgconfig_DATA = libsyncdaemon-1.0.pc
324-
325-MAINTAINERCLEANFILES = \
326- Makefile.in \
327- $(MARSHAL_GENERATED)
328-
329-EXTRA_DIST = \
330- syncdaemon-marshal.list \
331- utils.h \
332- $(MARSHAL_GENERATED)
333-
334--include $(INTROSPECTION_MAKEFILE)
335-INTROSPECTION_GIRS =
336-INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
337-INTROSPECTION_SCANNER_ARGS = \
338- --add-include-path=$(srcdir) \
339- --c-include="libsyncdaemon/libsyncdaemon.h"
340-
341-if HAVE_NEW_INTROSPECTION
342-INTROSPECTION_SCANNER_ARGS += --identifier-prefix=Syncdaemon --warn-all
343-endif
344-
345-if HAVE_INTROSPECTION
346-introspection_files = \
347- $(syncdaemoninclude_HEADERS) \
348- $(shell ls syncdaemon*.[ch])
349-Syncdaemon-1.0.gir: libsyncdaemon-1.0.la Makefile
350-Syncdaemon_1_0_gir_NAMESPACE = Syncdaemon
351-Syncdaemon_1_0_gir_INCLUDES = GObject-2.0
352-Syncdaemon_1_0_gir_CFLAGS = -I$(top_srcdir) -I$(top_builddir)
353-Syncdaemon_1_0_gir_LIBS = libsyncdaemon-1.0.la
354-Syncdaemon_1_0_gir_FILES = $(addprefix $(srcdir)/, $(introspection_files))
355-Syncdaemon_1_0_gir_EXPORT_PACKAGES = libsyncdaemon-1.0
356-INTROSPECTION_GIRS += Syncdaemon-1.0.gir
357-
358-girdir = $(datadir)/$(INTROSPECTION_GIRDIR_NAME)
359-gir_DATA = $(INTROSPECTION_GIRS)
360-
361-typelibsdir = $(libdir)/$(INTROSPECTION_TYPELIBDIR_NAME)
362-typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
363-
364-CLEANFILES += $(gir_DATA) $(typelibs_DATA)
365-
366-endif # HAVE_INTROSPECTION
367
368=== removed file 'libsyncdaemon/libsyncdaemon-1.0.pc.in'
369--- libsyncdaemon/libsyncdaemon-1.0.pc.in 2010-06-24 12:14:39 +0000
370+++ libsyncdaemon/libsyncdaemon-1.0.pc.in 1970-01-01 00:00:00 +0000
371@@ -1,11 +0,0 @@
372-prefix=@prefix@
373-exec_prefix=${prefix}
374-libdir=${exec_prefix}/lib
375-includedir=${exec_prefix}/include
376-
377-Name: libsyncdaemon
378-Description: Ubuntu One SyncDaemon access library
379-Version: @VERSION@
380-Libs: -L${libdir} -lsyncdaemon-1.0
381-Cflags: -I${includedir}/libsyncdaemon-1.0
382-Requires: gobject-2.0
383
384=== removed file 'libsyncdaemon/libsyncdaemon.h'
385--- libsyncdaemon/libsyncdaemon.h 2012-04-09 20:07:05 +0000
386+++ libsyncdaemon/libsyncdaemon.h 1970-01-01 00:00:00 +0000
387@@ -1,50 +0,0 @@
388-/*
389- * Syncdaemon API
390- *
391- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
392- *
393- * Copyright 2010-2012 Canonical Ltd.
394- *
395- * This program is free software: you can redistribute it and/or modify it
396- * under the terms of the GNU General Public License version 3, as published
397- * by the Free Software Foundation.
398- *
399- * This program is distributed in the hope that it will be useful, but
400- * WITHOUT ANY WARRANTY; without even the implied warranties of
401- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
402- * PURPOSE. See the GNU General Public License for more details.
403- *
404- * You should have received a copy of the GNU General Public License along
405- * with this program. If not, see <http://www.gnu.org/licenses/>.
406- *
407- * In addition, as a special exception, the copyright holders give
408- * permission to link the code of portions of this program with the
409- * OpenSSL library under certain conditions as described in each
410- * individual source file, and distribute linked combinations
411- * including the two.
412- * You must obey the GNU General Public License in all respects
413- * for all of the code used other than OpenSSL. If you modify
414- * file(s) with this exception, you may extend this exception to your
415- * version of the file(s), but you are not obligated to do so. If you
416- * do not wish to do so, delete this exception statement from your
417- * version. If you delete this exception statement from all source
418- * files in the program, then also delete it here.
419- *
420- */
421-
422-#include <libsyncdaemon/syncdaemon-authentication.h>
423-#include <libsyncdaemon/syncdaemon-config-interface.h>
424-#include <libsyncdaemon/syncdaemon-credentials.h>
425-#include <libsyncdaemon/syncdaemon-daemon.h>
426-#include <libsyncdaemon/syncdaemon-events-interface.h>
427-#include <libsyncdaemon/syncdaemon-file-info.h>
428-#include <libsyncdaemon/syncdaemon-filesystem-interface.h>
429-#include <libsyncdaemon/syncdaemon-folder-info.h>
430-#include <libsyncdaemon/syncdaemon-folders-interface.h>
431-#include <libsyncdaemon/syncdaemon-interface.h>
432-#include <libsyncdaemon/syncdaemon-publicfiles-interface.h>
433-#include <libsyncdaemon/syncdaemon-share-info.h>
434-#include <libsyncdaemon/syncdaemon-shares-interface.h>
435-#include <libsyncdaemon/syncdaemon-status-info.h>
436-#include <libsyncdaemon/syncdaemon-status-interface.h>
437-#include <libsyncdaemon/syncdaemon-transfer-info.h>
438
439=== removed file 'libsyncdaemon/syncdaemon-authentication.c'
440--- libsyncdaemon/syncdaemon-authentication.c 2012-04-09 20:07:05 +0000
441+++ libsyncdaemon/syncdaemon-authentication.c 1970-01-01 00:00:00 +0000
442@@ -1,298 +0,0 @@
443-/*
444- * Syncdaemon API
445- *
446- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
447- *
448- * Copyright 2010-2012 Canonical Ltd.
449- *
450- * This program is free software: you can redistribute it and/or modify it
451- * under the terms of the GNU General Public License version 3, as published
452- * by the Free Software Foundation.
453- *
454- * This program is distributed in the hope that it will be useful, but
455- * WITHOUT ANY WARRANTY; without even the implied warranties of
456- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
457- * PURPOSE. See the GNU General Public License for more details.
458- *
459- * You should have received a copy of the GNU General Public License along
460- * with this program. If not, see <http://www.gnu.org/licenses/>.
461- *
462- * In addition, as a special exception, the copyright holders give
463- * permission to link the code of portions of this program with the
464- * OpenSSL library under certain conditions as described in each
465- * individual source file, and distribute linked combinations
466- * including the two.
467- * You must obey the GNU General Public License in all respects
468- * for all of the code used other than OpenSSL. If you modify
469- * file(s) with this exception, you may extend this exception to your
470- * version of the file(s), but you are not obligated to do so. If you
471- * do not wish to do so, delete this exception statement from your
472- * version. If you delete this exception statement from all source
473- * files in the program, then also delete it here.
474- *
475- */
476-
477-#include "config.h"
478-#include <string.h>
479-#include <glib/gi18n-lib.h>
480-#include <dbus/dbus-glib.h>
481-#include "syncdaemon-authentication.h"
482-#include "syncdaemon-marshal.h"
483-
484-G_DEFINE_TYPE(SyncdaemonAuthentication, syncdaemon_authentication, G_TYPE_OBJECT)
485-
486-struct _SyncdaemonAuthenticationPrivate {
487- DBusGConnection *bus;
488- DBusGProxy *proxy;
489- gboolean has_credentials;
490- SyncdaemonCredentials *credentials;
491-};
492-
493-/* Signals */
494-enum {
495- CREDENTIALS_FOUND_SIGNAL,
496- AUTHORIZATION_CANCELLED_SIGNAL,
497- ERROR_SIGNAL,
498- LAST_SIGNAL
499-};
500-
501-static guint auth_signals[LAST_SIGNAL] = { 0, };
502-
503-static void
504-syncdaemon_authentication_finalize (GObject *object)
505-{
506- SyncdaemonAuthentication *auth = SYNCDAEMON_AUTHENTICATION (object);
507-
508- if (auth->priv != NULL) {
509- if (auth->priv->credentials != NULL)
510- g_object_unref (G_OBJECT (auth->priv->credentials));
511- if (auth->priv->proxy != NULL)
512- g_object_unref (G_OBJECT (auth->priv->proxy));
513- if (auth->priv->bus != NULL)
514- dbus_g_connection_unref (auth->priv->bus);
515-
516- g_free (auth->priv);
517- }
518-
519- G_OBJECT_CLASS (syncdaemon_authentication_parent_class)->finalize (object);
520-}
521-
522-static void
523-syncdaemon_authentication_class_init (SyncdaemonAuthenticationClass *klass)
524-{
525- GObjectClass *object_class = G_OBJECT_CLASS (klass);
526-
527- object_class->finalize = syncdaemon_authentication_finalize;
528-
529- /* Register signals */
530- auth_signals[CREDENTIALS_FOUND_SIGNAL] = g_signal_new ("credentials_found",
531- G_TYPE_FROM_CLASS (klass),
532- (GSignalFlags) G_SIGNAL_RUN_LAST,
533- G_STRUCT_OFFSET (SyncdaemonAuthenticationClass, credentials_found),
534- NULL, NULL,
535- g_cclosure_marshal_VOID__OBJECT,
536- G_TYPE_NONE, 1,
537- G_TYPE_OBJECT);
538- auth_signals[AUTHORIZATION_CANCELLED_SIGNAL] = g_signal_new ("authorization_cancelled",
539- G_TYPE_FROM_CLASS (klass),
540- (GSignalFlags) G_SIGNAL_RUN_LAST,
541- G_STRUCT_OFFSET (SyncdaemonAuthenticationClass, authorization_cancelled),
542- NULL, NULL,
543- g_cclosure_marshal_VOID__VOID,
544- G_TYPE_NONE, 0);
545- auth_signals[ERROR_SIGNAL] = g_signal_new ("error",
546- G_TYPE_FROM_CLASS (klass),
547- (GSignalFlags) G_SIGNAL_RUN_LAST,
548- G_STRUCT_OFFSET (SyncdaemonAuthenticationClass, error),
549- NULL, NULL,
550- g_cclosure_marshal_VOID__STRING,
551- G_TYPE_NONE, 1,
552- G_TYPE_STRING);
553-}
554-
555-static void
556-credentials_found_cb (DBusGProxy *proxy, GHashTable *result, gpointer user_data)
557-{
558- SyncdaemonAuthentication *auth = SYNCDAEMON_AUTHENTICATION (user_data);
559-
560- g_debug ("Authorization completed!");
561-
562- if (auth->priv->credentials != NULL)
563- g_object_unref (G_OBJECT (auth->priv->credentials));
564-
565- auth->priv->credentials = syncdaemon_credentials_new_from_hash_table (result);
566- auth->priv->has_credentials = TRUE;
567-
568- g_signal_emit (auth, auth_signals[CREDENTIALS_FOUND_SIGNAL], 0, auth->priv->credentials);
569-}
570-
571-static void
572-authorization_denied_cb (DBusGProxy *proxy, gpointer user_data)
573-{
574- g_debug ("Authorization denied");
575-
576- g_signal_emit (user_data, auth_signals[AUTHORIZATION_CANCELLED_SIGNAL], 0);
577-}
578-
579-static void
580-credentials_error_cb (DBusGProxy *proxy, GHashTable *error_dict, gpointer user_data)
581-{
582- g_debug ("Authorization error");
583-
584- g_signal_emit (user_data, auth_signals[ERROR_SIGNAL], 0,
585- g_hash_table_lookup (error_dict, "message"));
586-}
587-
588-static void
589-credentials_not_found_cb (DBusGProxy *proxy, gpointer user_data)
590-{
591- SyncdaemonAuthentication *auth = SYNCDAEMON_AUTHENTICATION (user_data);
592-
593- g_debug ("Credentials for Ubuntu One not found!");
594-
595- if (auth->priv->credentials != NULL)
596- g_object_unref (G_OBJECT (auth->priv->credentials));
597- auth->priv->has_credentials = FALSE;
598-
599- g_signal_emit (auth, auth_signals[ERROR_SIGNAL], 0,
600- "Credentials not found.");
601-}
602-
603-static void
604-syncdaemon_authentication_init (SyncdaemonAuthentication *auth)
605-{
606- GError *error = NULL;
607-
608- auth->priv = g_new0 (SyncdaemonAuthenticationPrivate, 1);
609- auth->priv->has_credentials = FALSE;
610-
611- /* Initialize DBus */
612- auth->priv->bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
613- if (error != NULL) {
614- g_warning ("Couldn't get session bus: %s", error->message);
615- g_error_free (error);
616- } else {
617- auth->priv->proxy = dbus_g_proxy_new_for_name (auth->priv->bus, "com.ubuntuone.Credentials",
618- "/credentials", "com.ubuntuone.CredentialsManagement");
619- if (auth->priv->proxy != NULL) {
620- dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsFound",
621- dbus_g_type_get_map ("GHashTable",
622- G_TYPE_STRING,
623- G_TYPE_STRING),
624- G_TYPE_INVALID);
625- dbus_g_proxy_connect_signal (auth->priv->proxy, "CredentialsFound",
626- G_CALLBACK (credentials_found_cb), auth, NULL);
627-
628- dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsNotFound",
629- G_TYPE_INVALID);
630- dbus_g_proxy_connect_signal (auth->priv->proxy, "CredentialsNotFound",
631- G_CALLBACK (credentials_not_found_cb), auth, NULL);
632-
633- dbus_g_proxy_add_signal (auth->priv->proxy, "AuthorizationDenied",
634- G_TYPE_INVALID);
635- dbus_g_proxy_connect_signal (auth->priv->proxy, "AuthorizationDenied",
636- G_CALLBACK (authorization_denied_cb), auth, NULL);
637-
638- dbus_g_proxy_add_signal (auth->priv->proxy, "CredentialsError",
639- dbus_g_type_get_map ("GHashTable",
640- G_TYPE_STRING,
641- G_TYPE_STRING),
642- G_TYPE_INVALID);
643- dbus_g_proxy_connect_signal (auth->priv->proxy, "CredentialsError",
644- G_CALLBACK (credentials_error_cb), auth, NULL);
645- } else
646- g_warning ("Couldn't get proxy for com.ubuntuone.CredentialsManagement");
647-
648- }
649-}
650-
651-/**
652- * syncdaemon_authentication_find_credentials:
653- */
654-SyncdaemonCredentials *
655-syncdaemon_authentication_find_credentials (SyncdaemonAuthentication *auth)
656-{
657- SyncdaemonCredentials *result = NULL;
658- g_return_val_if_fail (SYNCDAEMON_IS_AUTHENTICATION (auth), NULL);
659-
660- if (!auth->priv->has_credentials) {
661- GHashTable *credentials;
662- GError *error = NULL;
663-
664- if (dbus_g_proxy_call (auth->priv->proxy, "find_credentials_sync", &error,
665- G_TYPE_INVALID,
666- dbus_g_type_get_map ("GHashTable",
667- G_TYPE_STRING,
668- G_TYPE_STRING), &credentials,
669- G_TYPE_INVALID)) {
670- if (g_hash_table_size (credentials) >= 4) {
671- auth->priv->credentials = syncdaemon_credentials_new_from_hash_table (credentials);
672- auth->priv->has_credentials = TRUE;
673- result = auth->priv->credentials;
674- } else {
675- g_debug ("Got less number of items (%i) in credentials hash table than expected (4)!",
676- g_hash_table_size (credentials));
677- }
678- g_hash_table_destroy (credentials);
679- } else {
680- g_warning ("Could not get credentials: %s", error->message);
681- g_error_free (error);
682- }
683- }
684-
685- return result;
686-}
687-
688-/**
689- * syncdaemon_authentication_has_credentials:
690- */
691-gboolean
692-syncdaemon_authentication_has_credentials (SyncdaemonAuthentication *auth)
693-{
694- g_return_val_if_fail (SYNCDAEMON_IS_AUTHENTICATION (auth), FALSE);
695-
696- if (auth->priv->has_credentials)
697- return TRUE;
698-
699- return syncdaemon_authentication_find_credentials (auth) != NULL;
700-}
701-
702-/**
703- * syncdaemon_authentication_login_or_register:
704- */
705-void
706-syncdaemon_authentication_login_or_register (SyncdaemonAuthentication *auth)
707-{
708- GHashTable *params = g_hash_table_new (g_str_hash, g_str_equal);
709-
710- g_return_if_fail (SYNCDAEMON_IS_AUTHENTICATION (auth));
711-
712- g_hash_table_insert (params, "window_id", "0"); /* FIXME: get window ID */
713-
714- dbus_g_proxy_call_no_reply (auth->priv->proxy, "register",
715- dbus_g_type_get_map ("GHashTable",
716- G_TYPE_STRING,
717- G_TYPE_STRING), params,
718- G_TYPE_INVALID,
719- G_TYPE_INVALID);
720-
721- g_hash_table_destroy (params);
722-}
723-
724-/**
725- * syncdaemon_authentication_clear_token:
726- */
727-void
728-syncdaemon_authentication_clear_token (SyncdaemonAuthentication *auth)
729-{
730- GError *error = NULL;
731-
732- g_return_if_fail (SYNCDAEMON_IS_AUTHENTICATION (auth));
733-
734- if (!dbus_g_proxy_call (auth->priv->proxy, "clear_credentials", &error,
735- G_TYPE_INVALID,
736- G_TYPE_INVALID)) {
737- g_warning ("Error calling 'clear_credentials': %s", error->message);
738- g_error_free (error);
739- }
740-}
741
742=== removed file 'libsyncdaemon/syncdaemon-authentication.h'
743--- libsyncdaemon/syncdaemon-authentication.h 2012-04-09 20:07:05 +0000
744+++ libsyncdaemon/syncdaemon-authentication.h 1970-01-01 00:00:00 +0000
745@@ -1,75 +0,0 @@
746-/*
747- * Syncdaemon API
748- *
749- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
750- *
751- * Copyright 2010-2012 Canonical Ltd.
752- *
753- * This program is free software: you can redistribute it and/or modify it
754- * under the terms of the GNU General Public License version 3, as published
755- * by the Free Software Foundation.
756- *
757- * This program is distributed in the hope that it will be useful, but
758- * WITHOUT ANY WARRANTY; without even the implied warranties of
759- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
760- * PURPOSE. See the GNU General Public License for more details.
761- *
762- * You should have received a copy of the GNU General Public License along
763- * with this program. If not, see <http://www.gnu.org/licenses/>.
764- *
765- * In addition, as a special exception, the copyright holders give
766- * permission to link the code of portions of this program with the
767- * OpenSSL library under certain conditions as described in each
768- * individual source file, and distribute linked combinations
769- * including the two.
770- * You must obey the GNU General Public License in all respects
771- * for all of the code used other than OpenSSL. If you modify
772- * file(s) with this exception, you may extend this exception to your
773- * version of the file(s), but you are not obligated to do so. If you
774- * do not wish to do so, delete this exception statement from your
775- * version. If you delete this exception statement from all source
776- * files in the program, then also delete it here.
777- *
778- */
779-
780-#ifndef __SYNCDAEMON_AUTHENTICATION_H__
781-#define __SYNCDAEMON_AUTHENTICATION_H__
782-
783-#include <glib-object.h>
784-#include "syncdaemon-credentials.h"
785-
786-G_BEGIN_DECLS
787-
788-#define SYNCDAEMON_TYPE_AUTHENTICATION (syncdaemon_authentication_get_type ())
789-#define SYNCDAEMON_AUTHENTICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_AUTHENTICATION, SyncdaemonAuthentication))
790-#define SYNCDAEMON_IS_AUTHENTICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_AUTHENTICATION))
791-#define SYNCDAEMON_AUTHENTICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_AUTHENTICATION, SyncdaemonAuthenticationClass))
792-#define SYNCDAEMON_IS_AUTHENTICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_AUTHENTICATION))
793-#define SYNCDAEMON_AUTHENTICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_AUTHENTICATION, SyncdaemonAuthenticationClass))
794-
795-typedef struct _SyncdaemonAuthenticationPrivate SyncdaemonAuthenticationPrivate;
796-
797-typedef struct {
798- GObject parent;
799- SyncdaemonAuthenticationPrivate *priv;
800-} SyncdaemonAuthentication;
801-
802-typedef struct {
803- GObjectClass parent_class;
804-
805- void (* credentials_found) (SyncdaemonAuthentication *auth, SyncdaemonCredentials *credentials);
806- void (* authorization_cancelled) (SyncdaemonAuthentication *auth);
807- void (* error) (SyncdaemonAuthentication *auth, const gchar *error);
808-} SyncdaemonAuthenticationClass;
809-
810-GType syncdaemon_authentication_get_type (void);
811-SyncdaemonAuthentication *syncdaemon_authentication_new (void);
812-
813-SyncdaemonCredentials *syncdaemon_authentication_find_credentials (SyncdaemonAuthentication *auth);
814-gboolean syncdaemon_authentication_has_credentials (SyncdaemonAuthentication *auth);
815-void syncdaemon_authentication_login_or_register (SyncdaemonAuthentication *auth);
816-void syncdaemon_authentication_clear_token (SyncdaemonAuthentication *auth);
817-
818-G_END_DECLS
819-
820-#endif
821
822=== removed file 'libsyncdaemon/syncdaemon-config-interface.c'
823--- libsyncdaemon/syncdaemon-config-interface.c 2012-04-09 20:07:05 +0000
824+++ libsyncdaemon/syncdaemon-config-interface.c 1970-01-01 00:00:00 +0000
825@@ -1,276 +0,0 @@
826-/*
827- * Syncdaemon API
828- *
829- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
830- *
831- * Copyright 2010-2012 Canonical Ltd.
832- *
833- * This program is free software: you can redistribute it and/or modify it
834- * under the terms of the GNU General Public License version 3, as published
835- * by the Free Software Foundation.
836- *
837- * This program is distributed in the hope that it will be useful, but
838- * WITHOUT ANY WARRANTY; without even the implied warranties of
839- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
840- * PURPOSE. See the GNU General Public License for more details.
841- *
842- * You should have received a copy of the GNU General Public License along
843- * with this program. If not, see <http://www.gnu.org/licenses/>.
844- *
845- * In addition, as a special exception, the copyright holders give
846- * permission to link the code of portions of this program with the
847- * OpenSSL library under certain conditions as described in each
848- * individual source file, and distribute linked combinations
849- * including the two.
850- * You must obey the GNU General Public License in all respects
851- * for all of the code used other than OpenSSL. If you modify
852- * file(s) with this exception, you may extend this exception to your
853- * version of the file(s), but you are not obligated to do so. If you
854- * do not wish to do so, delete this exception statement from your
855- * version. If you delete this exception statement from all source
856- * files in the program, then also delete it here.
857- *
858- */
859-
860-#include "config.h"
861-#ifdef HAVE_GDBUS
862-#else
863-#include <dbus/dbus-glib.h>
864-#endif
865-#include "syncdaemon-config-interface.h"
866-
867-G_DEFINE_TYPE(SyncdaemonConfigInterface, syncdaemon_config_interface, SYNCDAEMON_TYPE_INTERFACE)
868-
869-struct _SyncdaemonConfigInterfacePrivate {
870- GObject *proxy;
871-};
872-
873-static void
874-syncdaemon_config_interface_finalize (GObject *object)
875-{
876- SyncdaemonConfigInterface *interface = SYNCDAEMON_CONFIG_INTERFACE (object);
877-
878- if (interface->priv != NULL) {
879- g_free (interface->priv);
880- }
881-
882- G_OBJECT_CLASS (syncdaemon_config_interface_parent_class)->finalize (object);
883-}
884-
885-static void
886-syncdaemon_config_interface_class_init (SyncdaemonConfigInterfaceClass *klass)
887-{
888- GObjectClass *object_class = G_OBJECT_CLASS (klass);
889-
890- object_class->finalize = syncdaemon_config_interface_finalize;
891-}
892-
893-static void
894-syncdaemon_config_interface_init (SyncdaemonConfigInterface *interface)
895-{
896- interface->priv = g_new0 (SyncdaemonConfigInterfacePrivate, 1);
897-
898- /* Setup DBus proxy */
899- interface->priv->proxy = syncdaemon_interface_setup_proxy (SYNCDAEMON_INTERFACE (interface),
900- "com.ubuntuone.SyncDaemon",
901- "/config", "com.ubuntuone.SyncDaemon.Config");
902-}
903-
904-/**
905- * syncdaemon_config_interface_new:
906- */
907-SyncdaemonConfigInterface *
908-syncdaemon_config_interface_new (SyncdaemonDaemon *daemon)
909-{
910- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
911-
912- return g_object_new (SYNCDAEMON_TYPE_CONFIG_INTERFACE, "daemon", daemon, NULL);
913-}
914-
915-static gboolean
916-get_boolean_method (SyncdaemonConfigInterface *interface, const gchar *method)
917-{
918- gboolean enabled;
919- GError *error = NULL;
920-
921- if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), method, &error,
922- G_TYPE_INVALID,
923- G_TYPE_BOOLEAN, &enabled,
924- G_TYPE_INVALID)) {
925- g_warning ("Failed calling %s: %s", method, error->message);
926- g_error_free (error);
927-
928- return FALSE;
929- }
930-
931- return enabled;
932-}
933-
934-static void
935-enable_setting_method (SyncdaemonConfigInterface *interface,
936- const gchar *enable_method,
937- const gchar *disable_method,
938- gboolean enabled)
939-{
940- GError *error = NULL;
941-
942- if (enabled) {
943- dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), enable_method, &error,
944- G_TYPE_INVALID,
945- G_TYPE_INVALID);
946- } else {
947- dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), disable_method, &error,
948- G_TYPE_INVALID,
949- G_TYPE_INVALID);
950- }
951-
952- if (error) {
953- g_warning ("Failed calling %s: %s", enabled ? enable_method : disable_method, error->message);
954- g_error_free (error);
955- }
956-}
957-
958-/**
959- * syncdaemon_config_interface_get_bandwidth_throttling:
960- */
961-gboolean
962-syncdaemon_config_interface_get_bandwidth_throttling (SyncdaemonConfigInterface *interface)
963-{
964- g_return_val_if_fail (SYNCDAEMON_IS_CONFIG_INTERFACE (interface), FALSE);
965-
966- return get_boolean_method (interface, "bandwidth_throttling_enabled");
967-}
968-
969-/**
970- * syncdaemon_config_interface_set_bandwidth_throttling:
971- */
972-void
973-syncdaemon_config_interface_set_bandwidth_throttling (SyncdaemonConfigInterface *interface, gboolean enabled)
974-{
975- g_return_if_fail (SYNCDAEMON_IS_CONFIG_INTERFACE (interface));
976-
977- enable_setting_method (interface, "enable_bandwidth_throttling", "disable_bandwidth_throttling", enabled);
978-}
979-
980-/**
981- * syncdaemon_config_interface_get_files_sync:
982- */
983-gboolean
984-syncdaemon_config_interface_get_files_sync (SyncdaemonConfigInterface *interface)
985-{
986- gboolean enabled;
987- GError *error = NULL;
988-
989- g_return_val_if_fail (SYNCDAEMON_IS_CONFIG_INTERFACE (interface), FALSE);
990-
991- if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), "files_sync_enabled", &error,
992- G_TYPE_INVALID,
993- G_TYPE_BOOLEAN, &enabled,
994- G_TYPE_INVALID)) {
995- g_warning ("Failed calling files_sync_enabled: %s", error->message);
996- g_error_free (error);
997-
998- return FALSE;
999- }
1000-
1001- return enabled;
1002-}
1003-
1004-/**
1005- * syncdaemon_config_interface_set_files_sync:
1006- */
1007-void
1008-syncdaemon_config_interface_set_files_sync (SyncdaemonConfigInterface *interface, gboolean enabled)
1009-{
1010- GError *error = NULL;
1011-
1012- g_return_if_fail (SYNCDAEMON_IS_CONFIG_INTERFACE (interface));
1013-
1014- if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), "set_files_sync_enabled", &error,
1015- G_TYPE_BOOLEAN, enabled,
1016- G_TYPE_INVALID,
1017- G_TYPE_INVALID)) {
1018- g_warning ("Failed calling set_files_sync_enabled: %s", error->message);
1019- g_error_free (error);
1020- }
1021-}
1022-
1023-/**
1024- * syncdaemon_config_interface_get_throttling_limits:
1025- */
1026-void
1027-syncdaemon_config_interface_get_throttling_limits (SyncdaemonConfigInterface *interface,
1028- gint *download,
1029- gint *upload)
1030-{
1031- GHashTable *result;
1032- GError *error = NULL;
1033-
1034- g_return_if_fail (SYNCDAEMON_IS_CONFIG_INTERFACE (interface));
1035-
1036- if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), "get_throttling_limits", &error,
1037- G_TYPE_INVALID,
1038- dbus_g_type_get_map ("GHashTable",
1039- G_TYPE_STRING,
1040- G_TYPE_INT), &result,
1041- G_TYPE_INVALID)) {
1042- g_warning ("Failed calling get_throttling_limits: %s", error->message);
1043- g_error_free (error);
1044- } else {
1045- gint *download_got, *upload_got;
1046-
1047- download_got = g_hash_table_lookup (result, "download");
1048- upload_got = g_hash_table_lookup (result, "upload");
1049-
1050- if (download != NULL)
1051- *download = *download_got;
1052- if (upload != NULL)
1053- *upload = *upload_got;
1054-
1055- g_hash_table_destroy (result);
1056- }
1057-}
1058-
1059-/**
1060- * syncdaemon_config_interface_set_throttling_limits:
1061- */
1062-void
1063-syncdaemon_config_interface_set_throttling_limits (SyncdaemonConfigInterface *interface,
1064- gint download,
1065- gint upload)
1066-{
1067- GError *error = NULL;
1068-
1069- g_return_if_fail (SYNCDAEMON_IS_CONFIG_INTERFACE (interface));
1070-
1071- if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), "set_throttling_limits", &error,
1072- G_TYPE_INT, download,
1073- G_TYPE_INT, upload,
1074- G_TYPE_INVALID,
1075- G_TYPE_INVALID)) {
1076- g_warning ("Failed calling set_throttling_limits: %s", error->message);
1077- g_error_free (error);
1078- }
1079-}
1080-
1081-/**
1082- * syncdaemon_config_interface_get_udf_autosubscribe:
1083- */
1084-gboolean
1085-syncdaemon_config_interface_get_udf_autosubscribe (SyncdaemonConfigInterface *interface)
1086-{
1087- g_return_val_if_fail (SYNCDAEMON_IS_CONFIG_INTERFACE (interface), FALSE);
1088-
1089- return get_boolean_method (interface, "udf_autosubscribe_enabled");
1090-}
1091-
1092-/**
1093- * syncdaemon_config_interface_set_bandwidth_throttling_enabled:
1094- */
1095-void
1096-syncdaemon_config_interface_set_udf_autosubscribe (SyncdaemonConfigInterface *interface, gboolean enabled)
1097-{
1098- g_return_if_fail (SYNCDAEMON_IS_CONFIG_INTERFACE (interface));
1099-
1100- enable_setting_method (interface, "enable_udf_autosubscribe", "disable_udf_autosubscribe", enabled);
1101-}
1102
1103=== removed file 'libsyncdaemon/syncdaemon-config-interface.h'
1104--- libsyncdaemon/syncdaemon-config-interface.h 2012-04-09 20:07:05 +0000
1105+++ libsyncdaemon/syncdaemon-config-interface.h 1970-01-01 00:00:00 +0000
1106@@ -1,83 +0,0 @@
1107-/*
1108- * Syncdaemon API
1109- *
1110- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
1111- *
1112- * Copyright 2010-2012 Canonical Ltd.
1113- *
1114- * This program is free software: you can redistribute it and/or modify it
1115- * under the terms of the GNU General Public License version 3, as published
1116- * by the Free Software Foundation.
1117- *
1118- * This program is distributed in the hope that it will be useful, but
1119- * WITHOUT ANY WARRANTY; without even the implied warranties of
1120- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
1121- * PURPOSE. See the GNU General Public License for more details.
1122- *
1123- * You should have received a copy of the GNU General Public License along
1124- * with this program. If not, see <http://www.gnu.org/licenses/>.
1125- *
1126- * In addition, as a special exception, the copyright holders give
1127- * permission to link the code of portions of this program with the
1128- * OpenSSL library under certain conditions as described in each
1129- * individual source file, and distribute linked combinations
1130- * including the two.
1131- * You must obey the GNU General Public License in all respects
1132- * for all of the code used other than OpenSSL. If you modify
1133- * file(s) with this exception, you may extend this exception to your
1134- * version of the file(s), but you are not obligated to do so. If you
1135- * do not wish to do so, delete this exception statement from your
1136- * version. If you delete this exception statement from all source
1137- * files in the program, then also delete it here.
1138- *
1139- */
1140-
1141-#ifndef __SYNCDAEMON_CONFIG_INTERFACE_H__
1142-#define __SYNCDAEMON_CONFIG_INTERFACE_H__
1143-
1144-#include "syncdaemon-daemon.h"
1145-#include "syncdaemon-interface.h"
1146-
1147-G_BEGIN_DECLS
1148-
1149-#define SYNCDAEMON_TYPE_CONFIG_INTERFACE (syncdaemon_config_interface_get_type ())
1150-#define SYNCDAEMON_CONFIG_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_CONFIG_INTERFACE, SyncdaemonConfigInterface))
1151-#define SYNCDAEMON_IS_CONFIG_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_CONFIG_INTERFACE))
1152-#define SYNCDAEMON_CONFIG_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_CONFIG_INTERFACE, SyncdaemonConfigInterfaceClass))
1153-#define SYNCDAEMON_IS_CONFIG_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_CONFIG_INTERFACE))
1154-#define SYNCDAEMON_CONFIG_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_CONFIG_INTERFACE, SyncdaemonConfigInterfaceClass))
1155-
1156-typedef struct _SyncdaemonConfigInterfacePrivate SyncdaemonConfigInterfacePrivate;
1157-
1158-typedef struct {
1159- SyncdaemonInterface parent;
1160- SyncdaemonConfigInterfacePrivate *priv;
1161-} SyncdaemonConfigInterface;
1162-
1163-typedef struct {
1164- SyncdaemonInterfaceClass parent_class;
1165-} SyncdaemonConfigInterfaceClass;
1166-
1167-GType syncdaemon_config_interface_get_type (void);
1168-
1169-SyncdaemonConfigInterface *syncdaemon_config_interface_new (SyncdaemonDaemon *daemon);
1170-
1171-gboolean syncdaemon_config_interface_get_bandwidth_throttling (SyncdaemonConfigInterface *interface);
1172-void syncdaemon_config_interface_set_bandwidth_throttling (SyncdaemonConfigInterface *interface,
1173- gboolean enabled);
1174-gboolean syncdaemon_config_interface_get_files_sync (SyncdaemonConfigInterface *interface);
1175-void syncdaemon_config_interface_set_files_sync (SyncdaemonConfigInterface *interface,
1176- gboolean enabled);
1177-void syncdaemon_config_interface_get_throttling_limits (SyncdaemonConfigInterface *interface,
1178- gint *download,
1179- gint *upload);
1180-void syncdaemon_config_interface_set_throttling_limits (SyncdaemonConfigInterface *interface,
1181- gint download,
1182- gint upload);
1183-gboolean syncdaemon_config_interface_get_udf_autosubscribe (SyncdaemonConfigInterface *interface);
1184-void syncdaemon_config_interface_set_udf_autosubscribe (SyncdaemonConfigInterface *interface,
1185- gboolean enabled);
1186-
1187-G_END_DECLS
1188-
1189-#endif
1190
1191=== removed file 'libsyncdaemon/syncdaemon-credentials.c'
1192--- libsyncdaemon/syncdaemon-credentials.c 2012-04-09 20:07:05 +0000
1193+++ libsyncdaemon/syncdaemon-credentials.c 1970-01-01 00:00:00 +0000
1194@@ -1,215 +0,0 @@
1195-/*
1196- * Syncdaemon API
1197- *
1198- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
1199- *
1200- * Copyright 2010-2012 Canonical Ltd.
1201- *
1202- * This program is free software: you can redistribute it and/or modify it
1203- * under the terms of the GNU General Public License version 3, as published
1204- * by the Free Software Foundation.
1205- *
1206- * This program is distributed in the hope that it will be useful, but
1207- * WITHOUT ANY WARRANTY; without even the implied warranties of
1208- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
1209- * PURPOSE. See the GNU General Public License for more details.
1210- *
1211- * You should have received a copy of the GNU General Public License along
1212- * with this program. If not, see <http://www.gnu.org/licenses/>.
1213- *
1214- * In addition, as a special exception, the copyright holders give
1215- * permission to link the code of portions of this program with the
1216- * OpenSSL library under certain conditions as described in each
1217- * individual source file, and distribute linked combinations
1218- * including the two.
1219- * You must obey the GNU General Public License in all respects
1220- * for all of the code used other than OpenSSL. If you modify
1221- * file(s) with this exception, you may extend this exception to your
1222- * version of the file(s), but you are not obligated to do so. If you
1223- * do not wish to do so, delete this exception statement from your
1224- * version. If you delete this exception statement from all source
1225- * files in the program, then also delete it here.
1226- *
1227- */
1228-
1229-#include "syncdaemon-credentials.h"
1230-
1231-G_DEFINE_TYPE(SyncdaemonCredentials, syncdaemon_credentials, G_TYPE_OBJECT)
1232-
1233-struct _SyncdaemonCredentialsPrivate {
1234- gchar *consumer_key;
1235- gchar *consumer_secret;
1236- gchar *token;
1237- gchar *token_secret;
1238-};
1239-
1240-static void
1241-syncdaemon_credentials_finalize (GObject *object)
1242-{
1243- SyncdaemonCredentials *credentials = SYNCDAEMON_CREDENTIALS (object);
1244-
1245- if (credentials->priv != NULL) {
1246- if (credentials->priv->consumer_key != NULL)
1247- g_free (credentials->priv->consumer_key);
1248- if (credentials->priv->consumer_secret != NULL)
1249- g_free (credentials->priv->consumer_secret);
1250- if (credentials->priv->token != NULL)
1251- g_free (credentials->priv->token);
1252- if (credentials->priv->token_secret != NULL)
1253- g_free (credentials->priv->token_secret);
1254-
1255- g_free (credentials->priv);
1256- }
1257-
1258- G_OBJECT_CLASS (syncdaemon_credentials_parent_class)->finalize (object);
1259-}
1260-
1261-static void
1262-syncdaemon_credentials_class_init (SyncdaemonCredentialsClass *klass)
1263-{
1264- GObjectClass *object_class = G_OBJECT_CLASS (klass);
1265-
1266- object_class->finalize = syncdaemon_credentials_finalize;
1267-}
1268-
1269-static void
1270-syncdaemon_credentials_init (SyncdaemonCredentials *credentials)
1271-{
1272- credentials->priv = g_new0 (SyncdaemonCredentialsPrivate, 1);
1273-}
1274-
1275-/**
1276- * syncdaemon_credentials_new:
1277- */
1278-SyncdaemonCredentials *
1279-syncdaemon_credentials_new (void)
1280-{
1281- return g_object_new (SYNCDAEMON_TYPE_CREDENTIALS, NULL);
1282-}
1283-
1284-/**
1285- * syncdaemon_credentials_new_from_hash_table:
1286- */
1287-SyncdaemonCredentials *
1288-syncdaemon_credentials_new_from_hash_table (GHashTable *hash)
1289-{
1290- SyncdaemonCredentials *credentials;
1291-
1292- credentials = g_object_new (SYNCDAEMON_TYPE_CREDENTIALS, NULL);
1293- if (hash != NULL) {
1294- syncdaemon_credentials_set_consumer_key (
1295- credentials,
1296- g_hash_table_lookup (hash, "consumer_key"));
1297- syncdaemon_credentials_set_consumer_secret (
1298- credentials,
1299- g_hash_table_lookup (hash, "consumer_secret"));
1300- syncdaemon_credentials_set_token (
1301- credentials,
1302- g_hash_table_lookup (hash, "token"));
1303- syncdaemon_credentials_set_token_secret (
1304- credentials,
1305- g_hash_table_lookup (hash, "token_secret"));
1306- }
1307-
1308- return credentials;
1309-}
1310-
1311-/**
1312- * syncdaemon_credentials_get_oauth_consumer_token:
1313- */
1314-const gchar *
1315-syncdaemon_credentials_get_consumer_key (SyncdaemonCredentials *credentials)
1316-{
1317- g_return_val_if_fail (SYNCDAEMON_IS_CREDENTIALS (credentials), NULL);
1318-
1319- return (const gchar *) credentials->priv->consumer_key;
1320-}
1321-
1322-/**
1323- * syncdaemon_credentials_set_consumer_key:
1324- */
1325-void
1326-syncdaemon_credentials_set_consumer_key (SyncdaemonCredentials *credentials, const gchar *consumer_key)
1327-{
1328- g_return_if_fail (SYNCDAEMON_IS_CREDENTIALS (credentials));
1329-
1330- if (credentials->priv->consumer_key != NULL)
1331- g_free (credentials->priv->consumer_key);
1332-
1333- credentials->priv->consumer_key = g_strdup (consumer_key);
1334-}
1335-
1336-/**
1337- * syncdaemon_credentials_get_consumer_secret:
1338- */
1339-const gchar *
1340-syncdaemon_credentials_get_consumer_secret (SyncdaemonCredentials *credentials)
1341-{
1342- g_return_val_if_fail (SYNCDAEMON_IS_CREDENTIALS (credentials), NULL);
1343-
1344- return (const gchar *) credentials->priv->consumer_secret;
1345-}
1346-
1347-/**
1348- * syncdaemon_credentials_set_consumer_secret:
1349- */
1350-void
1351-syncdaemon_credentials_set_consumer_secret (SyncdaemonCredentials *credentials, const gchar *consumer_secret)
1352-{
1353- g_return_if_fail (SYNCDAEMON_IS_CREDENTIALS (credentials));
1354-
1355- if (credentials->priv->consumer_secret != NULL)
1356- g_free (credentials->priv->consumer_secret);
1357-
1358- credentials->priv->consumer_secret = g_strdup (consumer_secret);
1359-}
1360-
1361-/**
1362- * syncdaemon_credentials_get_token:
1363- */
1364-const gchar *
1365-syncdaemon_credentials_get_token (SyncdaemonCredentials *credentials)
1366-{
1367- g_return_val_if_fail (SYNCDAEMON_IS_CREDENTIALS (credentials), NULL);
1368-
1369- return (const gchar *) credentials->priv->token;
1370-}
1371-
1372-/**
1373- * syncdaemon_credentials_set_token:
1374- */
1375-void
1376-syncdaemon_credentials_set_token (SyncdaemonCredentials *credentials, const gchar *token)
1377-{
1378- g_return_if_fail (SYNCDAEMON_IS_CREDENTIALS (credentials));
1379-
1380- if (credentials->priv->token != NULL)
1381- g_free (credentials->priv->token);
1382-
1383- credentials->priv->token = g_strdup (token);
1384-}
1385-
1386-/**
1387- * syncdaemon_credentials_get_token_secret:
1388- */
1389-const gchar *
1390-syncdaemon_credentials_get_token_secret (SyncdaemonCredentials *credentials)
1391-{
1392- g_return_val_if_fail (SYNCDAEMON_IS_CREDENTIALS (credentials), NULL);
1393-
1394- return (const gchar *) credentials->priv->token_secret;
1395-}
1396-
1397-/**
1398- * syncdaemon_credentials_set_token_secret:
1399- */
1400-void
1401-syncdaemon_credentials_set_token_secret (SyncdaemonCredentials *credentials, const gchar *token_secret)
1402-{
1403- g_return_if_fail (SYNCDAEMON_IS_CREDENTIALS (credentials));
1404-
1405- if (credentials->priv->token_secret != NULL)
1406- g_free (credentials->priv->token_secret);
1407-
1408- credentials->priv->token_secret = g_strdup (token_secret);
1409-}
1410
1411=== removed file 'libsyncdaemon/syncdaemon-credentials.h'
1412--- libsyncdaemon/syncdaemon-credentials.h 2012-04-09 20:07:05 +0000
1413+++ libsyncdaemon/syncdaemon-credentials.h 1970-01-01 00:00:00 +0000
1414@@ -1,75 +0,0 @@
1415-/*
1416- * Syncdaemon API
1417- *
1418- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
1419- *
1420- * Copyright 2010-2012 Canonical Ltd.
1421- *
1422- * This program is free software: you can redistribute it and/or modify it
1423- * under the terms of the GNU General Public License version 3, as published
1424- * by the Free Software Foundation.
1425- *
1426- * This program is distributed in the hope that it will be useful, but
1427- * WITHOUT ANY WARRANTY; without even the implied warranties of
1428- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
1429- * PURPOSE. See the GNU General Public License for more details.
1430- *
1431- * You should have received a copy of the GNU General Public License along
1432- * with this program. If not, see <http://www.gnu.org/licenses/>.
1433- *
1434- * In addition, as a special exception, the copyright holders give
1435- * permission to link the code of portions of this program with the
1436- * OpenSSL library under certain conditions as described in each
1437- * individual source file, and distribute linked combinations
1438- * including the two.
1439- * You must obey the GNU General Public License in all respects
1440- * for all of the code used other than OpenSSL. If you modify
1441- * file(s) with this exception, you may extend this exception to your
1442- * version of the file(s), but you are not obligated to do so. If you
1443- * do not wish to do so, delete this exception statement from your
1444- * version. If you delete this exception statement from all source
1445- * files in the program, then also delete it here.
1446- *
1447- */
1448-
1449-#ifndef __SYNCDAEMON_CREDENTIALS_H__
1450-#define __SYNCDAEMON_CREDENTIALS_H__
1451-
1452-#include <glib-object.h>
1453-
1454-G_BEGIN_DECLS
1455-
1456-#define SYNCDAEMON_TYPE_CREDENTIALS (syncdaemon_credentials_get_type ())
1457-#define SYNCDAEMON_CREDENTIALS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_CREDENTIALS, SyncdaemonCredentials))
1458-#define SYNCDAEMON_IS_CREDENTIALS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_CREDENTIALS))
1459-#define SYNCDAEMON_CREDENTIALS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_CREDENTIALS, SyncdaemonCredentialsClass))
1460-#define SYNCDAEMON_IS_CREDENTIALS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_CREDENTIALS))
1461-#define SYNCDAEMON_CREDENTIALS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_CREDENTIALS, SyncdaemonCredentialsClass))
1462-
1463-typedef struct _SyncdaemonCredentialsPrivate SyncdaemonCredentialsPrivate;
1464-
1465-typedef struct {
1466- GObject parent;
1467- SyncdaemonCredentialsPrivate *priv;
1468-} SyncdaemonCredentials;
1469-
1470-typedef struct {
1471- GObjectClass parent_class;
1472-} SyncdaemonCredentialsClass;
1473-
1474-GType syncdaemon_credentials_get_type (void);
1475-SyncdaemonCredentials *syncdaemon_credentials_new (void);
1476-SyncdaemonCredentials *syncdaemon_credentials_new_from_hash_table (GHashTable *hash);
1477-
1478-const gchar *syncdaemon_credentials_get_consumer_key (SyncdaemonCredentials *credentials);
1479-void syncdaemon_credentials_set_consumer_key (SyncdaemonCredentials *credentials, const gchar *consumer_key);
1480-const gchar *syncdaemon_credentials_get_consumer_secret (SyncdaemonCredentials *credentials);
1481-void syncdaemon_credentials_set_consumer_secret (SyncdaemonCredentials *credentials, const gchar *consumer_secret);
1482-const gchar *syncdaemon_credentials_get_token (SyncdaemonCredentials *credentials);
1483-void syncdaemon_credentials_set_token (SyncdaemonCredentials *credentials, const gchar *token);
1484-const gchar *syncdaemon_credentials_get_token_secret (SyncdaemonCredentials *credentials);
1485-void syncdaemon_credentials_set_token_secret (SyncdaemonCredentials *credentials, const gchar *token_secret);
1486-
1487-G_END_DECLS
1488-
1489-#endif
1490
1491=== removed file 'libsyncdaemon/syncdaemon-daemon.c'
1492--- libsyncdaemon/syncdaemon-daemon.c 2012-04-13 23:36:32 +0000
1493+++ libsyncdaemon/syncdaemon-daemon.c 1970-01-01 00:00:00 +0000
1494@@ -1,1477 +0,0 @@
1495-/*
1496- * Syncdaemon API
1497- *
1498- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
1499- *
1500- * Copyright 2010-2012 Canonical Ltd.
1501- *
1502- * This program is free software: you can redistribute it and/or modify it
1503- * under the terms of the GNU General Public License version 3, as published
1504- * by the Free Software Foundation.
1505- *
1506- * This program is distributed in the hope that it will be useful, but
1507- * WITHOUT ANY WARRANTY; without even the implied warranties of
1508- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
1509- * PURPOSE. See the GNU General Public License for more details.
1510- *
1511- * You should have received a copy of the GNU General Public License along
1512- * with this program. If not, see <http://www.gnu.org/licenses/>.
1513- *
1514- * In addition, as a special exception, the copyright holders give
1515- * permission to link the code of portions of this program with the
1516- * OpenSSL library under certain conditions as described in each
1517- * individual source file, and distribute linked combinations
1518- * including the two.
1519- * You must obey the GNU General Public License in all respects
1520- * for all of the code used other than OpenSSL. If you modify
1521- * file(s) with this exception, you may extend this exception to your
1522- * version of the file(s), but you are not obligated to do so. If you
1523- * do not wish to do so, delete this exception statement from your
1524- * version. If you delete this exception statement from all source
1525- * files in the program, then also delete it here.
1526- *
1527- */
1528-
1529-#include "config.h"
1530-#include <string.h>
1531-#ifdef HAVE_GDBUS
1532-#include <gio/gio.h>
1533-#else
1534-#include <dbus/dbus-glib.h>
1535-#include <dbus/dbus-glib-bindings.h>
1536-#endif
1537-#include "syncdaemon-daemon.h"
1538-#include "syncdaemon-config-interface.h"
1539-#include "syncdaemon-events-interface.h"
1540-#include "syncdaemon-filesystem-interface.h"
1541-#include "syncdaemon-folders-interface.h"
1542-#include "syncdaemon-publicfiles-interface.h"
1543-#include "syncdaemon-shares-interface.h"
1544-#include "syncdaemon-status-interface.h"
1545-#include "syncdaemon-marshal.h"
1546-
1547-#define SYNCDAEMON_DBUS_NAME "com.ubuntuone.SyncDaemon"
1548-
1549-G_DEFINE_TYPE(SyncdaemonDaemon, syncdaemon_daemon, G_TYPE_OBJECT)
1550-
1551-struct _SyncdaemonDaemonPrivate {
1552-#ifdef HAVE_GDBUS
1553- GDBusConnection *bus;
1554- GDbusProxy *dbus_proxy;
1555-#else
1556- DBusGConnection *bus;
1557- DBusGProxy *dbus_proxy;
1558-#endif
1559-
1560- /* Interfaces */
1561- GObject *daemon_interface;
1562- GHashTable *subinterfaces;
1563-
1564- /* Status */
1565- gboolean ready;
1566- gboolean connected;
1567- gchar *root_dir;
1568- SyncdaemonAuthentication *auth;
1569-};
1570-
1571-/* Signals */
1572-enum {
1573- READY_SIGNAL,
1574- CONNECTED_SIGNAL,
1575- DISCONNECTED_SIGNAL,
1576- STATUS_CHANGED_SIGNAL,
1577- ERROR_SIGNAL,
1578- EVENT_SIGNAL,
1579- FOLDER_CREATED_SIGNAL,
1580- FOLDER_DELETED_SIGNAL,
1581- FOLDER_SUBSCRIBED_SIGNAL,
1582- FOLDER_UNSUBSCRIBED_SIGNAL,
1583- FILE_PUBLISHED_SIGNAL,
1584- FILE_UNPUBLISHED_SIGNAL,
1585- SHARE_CREATED_SIGNAL,
1586- SHARE_DELETED_SIGNAL,
1587- DOWNLOAD_STARTED_SIGNAL,
1588- DOWNLOAD_FILE_PROGRESS_SIGNAL,
1589- DOWNLOAD_FINISHED_SIGNAL,
1590- UPLOAD_STARTED_SIGNAL,
1591- UPLOAD_FILE_PROGRESS_SIGNAL,
1592- UPLOAD_FINISHED_SIGNAL,
1593- QUOTA_EXCEEDED_SIGNAL,
1594- LAST_SIGNAL
1595-};
1596-
1597-static guint daemon_signals[LAST_SIGNAL] = { 0, };
1598-
1599-static void
1600-syncdaemon_daemon_finalize (GObject *object)
1601-{
1602- SyncdaemonDaemon *daemon = SYNCDAEMON_DAEMON (object);
1603-
1604- if (daemon->priv != NULL) {
1605- g_hash_table_destroy (daemon->priv->subinterfaces);
1606-
1607- if (daemon->priv->dbus_proxy != NULL)
1608- g_object_unref (daemon->priv->dbus_proxy);
1609-
1610- if (daemon->priv->bus != NULL) {
1611-#ifdef HAVE_GDBUS
1612- g_object_unref (G_OBJECT (daemon->priv->bus));
1613-#else
1614- dbus_g_connection_unref (daemon->priv->bus);
1615-#endif
1616- }
1617-
1618- if (daemon->priv->root_dir != NULL)
1619- g_free (daemon->priv->root_dir);
1620-
1621- if (daemon->priv->auth != NULL)
1622- g_object_unref (G_OBJECT (daemon->priv->auth));
1623-
1624- g_free (daemon->priv);
1625- }
1626-
1627- G_OBJECT_CLASS (syncdaemon_daemon_parent_class)->finalize (object);
1628-}
1629-
1630-static void
1631-syncdaemon_daemon_class_init (SyncdaemonDaemonClass *klass)
1632-{
1633- GObjectClass *object_class = G_OBJECT_CLASS (klass);
1634-
1635- object_class->finalize = syncdaemon_daemon_finalize;
1636-
1637- /* Register signals */
1638- daemon_signals[READY_SIGNAL] = g_signal_new ("ready",
1639- G_TYPE_FROM_CLASS (klass),
1640- (GSignalFlags) G_SIGNAL_RUN_LAST,
1641- G_STRUCT_OFFSET (SyncdaemonDaemonClass, ready),
1642- NULL, NULL,
1643- g_cclosure_marshal_VOID__VOID,
1644- G_TYPE_NONE, 0);
1645- daemon_signals[CONNECTED_SIGNAL] = g_signal_new ("connected",
1646- G_TYPE_FROM_CLASS (klass),
1647- (GSignalFlags) G_SIGNAL_RUN_LAST,
1648- G_STRUCT_OFFSET (SyncdaemonDaemonClass, connected),
1649- NULL, NULL,
1650- g_cclosure_marshal_VOID__VOID,
1651- G_TYPE_NONE, 0);
1652- daemon_signals[DISCONNECTED_SIGNAL] = g_signal_new ("disconnected",
1653- G_TYPE_FROM_CLASS (klass),
1654- (GSignalFlags) G_SIGNAL_RUN_LAST,
1655- G_STRUCT_OFFSET (SyncdaemonDaemonClass, disconnected),
1656- NULL, NULL,
1657- g_cclosure_marshal_VOID__VOID,
1658- G_TYPE_NONE, 0);
1659- daemon_signals[STATUS_CHANGED_SIGNAL] = g_signal_new ("status_changed",
1660- G_TYPE_FROM_CLASS (klass),
1661- (GSignalFlags) G_SIGNAL_RUN_LAST,
1662- G_STRUCT_OFFSET (SyncdaemonDaemonClass, status_changed),
1663- NULL, NULL,
1664- g_cclosure_marshal_VOID__OBJECT,
1665- G_TYPE_NONE, 1,
1666- G_TYPE_OBJECT);
1667- daemon_signals[EVENT_SIGNAL] = g_signal_new ("event",
1668- G_TYPE_FROM_CLASS (klass),
1669- (GSignalFlags) G_SIGNAL_RUN_LAST,
1670- G_STRUCT_OFFSET (SyncdaemonDaemonClass, event),
1671- NULL, NULL,
1672- g_cclosure_marshal_VOID__POINTER,
1673- G_TYPE_NONE, 1,
1674- G_TYPE_POINTER);
1675- daemon_signals[ERROR_SIGNAL] = g_signal_new ("error",
1676- G_TYPE_FROM_CLASS (klass),
1677- (GSignalFlags) G_SIGNAL_RUN_LAST,
1678- G_STRUCT_OFFSET (SyncdaemonDaemonClass, error),
1679- NULL, NULL,
1680- _syncdaemon_marshal_VOID__STRING_POINTER,
1681- G_TYPE_NONE, 2,
1682- G_TYPE_STRING, G_TYPE_POINTER);
1683- daemon_signals[FOLDER_CREATED_SIGNAL] = g_signal_new ("folder_created",
1684- G_TYPE_FROM_CLASS (klass),
1685- (GSignalFlags) G_SIGNAL_RUN_LAST,
1686- G_STRUCT_OFFSET (SyncdaemonDaemonClass, folder_created),
1687- NULL, NULL,
1688- _syncdaemon_marshal_VOID__BOOLEAN_OBJECT,
1689- G_TYPE_NONE, 2,
1690- G_TYPE_BOOLEAN,
1691- G_TYPE_OBJECT);
1692- daemon_signals[FOLDER_DELETED_SIGNAL] = g_signal_new ("folder_deleted",
1693- G_TYPE_FROM_CLASS (klass),
1694- (GSignalFlags) G_SIGNAL_RUN_LAST,
1695- G_STRUCT_OFFSET (SyncdaemonDaemonClass, folder_deleted),
1696- NULL, NULL,
1697- _syncdaemon_marshal_VOID__BOOLEAN_OBJECT,
1698- G_TYPE_NONE, 2,
1699- G_TYPE_BOOLEAN,
1700- G_TYPE_OBJECT);
1701- daemon_signals[FOLDER_SUBSCRIBED_SIGNAL] = g_signal_new ("folder_subscribed",
1702- G_TYPE_FROM_CLASS (klass),
1703- (GSignalFlags) G_SIGNAL_RUN_LAST,
1704- G_STRUCT_OFFSET (SyncdaemonDaemonClass, folder_subscribed),
1705- NULL, NULL,
1706- _syncdaemon_marshal_VOID__BOOLEAN_OBJECT,
1707- G_TYPE_NONE, 2,
1708- G_TYPE_BOOLEAN,
1709- G_TYPE_OBJECT);
1710- daemon_signals[FOLDER_UNSUBSCRIBED_SIGNAL] = g_signal_new ("folder_unsubscribed",
1711- G_TYPE_FROM_CLASS (klass),
1712- (GSignalFlags) G_SIGNAL_RUN_LAST,
1713- G_STRUCT_OFFSET (SyncdaemonDaemonClass, folder_unsubscribed),
1714- NULL, NULL,
1715- _syncdaemon_marshal_VOID__BOOLEAN_OBJECT,
1716- G_TYPE_NONE, 2,
1717- G_TYPE_BOOLEAN,
1718- G_TYPE_OBJECT);
1719- daemon_signals[FILE_PUBLISHED_SIGNAL] = g_signal_new ("file_published",
1720- G_TYPE_FROM_CLASS (klass),
1721- (GSignalFlags) G_SIGNAL_RUN_LAST,
1722- G_STRUCT_OFFSET (SyncdaemonDaemonClass, file_published),
1723- NULL, NULL,
1724- _syncdaemon_marshal_VOID__BOOLEAN_OBJECT,
1725- G_TYPE_NONE, 2,
1726- G_TYPE_BOOLEAN,
1727- G_TYPE_OBJECT);
1728- daemon_signals[FILE_UNPUBLISHED_SIGNAL] = g_signal_new ("file_unpublished",
1729- G_TYPE_FROM_CLASS (klass),
1730- (GSignalFlags) G_SIGNAL_RUN_LAST,
1731- G_STRUCT_OFFSET (SyncdaemonDaemonClass, file_unpublished),
1732- NULL, NULL,
1733- _syncdaemon_marshal_VOID__BOOLEAN_OBJECT,
1734- G_TYPE_NONE, 2,
1735- G_TYPE_BOOLEAN,
1736- G_TYPE_OBJECT);
1737- daemon_signals[SHARE_CREATED_SIGNAL] = g_signal_new ("share_created",
1738- G_TYPE_FROM_CLASS (klass),
1739- (GSignalFlags) G_SIGNAL_RUN_LAST,
1740- G_STRUCT_OFFSET (SyncdaemonDaemonClass, share_created),
1741- NULL, NULL,
1742- _syncdaemon_marshal_VOID__BOOLEAN_OBJECT,
1743- G_TYPE_NONE, 2,
1744- G_TYPE_BOOLEAN,
1745- G_TYPE_OBJECT);
1746- daemon_signals[SHARE_DELETED_SIGNAL] = g_signal_new ("share_deleted",
1747- G_TYPE_FROM_CLASS (klass),
1748- (GSignalFlags) G_SIGNAL_RUN_LAST,
1749- G_STRUCT_OFFSET (SyncdaemonDaemonClass, share_deleted),
1750- NULL, NULL,
1751- _syncdaemon_marshal_VOID__BOOLEAN_OBJECT,
1752- G_TYPE_NONE, 2,
1753- G_TYPE_BOOLEAN,
1754- G_TYPE_OBJECT);
1755- daemon_signals[DOWNLOAD_STARTED_SIGNAL] = g_signal_new ("download_started",
1756- G_TYPE_FROM_CLASS (klass),
1757- (GSignalFlags) G_SIGNAL_RUN_LAST,
1758- G_STRUCT_OFFSET (SyncdaemonDaemonClass, download_started),
1759- NULL, NULL,
1760- g_cclosure_marshal_VOID__STRING,
1761- G_TYPE_NONE, 1,
1762- G_TYPE_STRING);
1763- daemon_signals[DOWNLOAD_FILE_PROGRESS_SIGNAL] = g_signal_new ("download_file_progress",
1764- G_TYPE_FROM_CLASS (klass),
1765- (GSignalFlags) G_SIGNAL_RUN_LAST,
1766- G_STRUCT_OFFSET (SyncdaemonDaemonClass, download_file_progress),
1767- NULL, NULL,
1768- _syncdaemon_marshal_VOID__STRING_OBJECT,
1769- G_TYPE_NONE, 2,
1770- G_TYPE_STRING, G_TYPE_OBJECT);
1771- daemon_signals[DOWNLOAD_FINISHED_SIGNAL] = g_signal_new ("download_finished",
1772- G_TYPE_FROM_CLASS (klass),
1773- (GSignalFlags) G_SIGNAL_RUN_LAST,
1774- G_STRUCT_OFFSET (SyncdaemonDaemonClass, download_finished),
1775- NULL, NULL,
1776- _syncdaemon_marshal_VOID__STRING_OBJECT,
1777- G_TYPE_NONE, 2,
1778- G_TYPE_STRING, G_TYPE_OBJECT);
1779- daemon_signals[UPLOAD_STARTED_SIGNAL] = g_signal_new ("upload_started",
1780- G_TYPE_FROM_CLASS (klass),
1781- (GSignalFlags) G_SIGNAL_RUN_LAST,
1782- G_STRUCT_OFFSET (SyncdaemonDaemonClass, upload_started),
1783- NULL, NULL,
1784- g_cclosure_marshal_VOID__STRING,
1785- G_TYPE_NONE, 1,
1786- G_TYPE_STRING);
1787- daemon_signals[UPLOAD_FILE_PROGRESS_SIGNAL] = g_signal_new ("upload_file_progress",
1788- G_TYPE_FROM_CLASS (klass),
1789- (GSignalFlags) G_SIGNAL_RUN_LAST,
1790- G_STRUCT_OFFSET (SyncdaemonDaemonClass, upload_file_progress),
1791- NULL, NULL,
1792- _syncdaemon_marshal_VOID__STRING_OBJECT,
1793- G_TYPE_NONE, 2,
1794- G_TYPE_STRING, G_TYPE_OBJECT);
1795- daemon_signals[UPLOAD_FINISHED_SIGNAL] = g_signal_new ("upload_finished",
1796- G_TYPE_FROM_CLASS (klass),
1797- (GSignalFlags) G_SIGNAL_RUN_LAST,
1798- G_STRUCT_OFFSET (SyncdaemonDaemonClass, upload_finished),
1799- NULL, NULL,
1800- _syncdaemon_marshal_VOID__STRING_OBJECT,
1801- G_TYPE_NONE, 2,
1802- G_TYPE_STRING, G_TYPE_OBJECT);
1803- daemon_signals[QUOTA_EXCEEDED_SIGNAL] = g_signal_new ("quota_exceeded",
1804- G_TYPE_FROM_CLASS (klass),
1805- (GSignalFlags) G_SIGNAL_RUN_LAST,
1806- G_STRUCT_OFFSET (SyncdaemonDaemonClass, quota_exceeded),
1807- NULL, NULL,
1808- g_cclosure_marshal_VOID__POINTER,
1809- G_TYPE_NONE, 1,
1810- G_TYPE_POINTER);
1811-}
1812-
1813-static void
1814-quota_exceeded_cb (DBusGProxy *proxy, GHashTable *volume_info, gpointer user_data)
1815-{
1816- SyncdaemonDaemon *daemon = SYNCDAEMON_DAEMON (user_data);
1817-
1818- if (daemon != NULL)
1819- g_signal_emit_by_name (daemon, "quota_exceeded", volume_info);
1820-}
1821-
1822-static gboolean
1823-ready_signal_idle_cb (gpointer user_data)
1824-{
1825- SyncdaemonDaemon *daemon = SYNCDAEMON_DAEMON (user_data);
1826-
1827- g_signal_emit (daemon, daemon_signals[READY_SIGNAL], 0);
1828-
1829- return FALSE;
1830-}
1831-
1832-static void
1833-setup_daemon_interface (SyncdaemonDaemon *daemon)
1834-{
1835- GObject *proxy = NULL;
1836-
1837- if (daemon->priv->daemon_interface != NULL)
1838- g_object_unref (daemon->priv->daemon_interface);
1839- daemon->priv->daemon_interface = g_object_new (SYNCDAEMON_TYPE_INTERFACE,
1840- "daemon", daemon,
1841- NULL);
1842- proxy = syncdaemon_interface_setup_proxy (SYNCDAEMON_INTERFACE (daemon->priv->daemon_interface),
1843- SYNCDAEMON_DBUS_NAME, "/",
1844- "com.ubuntuone.SyncDaemon.SyncDaemon");
1845- if (proxy != NULL) {
1846- daemon->priv->ready = TRUE;
1847-
1848- dbus_g_proxy_add_signal (DBUS_G_PROXY (proxy), "QuotaExceeded",
1849- dbus_g_type_get_map ("GHashTable",
1850- G_TYPE_STRING,
1851- G_TYPE_STRING),
1852- G_TYPE_INVALID);
1853- dbus_g_proxy_connect_signal (DBUS_G_PROXY (proxy), "QuotaExceeded",
1854- G_CALLBACK (quota_exceeded_cb),
1855- daemon, NULL);
1856-
1857- /* Now get all the interfaces so that we get the signals from them */
1858- syncdaemon_daemon_get_config_interface (daemon);
1859- syncdaemon_daemon_get_events_interface (daemon);
1860- syncdaemon_daemon_get_filesystem_interface (daemon);
1861- syncdaemon_daemon_get_folders_interface (daemon);
1862- syncdaemon_daemon_get_publicfiles_interface (daemon);
1863- syncdaemon_daemon_get_shares_interface (daemon);
1864- syncdaemon_daemon_get_status_interface (daemon);
1865-
1866- /* Emit the signal in an idle callback so that callers get it when syncdaemon is running
1867- and hence signal is emitted in the _init method */
1868- g_idle_add ((GSourceFunc) ready_signal_idle_cb, daemon);
1869- }
1870-
1871-}
1872-
1873-static void
1874-name_owner_changed_cb (DBusGProxy *proxy,
1875- const char *name,
1876- const char *old_owner,
1877- const char *new_owner,
1878- gpointer user_data)
1879-{
1880- SyncdaemonDaemon *daemon = SYNCDAEMON_DAEMON (user_data);
1881-
1882- if (g_strcmp0 (name, SYNCDAEMON_DBUS_NAME) == 0) {
1883- if (new_owner != NULL && strlen (new_owner) > 0) {
1884- g_debug ("Got notification of SyncDaemon startup in NameOwnerChanged");
1885- setup_daemon_interface (daemon);
1886- } else {
1887- daemon->priv->ready = FALSE;
1888-
1889- g_debug ("Syncdaemon service died");
1890- if (daemon->priv->daemon_interface != NULL) {
1891- g_object_unref (daemon->priv->daemon_interface);
1892- daemon->priv->daemon_interface = NULL;
1893- }
1894-
1895- g_hash_table_remove_all (daemon->priv->subinterfaces);
1896- daemon->priv->connected = FALSE;
1897- }
1898- }
1899-}
1900-
1901-static void
1902-syncdaemon_daemon_init (SyncdaemonDaemon *daemon)
1903-{
1904- gboolean has_owner;
1905- GError *error = NULL;
1906-
1907- daemon->priv = g_new0 (SyncdaemonDaemonPrivate, 1);
1908-
1909- daemon->priv->ready = FALSE;
1910- daemon->priv->connected = FALSE;
1911- daemon->priv->subinterfaces = g_hash_table_new_full (g_str_hash, g_str_equal,
1912- g_free, g_object_unref);
1913- daemon->priv->auth = g_object_new (SYNCDAEMON_TYPE_AUTHENTICATION, NULL);
1914-
1915- /* Initialize DBus */
1916-#ifdef HAVE_GDBUS
1917- daemon->priv->bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
1918-#else
1919- daemon->priv->bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
1920-#endif
1921- if (error != NULL) {
1922- g_warning ("Couldn't get session bus: %s", error->message);
1923- g_error_free (error);
1924- return;
1925- }
1926-
1927- daemon->priv->dbus_proxy = dbus_g_proxy_new_for_name (daemon->priv->bus,
1928- "org.freedesktop.DBus",
1929- "/org/freedesktop/DBus",
1930- "org.freedesktop.DBus");
1931-
1932- /* Check if syncdaemon is running */
1933- error = NULL;
1934- if (org_freedesktop_DBus_name_has_owner (daemon->priv->dbus_proxy, SYNCDAEMON_DBUS_NAME, &has_owner, &error)) {
1935- if (has_owner) {
1936- /* Already running, so initialize ourselves */
1937- g_debug ("SyncDaemon already running, initializing SyncdaemonDaemon object");
1938- setup_daemon_interface (daemon);
1939- } else
1940- g_debug ("Syncdaemon not running, waiting for it to start in NameOwnerChanged");
1941- } else {
1942- /* The DBus call failed, so just wait for SyncDaemon to start in name_owner_changed_cb */
1943- g_warning ("Error calling NameHasOwner: %s", error->message);
1944- g_error_free (error);
1945- }
1946-
1947- /* Listen to DBus for syncdaemon restarts */
1948- dbus_g_proxy_add_signal (DBUS_G_PROXY (daemon->priv->dbus_proxy), "NameOwnerChanged",
1949- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
1950- G_TYPE_INVALID);
1951- dbus_g_proxy_connect_signal (DBUS_G_PROXY (daemon->priv->dbus_proxy),
1952- "NameOwnerChanged",
1953- G_CALLBACK (name_owner_changed_cb),
1954- daemon, NULL);
1955-}
1956-
1957-/**
1958- * syncdaemon_daemon_new:
1959- *
1960- * Create a new #SyncdaemonDaemon object, which provides access to the
1961- * Syncdaemon daemon.
1962- *
1963- * Return value: A new #SyncdaemonDaemon object.
1964- */
1965-SyncdaemonDaemon *
1966-syncdaemon_daemon_new (void)
1967-{
1968- return g_object_new (SYNCDAEMON_TYPE_DAEMON, NULL);
1969-}
1970-
1971-/**
1972- * syncdaemon_daemon_is_ready:
1973- */
1974-gboolean
1975-syncdaemon_daemon_is_ready (SyncdaemonDaemon *daemon)
1976-{
1977- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
1978-
1979- return daemon->priv->ready;
1980-}
1981-
1982-static void
1983-connect_response_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
1984-{
1985- GError *error = NULL;
1986- SyncdaemonDaemon *daemon = (SyncdaemonDaemon *) user_data;
1987-
1988- if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) {
1989- daemon->priv->connected = TRUE;
1990- g_signal_emit (daemon, daemon_signals[CONNECTED_SIGNAL], 0);
1991- } else {
1992- g_warning ("Syncdaemon cannot connect: %s", error->message);
1993- g_error_free (error);
1994- }
1995-}
1996-
1997-/**
1998- * syncdaemon_daemon_connect:
1999- */
2000-gboolean
2001-syncdaemon_daemon_connect (SyncdaemonDaemon *daemon)
2002-{
2003- GObject *proxy;
2004-
2005- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2006-
2007- proxy = syncdaemon_interface_get_proxy_object (SYNCDAEMON_INTERFACE (daemon->priv->daemon_interface));
2008- if (proxy != NULL) {
2009-#ifdef HAVE_GDBUS
2010-#else
2011- if (!dbus_g_proxy_begin_call (DBUS_G_PROXY (proxy), "connect",
2012- connect_response_cb, daemon, NULL,
2013- G_TYPE_INVALID)) {
2014- g_warning ("Call to 'connect' method failed");
2015-
2016- return FALSE;
2017- }
2018-#endif
2019- }
2020-
2021- return TRUE;
2022-}
2023-
2024-static void
2025-disconnect_response_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
2026-{
2027- GError *error = NULL;
2028- SyncdaemonDaemon *daemon = (SyncdaemonDaemon *) user_data;
2029-
2030- if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) {
2031- daemon->priv->connected = FALSE;
2032- g_signal_emit (daemon, daemon_signals[DISCONNECTED_SIGNAL], 0);
2033- } else {
2034- g_warning ("Syncdaemon cannot disconnect: %s", error->message);
2035- g_error_free (error);
2036- }
2037-}
2038-
2039-/**
2040- * syncdaemon_daemon_interface_disconnect:
2041- */
2042-gboolean
2043-syncdaemon_daemon_disconnect (SyncdaemonDaemon *daemon)
2044-{
2045- GObject *proxy;
2046-
2047- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2048-
2049- proxy = syncdaemon_interface_get_proxy_object (SYNCDAEMON_INTERFACE (daemon->priv->daemon_interface));
2050- if (proxy != NULL) {
2051-#ifdef HAVE_GDBUS
2052-#else
2053- if (!dbus_g_proxy_begin_call (DBUS_G_PROXY (proxy), "disconnect",
2054- disconnect_response_cb, daemon, NULL,
2055- G_TYPE_INVALID)) {
2056- g_warning ("Call to 'disconnect' method failed");
2057-
2058- return FALSE;
2059- }
2060-#endif
2061- }
2062-
2063- return TRUE;
2064-}
2065-
2066-/**
2067- * syncdaemon_daemon_interface_quit:
2068- */
2069-gboolean
2070-syncdaemon_daemon_quit (SyncdaemonDaemon *daemon)
2071-{
2072- GObject *proxy;
2073-
2074- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2075-
2076- proxy = syncdaemon_interface_get_proxy_object (SYNCDAEMON_INTERFACE (daemon->priv->daemon_interface));
2077- if (proxy != NULL) {
2078- GError *error = NULL;
2079-
2080-#ifdef HAVE_GDBUS
2081-#else
2082- if (!dbus_g_proxy_call (DBUS_G_PROXY (proxy), "quit", &error,
2083- G_TYPE_INVALID,
2084- G_TYPE_INVALID)) {
2085- g_warning ("Could not quit syncdaemon: %s", error->message);
2086- g_error_free (error);
2087-
2088- return FALSE;
2089- }
2090-#endif
2091- }
2092-
2093- return TRUE;
2094-}
2095-
2096-/**
2097- * syncdaemon_daemon_get_root_dir:
2098- */
2099-const gchar *
2100-syncdaemon_daemon_get_root_dir (SyncdaemonDaemon *daemon)
2101-{
2102- GObject *proxy;
2103-
2104- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2105-
2106- if (daemon->priv->root_dir != NULL)
2107- return (const gchar *) daemon->priv->root_dir;
2108-
2109- proxy = syncdaemon_interface_get_proxy_object (SYNCDAEMON_INTERFACE (daemon->priv->daemon_interface));
2110- if (proxy != NULL) {
2111- gchar *new_root_dir;
2112- GError *error = NULL;
2113-
2114-#ifdef HAVE_GDBUS
2115-#else
2116- if (!dbus_g_proxy_call (DBUS_G_PROXY (proxy), "get_rootdir", &error,
2117- G_TYPE_INVALID,
2118- G_TYPE_STRING, &new_root_dir,
2119- G_TYPE_INVALID)) {
2120- g_warning ("Could not get syncdaemon's root dir: %s", error->message);
2121- g_error_free (error);
2122-
2123- return NULL;
2124- }
2125-#endif
2126-
2127- daemon->priv->root_dir = new_root_dir;
2128-
2129- return (const gchar *) daemon->priv->root_dir;
2130- }
2131-
2132- return NULL;
2133-}
2134-
2135-/**
2136- * syncdaemon_daemon_has_network:
2137- */
2138-gboolean
2139-syncdaemon_daemon_has_network (SyncdaemonDaemon *daemon)
2140-{
2141- SyncdaemonInterface *interface;
2142- gboolean result = FALSE;
2143-
2144- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2145-
2146- interface = syncdaemon_daemon_get_status_interface (daemon);
2147- if (SYNCDAEMON_IS_STATUS_INTERFACE (interface)) {
2148- SyncdaemonStatusInfo *status_info;
2149-
2150- status_info = syncdaemon_status_interface_get_current_status (SYNCDAEMON_STATUS_INTERFACE (interface));
2151- if (g_strrstr (syncdaemon_status_info_get_connection (status_info), "With Network") != NULL)
2152- result = TRUE;
2153-
2154- g_object_unref (G_OBJECT (status_info));
2155- }
2156-
2157- return result;
2158-}
2159-
2160-/**
2161- * syncdaemon_daemon_get_authentication:
2162- */
2163-SyncdaemonAuthentication *
2164-syncdaemon_daemon_get_authentication (SyncdaemonDaemon *daemon)
2165-{
2166- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2167-
2168- return daemon->priv->auth;
2169-}
2170-
2171-/**
2172- * syncdaemon_daemon_get_bandwidth_throttling:
2173- * @daemon: A #SyncdaemonDaemon object
2174- *
2175- * Get whether bandwidth throttling is enabled or not.
2176- *
2177- * Return value: TRUE if enabled, FALSE if disabled.
2178- */
2179-gboolean
2180-syncdaemon_daemon_get_bandwidth_throttling (SyncdaemonDaemon *daemon)
2181-{
2182- SyncdaemonInterface *interface;
2183-
2184- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2185-
2186- interface = syncdaemon_daemon_get_config_interface (daemon);
2187- if (SYNCDAEMON_IS_CONFIG_INTERFACE (interface))
2188- return syncdaemon_config_interface_get_bandwidth_throttling (SYNCDAEMON_CONFIG_INTERFACE (interface));
2189-
2190- return FALSE;
2191-}
2192-
2193-/**
2194- * syncdaemon_daemon_set_bandwidth_throttling:
2195- * @daemon: A #SyncdaemonDaemon object
2196- * @enabled: Whether to enable bandwidth throttling or not.
2197- *
2198- * Enable or disable bandwidth throttling.
2199- */
2200-void
2201-syncdaemon_daemon_set_bandwidth_throttling (SyncdaemonDaemon *daemon, gboolean enabled)
2202-{
2203- SyncdaemonInterface *interface;
2204-
2205- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2206-
2207- interface = syncdaemon_daemon_get_config_interface (daemon);
2208- if (SYNCDAEMON_IS_CONFIG_INTERFACE (interface))
2209- syncdaemon_config_interface_set_bandwidth_throttling (SYNCDAEMON_CONFIG_INTERFACE (interface), enabled);
2210-}
2211-
2212-/**
2213- * syncdaemon_daemon_get_files_sync:
2214- * @daemon: A #SyncdaemonDaemon object
2215- *
2216- * Get whether file syncing is enabled or not.
2217- *
2218- * Return value: TRUE if enabled, FALSE if disabled.
2219- */
2220-gboolean
2221-syncdaemon_daemon_get_files_sync (SyncdaemonDaemon *daemon)
2222-{
2223- SyncdaemonInterface *interface;
2224-
2225- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2226-
2227- interface = syncdaemon_daemon_get_config_interface (daemon);
2228- if (SYNCDAEMON_IS_CONFIG_INTERFACE (interface))
2229- return syncdaemon_config_interface_get_files_sync (SYNCDAEMON_CONFIG_INTERFACE (interface));
2230-
2231- return FALSE;
2232-}
2233-
2234-/**
2235- * syncdaemon_daemon_set_files_sync:
2236- * @daemon: A #SyncdaemonDaemon object
2237- * @enabled: Whether to enable file syncing or not.
2238- *
2239- * Enable or disable file syncing.
2240- */
2241-void
2242-syncdaemon_daemon_set_files_sync (SyncdaemonDaemon *daemon, gboolean enabled)
2243-{
2244- SyncdaemonInterface *interface;
2245-
2246- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2247-
2248- interface = syncdaemon_daemon_get_config_interface (daemon);
2249- if (SYNCDAEMON_IS_CONFIG_INTERFACE (interface))
2250- syncdaemon_config_interface_set_files_sync (SYNCDAEMON_CONFIG_INTERFACE (interface), enabled);
2251-}
2252-
2253-/**
2254- * syncdaemon_daemon_get_throttling_limits:
2255- * @daemon: A #SyncdaemonDaemon object
2256- * @download: Placeholder for download limits
2257- * @upload: Placeholder for upload limits
2258- *
2259- * Retrieve download and upload throttling limits.
2260- */
2261-void
2262-syncdaemon_daemon_get_throttling_limits (SyncdaemonDaemon *daemon, gint *download, gint *upload)
2263-{
2264- SyncdaemonInterface *interface;
2265-
2266- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2267-
2268- interface = syncdaemon_daemon_get_config_interface (daemon);
2269- if (interface != NULL) {
2270- syncdaemon_config_interface_get_throttling_limits (SYNCDAEMON_CONFIG_INTERFACE (interface),
2271- download,
2272- upload);
2273- }
2274-}
2275-
2276-/**
2277- * syncdaemon_daemon_set_throttling_limits:
2278- * @daemon: A #SyncdaemonDaemon object
2279- * @download: Download limit
2280- * @upload: Upload limit
2281- *
2282- * Set download and upload throttling limits.
2283- */
2284-void
2285-syncdaemon_daemon_set_throttling_limits (SyncdaemonDaemon *daemon, gint download, gint upload)
2286-{
2287- SyncdaemonInterface *interface;
2288-
2289- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2290-
2291- interface = syncdaemon_daemon_get_config_interface (daemon);
2292- if (interface != NULL) {
2293- syncdaemon_config_interface_set_throttling_limits (SYNCDAEMON_CONFIG_INTERFACE (interface),
2294- download,
2295- upload);
2296- }
2297-}
2298-
2299-/**
2300- * syncdaemon_daemon_get_udf_autosubscribe:
2301- * @daemon: A #SyncdaemonDaemon object
2302- *
2303- * Get whether autosubscription for UDFs is enabled or not.
2304- *
2305- * Return value: TRUE if enabled, FALSE if disabled.
2306- */
2307-gboolean
2308-syncdaemon_daemon_get_udf_autosubscribe (SyncdaemonDaemon *daemon)
2309-{
2310- SyncdaemonInterface *interface;
2311-
2312- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2313-
2314- interface = syncdaemon_daemon_get_config_interface (daemon);
2315- if (SYNCDAEMON_IS_CONFIG_INTERFACE (interface))
2316- return syncdaemon_config_interface_get_udf_autosubscribe (SYNCDAEMON_CONFIG_INTERFACE (interface));
2317-
2318- return FALSE;
2319-}
2320-
2321-/**
2322- * syncdaemon_daemon_set_udf_autosubscribe:
2323- * @daemon: A #SyncdaemonDaemon object
2324- * @enabled: Whether to enable UDF autosubscription or not.
2325- *
2326- * Enable or disable UDF autosubscription.
2327- */
2328-void
2329-syncdaemon_daemon_set_udf_autosubscribe (SyncdaemonDaemon *daemon, gboolean enabled)
2330-{
2331- SyncdaemonInterface *interface;
2332-
2333- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2334-
2335- interface = syncdaemon_daemon_get_config_interface (daemon);
2336- if (SYNCDAEMON_IS_CONFIG_INTERFACE (interface))
2337- syncdaemon_config_interface_set_udf_autosubscribe (SYNCDAEMON_CONFIG_INTERFACE (interface), enabled);
2338-}
2339-
2340-/**
2341- * syncdaemon_daemon_get_metadata:
2342- * @daemon: A #SyncdaemonDaemon object
2343- * @path: Path to check metadata for
2344- * @with_subtree_sync_check: For folders, whether to check the status of all its children
2345- *
2346- * Retrieve metadata for a file or folder inside a Ubuntu One directory.
2347- *
2348- * Return value: Metadata for the specified path.
2349- */
2350-SyncdaemonMetadata *
2351-syncdaemon_daemon_get_metadata (SyncdaemonDaemon *daemon, const gchar *path, gboolean with_subtree_sync_check)
2352-{
2353- SyncdaemonInterface *interface;
2354-
2355- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2356-
2357- interface = syncdaemon_daemon_get_filesystem_interface (daemon);
2358- if (interface != NULL) {
2359- return syncdaemon_filesystem_interface_get_metadata (SYNCDAEMON_FILESYSTEM_INTERFACE (interface),
2360- path,
2361- with_subtree_sync_check);
2362- }
2363-
2364- return NULL;
2365-}
2366-
2367-/**
2368- * syncdaemon_daemon_get_folders:
2369- * @daemon: A #SyncdaemonDaemon object
2370- *
2371- * Retrieve the list of folders setup for synchronization with Ubuntu One.
2372- *
2373- * Return value: A list of #SyncdaemonFolderInfo containing all the folders being
2374- * synchronized by the user. When no longer needed, the list should be freed
2375- * by calling g_slist_free.
2376- */
2377-GSList *
2378-syncdaemon_daemon_get_folders (SyncdaemonDaemon *daemon)
2379-{
2380- SyncdaemonInterface *interface;
2381-
2382- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2383-
2384- interface = syncdaemon_daemon_get_folders_interface (daemon);
2385- if (interface != NULL)
2386- return syncdaemon_folders_interface_get_folders (SYNCDAEMON_FOLDERS_INTERFACE (interface));
2387-
2388- return NULL;
2389-}
2390-
2391-/**
2392- * syncdaemon_daemon_get_folder_info:
2393- * @daemon: A #SyncdaemonDaemon object
2394- * @path: Full path of the folder for which to retrieve information.
2395- *
2396- * Get information about a folder under Ubuntu One.
2397- *
2398- * Return value: A #SyncdaemonFolderInfo object containing all the information
2399- * for the node. When no longer needed, it should be freed by calling
2400- * g_object_unref.
2401- */
2402-SyncdaemonFolderInfo *
2403-syncdaemon_daemon_get_folder_info (SyncdaemonDaemon *daemon, const gchar *path)
2404-{
2405- SyncdaemonInterface *interface;
2406-
2407- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2408-
2409- interface = syncdaemon_daemon_get_folders_interface (daemon);
2410- if (interface != NULL)
2411- return syncdaemon_folders_interface_get_info (SYNCDAEMON_FOLDERS_INTERFACE (interface), path);
2412-
2413- return NULL;
2414-}
2415-
2416-/**
2417- * syncdaemon_daemon_is_folder_enabled:
2418- * @daemon: A #SyncdaemonDaemon object
2419- * @path: The folder path to check
2420- * @is_root: Placeholder for returning whether the given path is a U1 root folder
2421- *
2422- * Check whether a given path is a folder enabled for synchronization to U1.
2423- *
2424- * Return value: TRUE if the folder is enabled, FALSE otherwise.
2425- */
2426-gboolean
2427-syncdaemon_daemon_is_folder_enabled (SyncdaemonDaemon *daemon, const gchar *path, gboolean *is_root)
2428-{
2429- const gchar *root;
2430- gchar *root_with_slash;
2431- gboolean managed = FALSE, is_subscribed = FALSE;
2432- gchar *dirpath;
2433- SyncdaemonInterface *interface;
2434-
2435- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2436- g_return_val_if_fail (path != NULL, FALSE);
2437-
2438- *is_root = FALSE;
2439-
2440- /* First check the root folder */
2441- root = syncdaemon_daemon_get_root_dir (daemon);
2442- if (g_strcmp0 (path, root) == 0) {
2443- *is_root = TRUE;
2444- return TRUE;
2445- } else {
2446- root_with_slash = g_build_filename (root, G_DIR_SEPARATOR_S, NULL);
2447-
2448- if (g_str_has_prefix (path, root_with_slash)) {
2449- g_free(root_with_slash);
2450- return TRUE;
2451- }
2452- g_free(root_with_slash);
2453- }
2454- /* Now check the 'Shared With Me' directory */
2455- dirpath = g_build_filename (root, "Shared With Me", NULL);
2456- if (g_strcmp0 (path, dirpath) == 0) {
2457- g_free (dirpath);
2458- return FALSE;
2459- }
2460- g_free (dirpath);
2461-
2462- /* And finally check UDFs */
2463- interface = syncdaemon_daemon_get_folders_interface (daemon);
2464- if (SYNCDAEMON_IS_FOLDERS_INTERFACE (interface)) {
2465- GSList *udfs, *l;
2466-
2467- udfs = syncdaemon_folders_interface_get_folders (SYNCDAEMON_FOLDERS_INTERFACE (interface));
2468- for (l = udfs; l != NULL; l = l->next) {
2469- const gchar *tmp_path;
2470- gchar *tmp_path_with_slash;
2471- SyncdaemonFolderInfo *finfo = SYNCDAEMON_FOLDER_INFO (l->data);
2472-
2473- tmp_path = syncdaemon_folder_info_get_path (finfo);
2474- is_subscribed = syncdaemon_folder_info_get_subscribed (finfo);
2475-
2476- tmp_path_with_slash = g_strconcat (tmp_path, G_DIR_SEPARATOR_S, NULL);
2477- if (g_strcmp0 (path, tmp_path) == 0) {
2478- managed = is_subscribed;
2479- *is_root = TRUE;
2480- break;
2481- } else if (g_str_has_prefix (path, tmp_path_with_slash)) {
2482- managed = is_subscribed;
2483- break;
2484- }
2485- g_free (tmp_path_with_slash);
2486- }
2487-
2488- g_slist_free (udfs);
2489- }
2490-
2491- return managed;
2492-}
2493-
2494-/**
2495- * syncdaemon_daemon_create_folder:
2496- * @daemon: A #SyncdaemonDaemon object
2497- * @path: The full path of the folder to create
2498- *
2499- * Enable a folder for Ubuntu One synchronization.
2500- *
2501- * The result of the operation can be retrieved by connecting to the "folder_created"
2502- * signal of the #SyncdaemonDaemon object.
2503- */
2504-void
2505-syncdaemon_daemon_create_folder (SyncdaemonDaemon *daemon, const gchar *path)
2506-{
2507- SyncdaemonInterface *interface;
2508-
2509- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2510-
2511- interface = syncdaemon_daemon_get_folders_interface (daemon);
2512- if (interface != NULL)
2513- syncdaemon_folders_interface_create (SYNCDAEMON_FOLDERS_INTERFACE (interface), path);
2514- else
2515- g_signal_emit (daemon, daemon_signals[FOLDER_CREATED_SIGNAL], 0, FALSE, NULL);
2516-}
2517-
2518-/**
2519- * syncdaemon_daemon_delete_folder:
2520- * @daemon: A #SyncdaemonDaemon object
2521- * @path: The full path of the folder to delete
2522- *
2523- * Disable a folder for Ubuntu One synchronization.
2524- *
2525- * The result of the operation can be retrieved by connecting to the "folder_deleted"
2526- * signal of the #SyncdaemonDaemon object.
2527- */
2528-void
2529-syncdaemon_daemon_delete_folder (SyncdaemonDaemon *daemon, const gchar *path)
2530-{
2531- SyncdaemonInterface *interface;
2532-
2533- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2534-
2535- interface = syncdaemon_daemon_get_folders_interface (daemon);
2536- if (interface != NULL)
2537- syncdaemon_folders_interface_delete (SYNCDAEMON_FOLDERS_INTERFACE (interface), path);
2538- else
2539- g_signal_emit (daemon, daemon_signals[FOLDER_DELETED_SIGNAL], 0, FALSE, NULL);
2540-}
2541-
2542-/**
2543- * syncdaemon_daemon_subscribe_folder:
2544- * @daemon: A #SyncdaemonDaemon object
2545- * @path: The full path of the folder to subscribe
2546- *
2547- * Subscribe a folder for Ubuntu One synchronization.
2548- *
2549- * The result of the operation can be retrieved by connecting to the "folder_subscribed"
2550- * signal of the #SyncdaemonDaemon object.
2551- */
2552-void
2553-syncdaemon_daemon_subscribe_folder (SyncdaemonDaemon *daemon, const gchar *path)
2554-{
2555- SyncdaemonInterface *interface;
2556-
2557- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2558-
2559- interface = syncdaemon_daemon_get_folders_interface (daemon);
2560- if (interface != NULL)
2561- syncdaemon_folders_interface_subscribe (SYNCDAEMON_FOLDERS_INTERFACE (interface), path);
2562- else
2563- g_signal_emit (daemon, daemon_signals[FOLDER_SUBSCRIBED_SIGNAL], 0, FALSE, NULL);
2564-}
2565-
2566-/**
2567- * syncdaemon_daemon_unsubscribe_folder:
2568- * @daemon: A #SyncdaemonDaemon object
2569- * @path: The full path of the folder to unsubscribe
2570- *
2571- * Unsubscribe a folder from Ubuntu One synchronization.
2572- *
2573- * The result of the operation can be retrieved by connecting to the "folder_unsubscribed"
2574- * signal of the #SyncdaemonDaemon object.
2575- */
2576-void
2577-syncdaemon_daemon_unsubscribe_folder (SyncdaemonDaemon *daemon, const gchar *path)
2578-{
2579- SyncdaemonInterface *interface;
2580-
2581- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2582-
2583- interface = syncdaemon_daemon_get_folders_interface (daemon);
2584- if (interface != NULL)
2585- syncdaemon_folders_interface_unsubscribe (SYNCDAEMON_FOLDERS_INTERFACE (interface), path);
2586- else
2587- g_signal_emit (daemon, daemon_signals[FOLDER_UNSUBSCRIBED_SIGNAL], 0, FALSE, NULL);
2588-}
2589-
2590-/**
2591- * syncdaemon_daemon_publish_file:
2592- * @daemon: A #SyncdaemonDaemon object
2593- * @path: Full path of the file to be published
2594- *
2595- * Publish a file on Ubuntu One. When the file is successfully published, the "file_published"
2596- * signal will be emitted.
2597- *
2598- * Return value: TRUE if successful, FALSE otherwise.
2599- */
2600-gboolean
2601-syncdaemon_daemon_publish_file (SyncdaemonDaemon *daemon, const gchar *path)
2602-{
2603- SyncdaemonMetadata *metadata;
2604- gboolean result = FALSE;
2605-
2606- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2607-
2608- /* First, retrieve the metadata */
2609- metadata = syncdaemon_daemon_get_metadata (daemon, path, FALSE);
2610- if (metadata != NULL) {
2611- SyncdaemonInterface *interface;
2612-
2613- interface = syncdaemon_daemon_get_publicfiles_interface (daemon);
2614- syncdaemon_publicfiles_interface_change_public_access (
2615- SYNCDAEMON_PUBLICFILES_INTERFACE (interface),
2616- syncdaemon_metadata_get_share_id (metadata),
2617- syncdaemon_metadata_get_node_id (metadata),
2618- TRUE);
2619-
2620- result = TRUE;
2621-
2622- g_object_unref (metadata);
2623- }
2624-
2625- return result;
2626-}
2627-
2628-/**
2629- * syncdaemon_daemon_unpublish_file:
2630- * @daemon: A #SyncdaemonDaemon object
2631- * @path: Full path of the file to be unpublished
2632- *
2633- * Unpublish a file from Ubuntu One. When the file is successfully unpublished, the "file_unpublished"
2634- * signal will be emitted.
2635- *
2636- * Return value: TRUE if successful, FALSE otherwise.
2637- */
2638-gboolean
2639-syncdaemon_daemon_unpublish_file (SyncdaemonDaemon *daemon, const gchar *path)
2640-{
2641- SyncdaemonMetadata *metadata;
2642- gboolean result = FALSE;
2643-
2644- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), FALSE);
2645-
2646- /* First, retrieve the metadata */
2647- metadata = syncdaemon_daemon_get_metadata (daemon, path, FALSE);
2648- if (metadata != NULL) {
2649- SyncdaemonInterface *interface;
2650-
2651- interface = syncdaemon_daemon_get_publicfiles_interface (daemon);
2652- syncdaemon_publicfiles_interface_change_public_access (
2653- SYNCDAEMON_PUBLICFILES_INTERFACE (interface),
2654- syncdaemon_metadata_get_share_id (metadata),
2655- syncdaemon_metadata_get_node_id (metadata),
2656- FALSE);
2657-
2658- result = TRUE;
2659-
2660- g_object_unref (metadata);
2661- }
2662-
2663- return result;
2664-}
2665-
2666-/**
2667- * syncdaemon_daemon_get_public_files:
2668- * @daemon: A #SyncdaemonDaemon object
2669- *
2670- * Retrieve the list of public files.
2671- *
2672- * Return value: A #GSList of #SyncdaemonFileInfo objects, each of which describes
2673- * a published file for the user. When no longer needed, this list should be
2674- * freed by calling g_slist_free, but the data within the list should never
2675- * be freed, as it belongs to the library.
2676- */
2677-GSList *
2678-syncdaemon_daemon_get_public_files (SyncdaemonDaemon *daemon)
2679-{
2680- SyncdaemonInterface *interface;
2681-
2682- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2683-
2684- interface = syncdaemon_daemon_get_publicfiles_interface (daemon);
2685- if (interface != NULL) {
2686- return syncdaemon_publicfiles_interface_get_public_files (
2687- SYNCDAEMON_PUBLICFILES_INTERFACE (interface));
2688- }
2689-
2690- return NULL;
2691-}
2692-
2693-/**
2694- * syncdaemon_daemon_create_share:
2695- * @daemon: A #SyncdaemonDaemon object
2696- * @path: Full path of the folder to be shared
2697- * @usernames: List of users with whom to share the folder
2698- * @name: Name to be used for the share
2699- * @allow_modifications: Whether to allow modifications to the list of users
2700- *
2701- * Share a Ubuntu One folder with a list of users.
2702- *
2703- * The result of the operation can be retrieved by connecting to the "share_created"
2704- * signal of the #SyncdaemonDaemon object.
2705- */
2706-void
2707-syncdaemon_daemon_create_share (SyncdaemonDaemon *daemon,
2708- const gchar *path,
2709- GSList *usernames,
2710- const gchar *name,
2711- gboolean allow_modifications)
2712-{
2713- SyncdaemonInterface *interface;
2714-
2715- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2716-
2717- interface = syncdaemon_daemon_get_shares_interface (daemon);
2718- if (interface != NULL) {
2719- syncdaemon_shares_interface_create (SYNCDAEMON_SHARES_INTERFACE (interface),
2720- path,
2721- usernames,
2722- name,
2723- allow_modifications);
2724- } else
2725- g_signal_emit (daemon, daemon_signals[SHARE_CREATED_SIGNAL], 0, FALSE, NULL);
2726-}
2727-
2728-/**
2729- * syncdaemon_daemon_delete_share:
2730- * @daemon: A #SyncdaemonDaemon object
2731- * @path: Full path of the folder to be shared
2732- *
2733- * Stop sharing a Ubuntu One folder.
2734- *
2735- * The result of the operation can be retrieved by connecting to the "share_deleted"
2736- * signal of the #SyncdaemonDaemon object.
2737- */
2738-void
2739-syncdaemon_daemon_delete_share (SyncdaemonDaemon *daemon, const gchar *path)
2740-{
2741- SyncdaemonInterface *interface;
2742-
2743- g_return_if_fail (SYNCDAEMON_IS_DAEMON (daemon));
2744-
2745- interface = syncdaemon_daemon_get_shares_interface (daemon);
2746- if (interface != NULL)
2747- syncdaemon_shares_interface_delete (SYNCDAEMON_SHARES_INTERFACE (interface), path);
2748- else
2749- g_signal_emit (daemon, daemon_signals[SHARE_DELETED_SIGNAL], 0, FALSE, NULL);
2750-}
2751-
2752-/**
2753- * syncdaemon_daemon_get_shared_folders:
2754- * @daemon: A #SyncdaemonDaemon object
2755- *
2756- * Get the list of folders shared by the user with other users.
2757- *
2758- * Return value: A GSList of #SyncdaemonShareInfo objects. When no longer needed,
2759- * the list should be freed by calling #g_slist_free.
2760- */
2761-GSList *
2762-syncdaemon_daemon_get_shared_folders (SyncdaemonDaemon *daemon)
2763-{
2764- SyncdaemonInterface *interface;
2765-
2766- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2767-
2768- interface = syncdaemon_daemon_get_shares_interface (daemon);
2769- if (interface != NULL)
2770- return syncdaemon_shares_interface_get_shared (SYNCDAEMON_SHARES_INTERFACE (interface));
2771-
2772- return NULL;
2773-}
2774-
2775-/**
2776- * syncdaemon_daemon_get_shares:
2777- * @daemon: A #SyncdaemonDaemon object
2778- *
2779- * Get the list of folders shared by other users with the current user.
2780- *
2781- * Return value: A GSList of #SyncdaemonShareInfo objects. When no longer needed,
2782- * the list should be freed by calling #g_slist_free.
2783- */
2784-GSList *
2785-syncdaemon_daemon_get_shares (SyncdaemonDaemon *daemon)
2786-{
2787- SyncdaemonInterface *interface;
2788-
2789- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2790-
2791- interface = syncdaemon_daemon_get_shares_interface (daemon);
2792- if (interface != NULL)
2793- return syncdaemon_shares_interface_get_shares (SYNCDAEMON_SHARES_INTERFACE (interface));
2794-
2795- return NULL;
2796-}
2797-
2798-/**
2799- * syncdaemon_daemon_get_current_status:
2800- * @daemon: A #SyncdaemonDaemon object
2801- *
2802- * Retrieve the current status of SyncDaemon.
2803- *
2804- * Return value: A #SyncdaemonStatusInfo object containing information about
2805- * Syncdaemon's current status. When no longer needed, it should be freed by
2806- * calling g_object_unref.
2807- */
2808-SyncdaemonStatusInfo *
2809-syncdaemon_daemon_get_current_status (SyncdaemonDaemon *daemon)
2810-{
2811- SyncdaemonInterface *interface;
2812-
2813- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2814-
2815- interface = syncdaemon_daemon_get_status_interface (daemon);
2816- if (interface != NULL)
2817- return syncdaemon_status_interface_get_current_status (SYNCDAEMON_STATUS_INTERFACE (interface));
2818-
2819- return NULL;
2820-}
2821-
2822-/**
2823- * syncdaemon_daemon_get_current_downloads:
2824- * @daemon: A #SyncdaemonDaemon object
2825- *
2826- * Retrieve the list of downloads in progress.
2827- *
2828- * Return value: A GSList of #SyncdaemonTransferInfo objects, each of which contains
2829- * information about a file download in progress. The data in the list belongs to
2830- * the library, so when no longer needed, the list should be freed by just calling
2831- * g_slist_free.
2832- */
2833-GSList *
2834-syncdaemon_daemon_get_current_downloads (SyncdaemonDaemon *daemon)
2835-{
2836- SyncdaemonInterface *interface;
2837-
2838- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2839-
2840- interface = syncdaemon_daemon_get_status_interface (daemon);
2841- if (interface != NULL)
2842- return syncdaemon_status_interface_get_current_downloads (SYNCDAEMON_STATUS_INTERFACE (interface));
2843-
2844- return NULL;
2845-}
2846-
2847-/**
2848- * syncdaemon_daemon_get_current_uploads:
2849- * @daemon: A #SyncdaemonDaemon object
2850- *
2851- * Retrieve the list of uploads in progress.
2852- *
2853- * Return value: A GSList of #SyncdaemonTransferInfo objects, each of which contains
2854- * information about a file upload in progress. The data in the list belongs to
2855- * the library, so when no longer needed, the list should be freed by just calling
2856- * g_slist_free.
2857- */
2858-GSList *
2859-syncdaemon_daemon_get_current_uploads (SyncdaemonDaemon *daemon)
2860-{
2861- SyncdaemonInterface *interface;
2862-
2863- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2864-
2865- interface = syncdaemon_daemon_get_status_interface (daemon);
2866- if (interface != NULL)
2867- return syncdaemon_status_interface_get_current_uploads (SYNCDAEMON_STATUS_INTERFACE (interface));
2868-
2869- return NULL;
2870-}
2871-
2872-typedef SyncdaemonInterface * (* SDINewFunc) (SyncdaemonDaemon * daemon);
2873-
2874-static SyncdaemonInterface *
2875-get_interface (SyncdaemonDaemon *daemon, const gchar *path, SDINewFunc new_func)
2876-{
2877- SyncdaemonInterface *interface;
2878-
2879- interface = g_hash_table_lookup (daemon->priv->subinterfaces, path);
2880- if (interface == NULL) {
2881- interface = new_func (daemon);
2882- if (SYNCDAEMON_IS_INTERFACE (interface))
2883- g_hash_table_insert (daemon->priv->subinterfaces, g_strdup (path), interface);
2884- }
2885-
2886- return interface;
2887-}
2888-
2889-/**
2890- * syncdaemon_daemon_get_config_interface:
2891- */
2892-SyncdaemonInterface *
2893-syncdaemon_daemon_get_config_interface (SyncdaemonDaemon *daemon)
2894-{
2895- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2896-
2897- return get_interface (daemon, "/config",
2898- (SDINewFunc) syncdaemon_config_interface_new);
2899-}
2900-
2901-/**
2902- * syncdaemon_daemon_get_events_interface:
2903- */
2904-SyncdaemonInterface *
2905-syncdaemon_daemon_get_events_interface (SyncdaemonDaemon *daemon)
2906-{
2907- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2908-
2909- return get_interface (daemon, "/events",
2910- (SDINewFunc) syncdaemon_events_interface_new);
2911-}
2912-
2913-/**
2914- * syncdaemon_daemon_get_filesystem_interface:
2915- */
2916-SyncdaemonInterface *
2917-syncdaemon_daemon_get_filesystem_interface (SyncdaemonDaemon *daemon)
2918-{
2919- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2920-
2921- return get_interface (daemon, "/filesystem",
2922- (SDINewFunc) syncdaemon_filesystem_interface_new);
2923-}
2924-
2925-/**
2926- * syncdaemon_daemon_get_folders_interface:
2927- */
2928-SyncdaemonInterface *
2929-syncdaemon_daemon_get_folders_interface (SyncdaemonDaemon *daemon)
2930-{
2931- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2932-
2933- return get_interface (daemon, "/folders",
2934- (SDINewFunc) syncdaemon_folders_interface_new);
2935-}
2936-
2937-/**
2938- * syncdaemon_daemon_get_publicfiles_interface:
2939- */
2940-SyncdaemonInterface *
2941-syncdaemon_daemon_get_publicfiles_interface (SyncdaemonDaemon *daemon)
2942-{
2943- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2944-
2945- return get_interface (daemon, "/publicfiles",
2946- (SDINewFunc) syncdaemon_publicfiles_interface_new);
2947-}
2948-
2949-/**
2950- * syncdaemon_daemon_get_shares_interface:
2951- */
2952-SyncdaemonInterface *
2953-syncdaemon_daemon_get_shares_interface (SyncdaemonDaemon *daemon)
2954-{
2955- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2956-
2957- return get_interface (daemon, "/shares",
2958- (SDINewFunc) syncdaemon_shares_interface_new);
2959-}
2960-
2961-/**
2962- * syncdaemon_daemon_get_status_interface:
2963- */
2964-SyncdaemonInterface *
2965-syncdaemon_daemon_get_status_interface (SyncdaemonDaemon *daemon)
2966-{
2967- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
2968-
2969- return get_interface (daemon, "/status",
2970- (SDINewFunc) syncdaemon_status_interface_new);
2971-}
2972
2973=== removed file 'libsyncdaemon/syncdaemon-daemon.h'
2974--- libsyncdaemon/syncdaemon-daemon.h 2012-04-09 20:07:05 +0000
2975+++ libsyncdaemon/syncdaemon-daemon.h 1970-01-01 00:00:00 +0000
2976@@ -1,172 +0,0 @@
2977-/*
2978- * Syncdaemon API
2979- *
2980- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
2981- *
2982- * Copyright 2010-2012 Canonical Ltd.
2983- *
2984- * This program is free software: you can redistribute it and/or modify it
2985- * under the terms of the GNU General Public License version 3, as published
2986- * by the Free Software Foundation.
2987- *
2988- * This program is distributed in the hope that it will be useful, but
2989- * WITHOUT ANY WARRANTY; without even the implied warranties of
2990- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
2991- * PURPOSE. See the GNU General Public License for more details.
2992- *
2993- * You should have received a copy of the GNU General Public License along
2994- * with this program. If not, see <http://www.gnu.org/licenses/>.
2995- *
2996- * In addition, as a special exception, the copyright holders give
2997- * permission to link the code of portions of this program with the
2998- * OpenSSL library under certain conditions as described in each
2999- * individual source file, and distribute linked combinations
3000- * including the two.
3001- * You must obey the GNU General Public License in all respects
3002- * for all of the code used other than OpenSSL. If you modify
3003- * file(s) with this exception, you may extend this exception to your
3004- * version of the file(s), but you are not obligated to do so. If you
3005- * do not wish to do so, delete this exception statement from your
3006- * version. If you delete this exception statement from all source
3007- * files in the program, then also delete it here.
3008- *
3009- */
3010-
3011-#ifndef __SYNCDAEMON_DAEMON_H__
3012-#define __SYNCDAEMON_DAEMON_H__
3013-
3014-#include <glib-object.h>
3015-#include "syncdaemon-authentication.h"
3016-#include "syncdaemon-file-info.h"
3017-#include "syncdaemon-folder-info.h"
3018-#include "syncdaemon-interface.h"
3019-#include "syncdaemon-metadata.h"
3020-#include "syncdaemon-share-info.h"
3021-#include "syncdaemon-status-info.h"
3022-#include "syncdaemon-transfer-info.h"
3023-
3024-G_BEGIN_DECLS
3025-
3026-#define SYNCDAEMON_TYPE_DAEMON (syncdaemon_daemon_get_type ())
3027-#define SYNCDAEMON_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_DAEMON, SyncdaemonDaemon))
3028-#define SYNCDAEMON_IS_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_DAEMON))
3029-#define SYNCDAEMON_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_DAEMON, SyncdaemonDaemonClass))
3030-#define SYNCDAEMON_IS_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_DAEMON))
3031-#define SYNCDAEMON_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_DAEMON, SyncdaemonDaemonClass))
3032-
3033-typedef struct _SyncdaemonDaemonPrivate SyncdaemonDaemonPrivate;
3034-
3035-typedef struct {
3036- GObject parent;
3037- SyncdaemonDaemonPrivate *priv;
3038-} SyncdaemonDaemon;
3039-
3040-typedef struct {
3041- GObjectClass parent_class;
3042-
3043- /* Signals */
3044- void (* ready) (SyncdaemonDaemon *daemon);
3045-
3046- void (* connected) (SyncdaemonDaemon *daemon);
3047- void (* disconnected) (SyncdaemonDaemon *daemon);
3048- void (* status_changed) (SyncdaemonDaemon *daemon, SyncdaemonStatusInfo *status_info);
3049-
3050- void (* event) (SyncdaemonDaemon *daemon, GHashTable *event_dict);
3051- void (* error) (SyncdaemonDaemon *daemon, const gchar *signal, GHashTable *extra_args);
3052-
3053- void (* folder_created) (SyncdaemonDaemon *daemon, gboolean success, SyncdaemonFolderInfo *folder_info);
3054- void (* folder_deleted) (SyncdaemonDaemon *daemon, gboolean success, SyncdaemonFolderInfo *folder_info);
3055- void (* folder_subscribed) (SyncdaemonDaemon *daemon, gboolean success, SyncdaemonFolderInfo *folder_info);
3056- void (* folder_unsubscribed) (SyncdaemonDaemon *daemon, gboolean success, SyncdaemonFolderInfo *folder_info);
3057-
3058- void (* file_published) (SyncdaemonDaemon *daemon, gboolean success, SyncdaemonFileInfo *file_info);
3059- void (* file_unpublished) (SyncdaemonDaemon *daemon, gboolean success, SyncdaemonFileInfo *file_info);
3060-
3061- void (* share_created) (SyncdaemonDaemon *daemon, gboolean success, SyncdaemonShareInfo *share_info);
3062- void (* share_deleted) (SyncdaemonDaemon *daemon, gboolean success, SyncdaemonShareInfo *share_info);
3063-
3064- void (* download_started) (SyncdaemonDaemon *daemon, const gchar *path);
3065- void (* download_file_progress) (SyncdaemonDaemon *daemon, const gchar *path, SyncdaemonTransferInfo *tinfo);
3066- void (* download_finished) (SyncdaemonDaemon *daemon, const gchar *path, SyncdaemonTransferInfo *tinfo);
3067- void (* upload_started) (SyncdaemonDaemon *daemon, const gchar *path);
3068- void (* upload_file_progress) (SyncdaemonDaemon *daemon, const gchar *path, SyncdaemonTransferInfo *tinfo);
3069- void (* upload_finished) (SyncdaemonDaemon *daemon, const gchar *path, SyncdaemonTransferInfo *tinfo);
3070-
3071- void (* quota_exceeded) (SyncdaemonDaemon *daemon, GHashTable *volume_info);
3072-} SyncdaemonDaemonClass;
3073-
3074-GType syncdaemon_daemon_get_type (void);
3075-
3076-SyncdaemonDaemon *syncdaemon_daemon_new (void);
3077-
3078-gboolean syncdaemon_daemon_is_ready (SyncdaemonDaemon *daemon);
3079-
3080-gboolean syncdaemon_daemon_connect (SyncdaemonDaemon *daemon);
3081-gboolean syncdaemon_daemon_disconnect (SyncdaemonDaemon *daemon);
3082-gboolean syncdaemon_daemon_quit (SyncdaemonDaemon *daemon);
3083-const gchar *syncdaemon_daemon_get_root_dir (SyncdaemonDaemon *daemon);
3084-
3085-gboolean syncdaemon_daemon_has_network (SyncdaemonDaemon *daemon);
3086-SyncdaemonAuthentication *syncdaemon_daemon_get_authentication (SyncdaemonDaemon *daemon);
3087-
3088-/* Configuration */
3089-gboolean syncdaemon_daemon_get_bandwidth_throttling (SyncdaemonDaemon *daemon);
3090-void syncdaemon_daemon_set_bandwidth_throttling (SyncdaemonDaemon *daemon, gboolean enabled);
3091-gboolean syncdaemon_daemon_get_files_sync (SyncdaemonDaemon *daemon);
3092-void syncdaemon_daemon_set_files_sync (SyncdaemonDaemon *daemon, gboolean enabled);
3093-void syncdaemon_daemon_get_throttling_limits (SyncdaemonDaemon *daemon, gint *download, gint *upload);
3094-void syncdaemon_daemon_set_throttling_limits (SyncdaemonDaemon *daemon, gint download, gint upload);
3095-gboolean syncdaemon_daemon_get_udf_autosubscribe (SyncdaemonDaemon *daemon);
3096-void syncdaemon_daemon_set_udf_autosubscribe (SyncdaemonDaemon *daemon, gboolean enabled);
3097-
3098-/* File system operations */
3099-SyncdaemonMetadata *syncdaemon_daemon_get_metadata (SyncdaemonDaemon *daemon,
3100- const gchar *path,
3101- gboolean with_subtree_sync_check);
3102-
3103-
3104-/* Folders operations */
3105-GSList *syncdaemon_daemon_get_folders (SyncdaemonDaemon *daemon);
3106-SyncdaemonFolderInfo*syncdaemon_daemon_get_folder_info (SyncdaemonDaemon *daemon, const gchar *path);
3107-gboolean syncdaemon_daemon_is_folder_enabled (SyncdaemonDaemon *daemon,
3108- const gchar *path,
3109- gboolean *is_root);
3110-void syncdaemon_daemon_create_folder (SyncdaemonDaemon *daemon, const gchar *path);
3111-void syncdaemon_daemon_delete_folder (SyncdaemonDaemon *daemon, const gchar *path);
3112-void syncdaemon_daemon_subscribe_folder (SyncdaemonDaemon *daemon, const gchar *path);
3113-void syncdaemon_daemon_unsubscribe_folder (SyncdaemonDaemon *daemon, const gchar *path);
3114-
3115-/* Public files operations */
3116-gboolean syncdaemon_daemon_publish_file (SyncdaemonDaemon *daemon, const gchar *path);
3117-gboolean syncdaemon_daemon_unpublish_file (SyncdaemonDaemon *daemon, const gchar *path);
3118-GSList *syncdaemon_daemon_get_public_files (SyncdaemonDaemon *daemon);
3119-
3120-/* Shares operations */
3121-void syncdaemon_daemon_create_share (SyncdaemonDaemon *daemon,
3122- const gchar *path,
3123- GSList *usernames,
3124- const gchar *name,
3125- gboolean allow_modifications);
3126-void syncdaemon_daemon_delete_share (SyncdaemonDaemon *daemon, const gchar *path);
3127-GSList *syncdaemon_daemon_get_shared_folders (SyncdaemonDaemon *daemon);
3128-GSList *syncdaemon_daemon_get_shares (SyncdaemonDaemon *daemon);
3129-
3130-/* Status operations */
3131-SyncdaemonStatusInfo*syncdaemon_daemon_get_current_status (SyncdaemonDaemon *daemon);
3132-GSList *syncdaemon_daemon_get_current_downloads (SyncdaemonDaemon *daemon);
3133-GSList *syncdaemon_daemon_get_current_uploads (SyncdaemonDaemon *daemon);
3134-
3135-/*
3136- * Low level DBus interface access
3137- */
3138-SyncdaemonInterface *syncdaemon_daemon_get_config_interface (SyncdaemonDaemon *daemon);
3139-SyncdaemonInterface *syncdaemon_daemon_get_events_interface (SyncdaemonDaemon *daemon);
3140-SyncdaemonInterface *syncdaemon_daemon_get_filesystem_interface (SyncdaemonDaemon *daemon);
3141-SyncdaemonInterface *syncdaemon_daemon_get_folders_interface (SyncdaemonDaemon *daemon);
3142-SyncdaemonInterface *syncdaemon_daemon_get_publicfiles_interface (SyncdaemonDaemon *daemon);
3143-SyncdaemonInterface *syncdaemon_daemon_get_shares_interface (SyncdaemonDaemon *daemon);
3144-SyncdaemonInterface *syncdaemon_daemon_get_status_interface (SyncdaemonDaemon *daemon);
3145-
3146-G_END_DECLS
3147-
3148-#endif
3149
3150=== removed file 'libsyncdaemon/syncdaemon-events-interface.c'
3151--- libsyncdaemon/syncdaemon-events-interface.c 2012-04-09 20:07:05 +0000
3152+++ libsyncdaemon/syncdaemon-events-interface.c 1970-01-01 00:00:00 +0000
3153@@ -1,130 +0,0 @@
3154-/*
3155- * Syncdaemon API
3156- *
3157- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
3158- *
3159- * Copyright 2010-2012 Canonical Ltd.
3160- *
3161- * This program is free software: you can redistribute it and/or modify it
3162- * under the terms of the GNU General Public License version 3, as published
3163- * by the Free Software Foundation.
3164- *
3165- * This program is distributed in the hope that it will be useful, but
3166- * WITHOUT ANY WARRANTY; without even the implied warranties of
3167- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3168- * PURPOSE. See the GNU General Public License for more details.
3169- *
3170- * You should have received a copy of the GNU General Public License along
3171- * with this program. If not, see <http://www.gnu.org/licenses/>.
3172- *
3173- * In addition, as a special exception, the copyright holders give
3174- * permission to link the code of portions of this program with the
3175- * OpenSSL library under certain conditions as described in each
3176- * individual source file, and distribute linked combinations
3177- * including the two.
3178- * You must obey the GNU General Public License in all respects
3179- * for all of the code used other than OpenSSL. If you modify
3180- * file(s) with this exception, you may extend this exception to your
3181- * version of the file(s), but you are not obligated to do so. If you
3182- * do not wish to do so, delete this exception statement from your
3183- * version. If you delete this exception statement from all source
3184- * files in the program, then also delete it here.
3185- *
3186- */
3187-
3188-#include "config.h"
3189-#ifdef HAVE_GDBUS
3190-#else
3191-#include <dbus/dbus-glib.h>
3192-#endif
3193-#include "syncdaemon-events-interface.h"
3194-
3195-G_DEFINE_TYPE(SyncdaemonEventsInterface, syncdaemon_events_interface, SYNCDAEMON_TYPE_INTERFACE)
3196-
3197-struct _SyncdaemonEventsInterfacePrivate {
3198- GObject *proxy;
3199-};
3200-
3201-static void
3202-syncdaemon_events_interface_finalize (GObject *object)
3203-{
3204- SyncdaemonEventsInterface *interface = SYNCDAEMON_EVENTS_INTERFACE (object);
3205-
3206- if (interface->priv != NULL) {
3207- g_free (interface->priv);
3208- }
3209-
3210- G_OBJECT_CLASS (syncdaemon_events_interface_parent_class)->finalize (object);
3211-}
3212-
3213-static void
3214-syncdaemon_events_interface_class_init (SyncdaemonEventsInterfaceClass *klass)
3215-{
3216- GObjectClass *object_class = G_OBJECT_CLASS (klass);
3217-
3218- object_class->finalize = syncdaemon_events_interface_finalize;
3219-}
3220-
3221-static void
3222-event_cb (DBusGProxy *proxy, GHashTable *event_dict, gpointer user_data)
3223-{
3224- SyncdaemonDaemon *daemon = NULL;
3225- SyncdaemonEventsInterface *interface = SYNCDAEMON_EVENTS_INTERFACE (user_data);
3226-
3227- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
3228- if (daemon != NULL)
3229- g_signal_emit_by_name (daemon, "event", event_dict);
3230-}
3231-
3232-static void
3233-syncdaemon_events_interface_init (SyncdaemonEventsInterface *interface)
3234-{
3235- interface->priv = g_new0 (SyncdaemonEventsInterfacePrivate, 1);
3236-
3237- /* Setup DBus proxy */
3238- interface->priv->proxy = syncdaemon_interface_setup_proxy (SYNCDAEMON_INTERFACE (interface),
3239- "com.ubuntuone.SyncDaemon",
3240- "/events", "com.ubuntuone.SyncDaemon.Events");
3241- if (interface->priv->proxy != NULL) {
3242- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "Event",
3243- dbus_g_type_get_map ("GHashTable",
3244- G_TYPE_STRING,
3245- G_TYPE_STRING),
3246- G_TYPE_INVALID);
3247- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "Event",
3248- G_CALLBACK (event_cb), interface, NULL);
3249- }
3250-}
3251-
3252-/**
3253- * syncdaemon_events_interface_new:
3254- */
3255-SyncdaemonEventsInterface *
3256-syncdaemon_events_interface_new (SyncdaemonDaemon *daemon)
3257-{
3258- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
3259-
3260- return g_object_new (SYNCDAEMON_TYPE_EVENTS_INTERFACE, "daemon", daemon, NULL);
3261-}
3262-
3263-/**
3264- * syncdaemon_events_interface_push_event:
3265- */
3266-void
3267-syncdaemon_events_interface_push_event (SyncdaemonEventsInterface *interface,
3268- const gchar *event_name,
3269- const gchar **args)
3270-{
3271- GError *error = NULL;
3272-
3273- g_return_if_fail (SYNCDAEMON_IS_EVENTS_INTERFACE (interface));
3274-
3275- if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), "push_event", &error,
3276- G_TYPE_STRING, event_name,
3277- G_TYPE_STRV, args,
3278- G_TYPE_INVALID,
3279- G_TYPE_INVALID)) {
3280- g_warning ("Failed calling push_event: %s", error->message);
3281- g_error_free (error);
3282- }
3283-}
3284
3285=== removed file 'libsyncdaemon/syncdaemon-events-interface.h'
3286--- libsyncdaemon/syncdaemon-events-interface.h 2012-04-09 20:07:05 +0000
3287+++ libsyncdaemon/syncdaemon-events-interface.h 1970-01-01 00:00:00 +0000
3288@@ -1,71 +0,0 @@
3289-/*
3290- * Syncdaemon API
3291- *
3292- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
3293- *
3294- * Copyright 2010-2012 Canonical Ltd.
3295- *
3296- * This program is free software: you can redistribute it and/or modify it
3297- * under the terms of the GNU General Public License version 3, as published
3298- * by the Free Software Foundation.
3299- *
3300- * This program is distributed in the hope that it will be useful, but
3301- * WITHOUT ANY WARRANTY; without even the implied warranties of
3302- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3303- * PURPOSE. See the GNU General Public License for more details.
3304- *
3305- * You should have received a copy of the GNU General Public License along
3306- * with this program. If not, see <http://www.gnu.org/licenses/>.
3307- *
3308- * In addition, as a special exception, the copyright holders give
3309- * permission to link the code of portions of this program with the
3310- * OpenSSL library under certain conditions as described in each
3311- * individual source file, and distribute linked combinations
3312- * including the two.
3313- * You must obey the GNU General Public License in all respects
3314- * for all of the code used other than OpenSSL. If you modify
3315- * file(s) with this exception, you may extend this exception to your
3316- * version of the file(s), but you are not obligated to do so. If you
3317- * do not wish to do so, delete this exception statement from your
3318- * version. If you delete this exception statement from all source
3319- * files in the program, then also delete it here.
3320- *
3321- */
3322-
3323-#ifndef __SYNCDAEMON_EVENTS_INTERFACE_H__
3324-#define __SYNCDAEMON_EVENTS_INTERFACE_H__
3325-
3326-#include "syncdaemon-daemon.h"
3327-#include "syncdaemon-interface.h"
3328-
3329-G_BEGIN_DECLS
3330-
3331-#define SYNCDAEMON_TYPE_EVENTS_INTERFACE (syncdaemon_events_interface_get_type ())
3332-#define SYNCDAEMON_EVENTS_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_EVENTS_INTERFACE, SyncdaemonEventsInterface))
3333-#define SYNCDAEMON_IS_EVENTS_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_EVENTS_INTERFACE))
3334-#define SYNCDAEMON_EVENTS_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_EVENTS_INTERFACE, SyncdaemonEventsInterfaceClass))
3335-#define SYNCDAEMON_IS_EVENTS_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_EVENTS_INTERFACE))
3336-#define SYNCDAEMON_EVENTS_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_EVENTS_INTERFACE, SyncdaemonEventsInterfaceClass))
3337-
3338-typedef struct _SyncdaemonEventsInterfacePrivate SyncdaemonEventsInterfacePrivate;
3339-
3340-typedef struct {
3341- SyncdaemonInterface parent;
3342- SyncdaemonEventsInterfacePrivate *priv;
3343-} SyncdaemonEventsInterface;
3344-
3345-typedef struct {
3346- SyncdaemonInterfaceClass parent_class;
3347-} SyncdaemonEventsInterfaceClass;
3348-
3349-GType syncdaemon_events_interface_get_type (void);
3350-
3351-SyncdaemonEventsInterface *syncdaemon_events_interface_new (SyncdaemonDaemon *daemon);
3352-
3353-void syncdaemon_events_interface_push_event (SyncdaemonEventsInterface *interface,
3354- const gchar *event_name,
3355- const gchar **args);
3356-
3357-G_END_DECLS
3358-
3359-#endif
3360
3361=== removed file 'libsyncdaemon/syncdaemon-file-info.c'
3362--- libsyncdaemon/syncdaemon-file-info.c 2012-04-09 20:07:05 +0000
3363+++ libsyncdaemon/syncdaemon-file-info.c 1970-01-01 00:00:00 +0000
3364@@ -1,236 +0,0 @@
3365-/*
3366- * Syncdaemon API
3367- *
3368- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
3369- *
3370- * Copyright 2010-2012 Canonical Ltd.
3371- *
3372- * This program is free software: you can redistribute it and/or modify it
3373- * under the terms of the GNU General Public License version 3, as published
3374- * by the Free Software Foundation.
3375- *
3376- * This program is distributed in the hope that it will be useful, but
3377- * WITHOUT ANY WARRANTY; without even the implied warranties of
3378- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3379- * PURPOSE. See the GNU General Public License for more details.
3380- *
3381- * You should have received a copy of the GNU General Public License along
3382- * with this program. If not, see <http://www.gnu.org/licenses/>.
3383- *
3384- * In addition, as a special exception, the copyright holders give
3385- * permission to link the code of portions of this program with the
3386- * OpenSSL library under certain conditions as described in each
3387- * individual source file, and distribute linked combinations
3388- * including the two.
3389- * You must obey the GNU General Public License in all respects
3390- * for all of the code used other than OpenSSL. If you modify
3391- * file(s) with this exception, you may extend this exception to your
3392- * version of the file(s), but you are not obligated to do so. If you
3393- * do not wish to do so, delete this exception statement from your
3394- * version. If you delete this exception statement from all source
3395- * files in the program, then also delete it here.
3396- *
3397- */
3398-
3399-#include "syncdaemon-file-info.h"
3400-
3401-G_DEFINE_TYPE(SyncdaemonFileInfo, syncdaemon_file_info, G_TYPE_OBJECT)
3402-
3403-struct _SyncdaemonFileInfoPrivate {
3404- gchar *volume_id;
3405- gchar *node_id;
3406- gchar *public_url;
3407- gchar *path;
3408- gboolean is_public;
3409-};
3410-
3411-static void
3412-syncdaemon_file_info_finalize (GObject *object)
3413-{
3414- SyncdaemonFileInfo *finfo = SYNCDAEMON_FILE_INFO (object);
3415-
3416- if (finfo->priv != NULL) {
3417- if (finfo->priv->volume_id != NULL)
3418- g_free (finfo->priv->volume_id);
3419-
3420- if (finfo->priv->node_id != NULL)
3421- g_free (finfo->priv->node_id);
3422-
3423- if (finfo->priv->public_url != NULL)
3424- g_free (finfo->priv->public_url);
3425-
3426- if (finfo->priv->path != NULL)
3427- g_free (finfo->priv->path);
3428-
3429- g_free (finfo->priv);
3430- }
3431-
3432- G_OBJECT_CLASS (syncdaemon_file_info_parent_class)->finalize (object);
3433-}
3434-
3435-static void
3436-syncdaemon_file_info_class_init (SyncdaemonFileInfoClass *klass)
3437-{
3438- GObjectClass *object_class = G_OBJECT_CLASS (klass);
3439-
3440- object_class->finalize = syncdaemon_file_info_finalize;
3441-}
3442-
3443-static void
3444-syncdaemon_file_info_init (SyncdaemonFileInfo *finfo)
3445-{
3446- finfo->priv = g_new0 (SyncdaemonFileInfoPrivate, 1);
3447-}
3448-
3449-/**
3450- * syncdaemon_file_info_new:
3451- */
3452-SyncdaemonFileInfo *
3453-syncdaemon_file_info_new (void)
3454-{
3455- return g_object_new (SYNCDAEMON_TYPE_FILE_INFO, NULL);
3456-}
3457-
3458-/**
3459- * syncdaemon_file_info_new_from_hash_table:
3460- */
3461-SyncdaemonFileInfo *
3462-syncdaemon_file_info_new_from_hash_table (GHashTable *hash)
3463-{
3464- SyncdaemonFileInfo *finfo;
3465-
3466- finfo = g_object_new (SYNCDAEMON_TYPE_FILE_INFO, NULL);
3467- if (hash != NULL) {
3468- syncdaemon_file_info_set_volume_id (finfo, g_hash_table_lookup (hash, "volume_id"));
3469- syncdaemon_file_info_set_node_id (finfo, g_hash_table_lookup (hash, "node_id"));
3470- syncdaemon_file_info_set_public_url (finfo, g_hash_table_lookup (hash, "public_url"));
3471- syncdaemon_file_info_set_path (finfo, g_hash_table_lookup (hash, "path"));
3472- syncdaemon_file_info_set_is_public (
3473- finfo,
3474- g_strcmp0 (g_hash_table_lookup (hash, "is_public"), "True") == 0);
3475- }
3476-
3477- return finfo;
3478-}
3479-
3480-/**
3481- * syncdaemon_file_info_get_volume_id:
3482- */
3483-const gchar *
3484-syncdaemon_file_info_get_volume_id (SyncdaemonFileInfo *finfo)
3485-{
3486- g_return_val_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo), NULL);
3487-
3488- return (const gchar *) finfo->priv->volume_id;
3489-}
3490-
3491-/**
3492- * syncdaemon_file_info_set_volume_id:
3493- */
3494-void
3495-syncdaemon_file_info_set_volume_id (SyncdaemonFileInfo *finfo, const gchar *volume_id)
3496-{
3497- g_return_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo));
3498-
3499- if (finfo->priv->volume_id != NULL)
3500- g_free (finfo->priv->volume_id);
3501-
3502- finfo->priv->volume_id = g_strdup (volume_id);
3503-}
3504-
3505-/**
3506- * syncdaemon_file_info_get_node_id:
3507- */
3508-const gchar *
3509-syncdaemon_file_info_get_node_id (SyncdaemonFileInfo *finfo)
3510-{
3511- g_return_val_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo), NULL);
3512-
3513- return (const gchar *) finfo->priv->node_id;
3514-}
3515-
3516-/**
3517- * syncdaemon_file_info_set_node_id:
3518- */
3519-void
3520-syncdaemon_file_info_set_node_id (SyncdaemonFileInfo *finfo, const gchar *node_id)
3521-{
3522- g_return_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo));
3523-
3524- if (finfo->priv->node_id != NULL)
3525- g_free (finfo->priv->node_id);
3526-
3527- finfo->priv->node_id = g_strdup (node_id);
3528-}
3529-
3530-/**
3531- * syncdaemon_file_info_get_public_url:
3532- */
3533-const gchar *
3534-syncdaemon_file_info_get_public_url (SyncdaemonFileInfo *finfo)
3535-{
3536- g_return_val_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo), NULL);
3537-
3538- return (const gchar *) finfo->priv->public_url;
3539-}
3540-
3541-/**
3542- * syncdaemon_file_info_set_public_url:
3543- */
3544-void
3545-syncdaemon_file_info_set_public_url (SyncdaemonFileInfo *finfo, const gchar *public_url)
3546-{
3547- g_return_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo));
3548-
3549- if (finfo->priv->public_url != NULL)
3550- g_free (finfo->priv->public_url);
3551-
3552- finfo->priv->public_url = g_strdup (public_url);
3553-}
3554-
3555-/**
3556- * syncdaemon_file_info_get_path:
3557- */
3558-const gchar *
3559-syncdaemon_file_info_get_path (SyncdaemonFileInfo *finfo)
3560-{
3561- g_return_val_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo), NULL);
3562-
3563- return (const gchar *) finfo->priv->path;
3564-}
3565-
3566-/**
3567- * syncdaemon_file_info_set_path:
3568- */
3569-void
3570-syncdaemon_file_info_set_path (SyncdaemonFileInfo *finfo, const gchar *path)
3571-{
3572- g_return_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo));
3573-
3574- if (finfo->priv->path != NULL)
3575- g_free (finfo->priv->path);
3576-
3577- finfo->priv->path = g_strdup (path);
3578-}
3579-
3580-/**
3581- * syncdaemon_file_info_get_is_public:
3582- */
3583-gboolean
3584-syncdaemon_file_info_get_is_public (SyncdaemonFileInfo *finfo)
3585-{
3586- g_return_val_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo), FALSE);
3587-
3588- return finfo->priv->is_public;
3589-}
3590-
3591-/**
3592- * syncdaemon_file_info_set_is_public:
3593- */
3594-void
3595-syncdaemon_file_info_set_is_public (SyncdaemonFileInfo *finfo, gboolean is_public)
3596-{
3597- g_return_if_fail (SYNCDAEMON_IS_FILE_INFO (finfo));
3598-
3599- finfo->priv->is_public = is_public;
3600-}
3601
3602=== removed file 'libsyncdaemon/syncdaemon-file-info.h'
3603--- libsyncdaemon/syncdaemon-file-info.h 2012-04-09 20:07:05 +0000
3604+++ libsyncdaemon/syncdaemon-file-info.h 1970-01-01 00:00:00 +0000
3605@@ -1,78 +0,0 @@
3606-/*
3607- * Syncdaemon API
3608- *
3609- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
3610- *
3611- * Copyright 2010-2012 Canonical Ltd.
3612- *
3613- * This program is free software: you can redistribute it and/or modify it
3614- * under the terms of the GNU General Public License version 3, as published
3615- * by the Free Software Foundation.
3616- *
3617- * This program is distributed in the hope that it will be useful, but
3618- * WITHOUT ANY WARRANTY; without even the implied warranties of
3619- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3620- * PURPOSE. See the GNU General Public License for more details.
3621- *
3622- * You should have received a copy of the GNU General Public License along
3623- * with this program. If not, see <http://www.gnu.org/licenses/>.
3624- *
3625- * In addition, as a special exception, the copyright holders give
3626- * permission to link the code of portions of this program with the
3627- * OpenSSL library under certain conditions as described in each
3628- * individual source file, and distribute linked combinations
3629- * including the two.
3630- * You must obey the GNU General Public License in all respects
3631- * for all of the code used other than OpenSSL. If you modify
3632- * file(s) with this exception, you may extend this exception to your
3633- * version of the file(s), but you are not obligated to do so. If you
3634- * do not wish to do so, delete this exception statement from your
3635- * version. If you delete this exception statement from all source
3636- * files in the program, then also delete it here.
3637- *
3638- */
3639-
3640-#ifndef __SYNCDAEMON_FILE_INFO_H__
3641-#define __SYNCDAEMON_FILE_INFO_H__
3642-
3643-#include <glib-object.h>
3644-
3645-G_BEGIN_DECLS
3646-
3647-#define SYNCDAEMON_TYPE_FILE_INFO (syncdaemon_file_info_get_type ())
3648-#define SYNCDAEMON_FILE_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_FILE_INFO, SyncdaemonFileInfo))
3649-#define SYNCDAEMON_IS_FILE_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_FILE_INFO))
3650-#define SYNCDAEMON_FILE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_FILE_INFO, SyncdaemonFileInfoClass))
3651-#define SYNCDAEMON_IS_FILE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_FILE_INFO))
3652-#define SYNCDAEMON_FILE_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_FILE_INFO, SyncdaemonFileInfoClass))
3653-
3654-typedef struct _SyncdaemonFileInfoPrivate SyncdaemonFileInfoPrivate;
3655-
3656-typedef struct {
3657- GObject parent;
3658- SyncdaemonFileInfoPrivate *priv;
3659-} SyncdaemonFileInfo;
3660-
3661-typedef struct {
3662- GObjectClass parent_class;
3663-} SyncdaemonFileInfoClass;
3664-
3665-GType syncdaemon_file_info_get_type (void);
3666-SyncdaemonFileInfo *syncdaemon_file_info_new (void);
3667-SyncdaemonFileInfo *syncdaemon_file_info_new_from_hash_table (GHashTable *hash);
3668-
3669-const gchar *syncdaemon_file_info_get_volume_id (SyncdaemonFileInfo *finfo);
3670-void syncdaemon_file_info_set_volume_id (SyncdaemonFileInfo *finfo, const gchar *volume_id);
3671-const gchar *syncdaemon_file_info_get_node_id (SyncdaemonFileInfo *finfo);
3672-void syncdaemon_file_info_set_node_id (SyncdaemonFileInfo *finfo, const gchar *node_id);
3673-const gchar *syncdaemon_file_info_get_path (SyncdaemonFileInfo *finfo);
3674-void syncdaemon_file_info_set_path (SyncdaemonFileInfo *finfo, const gchar *path);
3675-
3676-gboolean syncdaemon_file_info_get_is_public (SyncdaemonFileInfo *finfo);
3677-void syncdaemon_file_info_set_is_public (SyncdaemonFileInfo *finfo, gboolean is_public);
3678-const gchar *syncdaemon_file_info_get_public_url (SyncdaemonFileInfo *finfo);
3679-void syncdaemon_file_info_set_public_url (SyncdaemonFileInfo *finfo, const gchar *public_url);
3680-
3681-G_END_DECLS
3682-
3683-#endif
3684
3685=== removed file 'libsyncdaemon/syncdaemon-filesystem-interface.c'
3686--- libsyncdaemon/syncdaemon-filesystem-interface.c 2012-04-09 20:07:05 +0000
3687+++ libsyncdaemon/syncdaemon-filesystem-interface.c 1970-01-01 00:00:00 +0000
3688@@ -1,190 +0,0 @@
3689-/*
3690- * Syncdaemon API
3691- *
3692- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
3693- *
3694- * Copyright 2010-2012 Canonical Ltd.
3695- *
3696- * This program is free software: you can redistribute it and/or modify it
3697- * under the terms of the GNU General Public License version 3, as published
3698- * by the Free Software Foundation.
3699- *
3700- * This program is distributed in the hope that it will be useful, but
3701- * WITHOUT ANY WARRANTY; without even the implied warranties of
3702- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3703- * PURPOSE. See the GNU General Public License for more details.
3704- *
3705- * You should have received a copy of the GNU General Public License along
3706- * with this program. If not, see <http://www.gnu.org/licenses/>.
3707- *
3708- * In addition, as a special exception, the copyright holders give
3709- * permission to link the code of portions of this program with the
3710- * OpenSSL library under certain conditions as described in each
3711- * individual source file, and distribute linked combinations
3712- * including the two.
3713- * You must obey the GNU General Public License in all respects
3714- * for all of the code used other than OpenSSL. If you modify
3715- * file(s) with this exception, you may extend this exception to your
3716- * version of the file(s), but you are not obligated to do so. If you
3717- * do not wish to do so, delete this exception statement from your
3718- * version. If you delete this exception statement from all source
3719- * files in the program, then also delete it here.
3720- *
3721- */
3722-
3723-#include "config.h"
3724-#ifdef HAVE_GDBUS
3725-#else
3726-#include <dbus/dbus-glib.h>
3727-#endif
3728-#include "syncdaemon-filesystem-interface.h"
3729-
3730-G_DEFINE_TYPE(SyncdaemonFilesystemInterface, syncdaemon_filesystem_interface, SYNCDAEMON_TYPE_INTERFACE)
3731-
3732-struct _SyncdaemonFilesystemInterfacePrivate {
3733- GObject *proxy;
3734-};
3735-
3736-static void
3737-syncdaemon_filesystem_interface_finalize (GObject *object)
3738-{
3739- SyncdaemonFilesystemInterface *interface = SYNCDAEMON_FILESYSTEM_INTERFACE (object);
3740-
3741- if (interface->priv != NULL) {
3742- g_free (interface->priv);
3743- }
3744-
3745- G_OBJECT_CLASS (syncdaemon_filesystem_interface_parent_class)->finalize (object);
3746-}
3747-
3748-static void
3749-syncdaemon_filesystem_interface_class_init (SyncdaemonFilesystemInterfaceClass *klass)
3750-{
3751- GObjectClass *object_class = G_OBJECT_CLASS (klass);
3752-
3753- object_class->finalize = syncdaemon_filesystem_interface_finalize;
3754-}
3755-
3756-static void
3757-syncdaemon_filesystem_interface_init (SyncdaemonFilesystemInterface *interface)
3758-{
3759- interface->priv = g_new0 (SyncdaemonFilesystemInterfacePrivate, 1);
3760-
3761- /* Setup DBus proxy */
3762- interface->priv->proxy = syncdaemon_interface_setup_proxy (SYNCDAEMON_INTERFACE (interface),
3763- "com.ubuntuone.SyncDaemon",
3764- "/filesystem", "com.ubuntuone.SyncDaemon.FileSystem");
3765-}
3766-
3767-/**
3768- * syncdaemon_filesystem_interface_new:
3769- */
3770-SyncdaemonFilesystemInterface *
3771-syncdaemon_filesystem_interface_new (SyncdaemonDaemon *daemon)
3772-{
3773- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
3774-
3775- return g_object_new (SYNCDAEMON_TYPE_FILESYSTEM_INTERFACE, "daemon", daemon, NULL);
3776-}
3777-
3778-/**
3779- * syncdaemon_filesystem_interface_get_metadata:
3780- */
3781-SyncdaemonMetadata *
3782-syncdaemon_filesystem_interface_get_metadata (SyncdaemonFilesystemInterface *interface,
3783- const gchar *path,
3784- gboolean with_subtree_sync_check)
3785-{
3786- GError *error = NULL;
3787- GHashTable *hash;
3788- const char *method;
3789-
3790- g_return_val_if_fail (SYNCDAEMON_IS_FILESYSTEM_INTERFACE (interface), NULL);
3791-
3792- if (with_subtree_sync_check)
3793- method = "get_metadata_and_quick_tree_synced";
3794- else
3795- method = "get_metadata";
3796-
3797- if (!dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), method, &error,
3798- G_TYPE_STRING, path,
3799- G_TYPE_INVALID,
3800- dbus_g_type_get_map ("GHashTable",
3801- G_TYPE_STRING,
3802- G_TYPE_STRING), &hash,
3803- G_TYPE_INVALID)) {
3804- g_warning ("Failed calling %s: %s", method, error->message);
3805- g_error_free (error);
3806-
3807- return NULL;
3808- }
3809-
3810- return syncdaemon_metadata_new_from_hash_table (hash);
3811-}
3812-
3813-typedef struct {
3814- SyncdaemonFilesystemInterface *interface;
3815- SyncdaemonGotMetadataFunc callback;
3816- gpointer user_data;
3817-} GotMetadataData;
3818-
3819-static void
3820-got_metadata_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
3821-{
3822- GHashTable *hash;
3823- GError *error = NULL;
3824- GotMetadataData *gmd = (GotMetadataData *) user_data;
3825-
3826- if (dbus_g_proxy_end_call (proxy, call_id, &error,
3827- dbus_g_type_get_map ("GHashTable",
3828- G_TYPE_STRING,
3829- G_TYPE_STRING), &hash,
3830- G_TYPE_INVALID)) {
3831- SyncdaemonMetadata *metadata;
3832-
3833- metadata = syncdaemon_metadata_new_from_hash_table (hash);
3834- gmd->callback (gmd->interface, TRUE, metadata, gmd->user_data);
3835-
3836- /* Free memory */
3837- g_object_unref (G_OBJECT (metadata));
3838- g_hash_table_destroy (hash);
3839- } else {
3840- g_warning ("Error getting metadata: %s", error->message);
3841- g_error_free (error);
3842- gmd->callback (gmd->interface, FALSE, NULL, gmd->user_data);
3843- }
3844-
3845- g_free (gmd);
3846-}
3847-
3848-/**
3849- * syncdaemon_filesystem_interface_get_metadata_async:
3850- */
3851-void
3852-syncdaemon_filesystem_interface_get_metadata_async (SyncdaemonFilesystemInterface *interface,
3853- const gchar *path,
3854- gboolean with_subtree_sync_check,
3855- SyncdaemonGotMetadataFunc callback,
3856- gpointer user_data)
3857-{
3858- GotMetadataData *gmd;
3859- const gchar *method;
3860-
3861- g_return_if_fail (SYNCDAEMON_IS_FILESYSTEM_INTERFACE (interface));
3862-
3863- if (with_subtree_sync_check)
3864- method = "get_metadata_and_quick_tree_synced";
3865- else
3866- method = "get_metadata";
3867-
3868- gmd = g_new0 (GotMetadataData, 1);
3869- gmd->interface = interface;
3870- gmd->callback = callback;
3871- gmd->user_data = user_data;
3872-
3873- dbus_g_proxy_begin_call (DBUS_G_PROXY (interface->priv->proxy),
3874- method,
3875- got_metadata_cb, gmd, NULL,
3876- G_TYPE_STRING, path,
3877- G_TYPE_INVALID);
3878-}
3879
3880=== removed file 'libsyncdaemon/syncdaemon-filesystem-interface.h'
3881--- libsyncdaemon/syncdaemon-filesystem-interface.h 2012-04-09 20:07:05 +0000
3882+++ libsyncdaemon/syncdaemon-filesystem-interface.h 1970-01-01 00:00:00 +0000
3883@@ -1,84 +0,0 @@
3884-/*
3885- * Syncdaemon API
3886- *
3887- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
3888- *
3889- * Copyright 2010-2012 Canonical Ltd.
3890- *
3891- * This program is free software: you can redistribute it and/or modify it
3892- * under the terms of the GNU General Public License version 3, as published
3893- * by the Free Software Foundation.
3894- *
3895- * This program is distributed in the hope that it will be useful, but
3896- * WITHOUT ANY WARRANTY; without even the implied warranties of
3897- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3898- * PURPOSE. See the GNU General Public License for more details.
3899- *
3900- * You should have received a copy of the GNU General Public License along
3901- * with this program. If not, see <http://www.gnu.org/licenses/>.
3902- *
3903- * In addition, as a special exception, the copyright holders give
3904- * permission to link the code of portions of this program with the
3905- * OpenSSL library under certain conditions as described in each
3906- * individual source file, and distribute linked combinations
3907- * including the two.
3908- * You must obey the GNU General Public License in all respects
3909- * for all of the code used other than OpenSSL. If you modify
3910- * file(s) with this exception, you may extend this exception to your
3911- * version of the file(s), but you are not obligated to do so. If you
3912- * do not wish to do so, delete this exception statement from your
3913- * version. If you delete this exception statement from all source
3914- * files in the program, then also delete it here.
3915- *
3916- */
3917-
3918-#ifndef __SYNCDAEMON_FILESYSTEM_INTERFACE_H__
3919-#define __SYNCDAEMON_FILESYSTEM_INTERFACE_H__
3920-
3921-#include "syncdaemon-daemon.h"
3922-#include "syncdaemon-interface.h"
3923-#include "syncdaemon-metadata.h"
3924-
3925-G_BEGIN_DECLS
3926-
3927-#define SYNCDAEMON_TYPE_FILESYSTEM_INTERFACE (syncdaemon_filesystem_interface_get_type ())
3928-#define SYNCDAEMON_FILESYSTEM_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_FILESYSTEM_INTERFACE, SyncdaemonFilesystemInterface))
3929-#define SYNCDAEMON_IS_FILESYSTEM_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_FILESYSTEM_INTERFACE))
3930-#define SYNCDAEMON_FILESYSTEM_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_FILESYSTEM_INTERFACE, SyncdaemonFilesystemInterfaceClass))
3931-#define SYNCDAEMON_IS_FILESYSTEM_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_FILESYSTEM_INTERFACE))
3932-#define SYNCDAEMON_FILESYSTEM_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_FILESYSTEM_INTERFACE, SyncdaemonFilesystemInterfaceClass))
3933-
3934-typedef struct _SyncdaemonFilesystemInterfacePrivate SyncdaemonFilesystemInterfacePrivate;
3935-
3936-typedef struct {
3937- SyncdaemonInterface parent;
3938- SyncdaemonFilesystemInterfacePrivate *priv;
3939-} SyncdaemonFilesystemInterface;
3940-
3941-typedef struct {
3942- SyncdaemonInterfaceClass parent_class;
3943-} SyncdaemonFilesystemInterfaceClass;
3944-
3945-GType syncdaemon_filesystem_interface_get_type (void);
3946-
3947-SyncdaemonFilesystemInterface *syncdaemon_filesystem_interface_new (SyncdaemonDaemon *daemon);
3948-
3949-SyncdaemonMetadata *syncdaemon_filesystem_interface_get_metadata (SyncdaemonFilesystemInterface *interface,
3950- const gchar *path,
3951- gboolean with_subtree_sync_check);
3952-
3953-typedef void (* SyncdaemonGotMetadataFunc) (SyncdaemonFilesystemInterface *interface,
3954- gboolean success,
3955- SyncdaemonMetadata *metadata,
3956- gpointer user_data);
3957-
3958-void syncdaemon_filesystem_interface_get_metadata_async (SyncdaemonFilesystemInterface *interface,
3959- const gchar *path,
3960- gboolean with_subtree_sync_check,
3961- SyncdaemonGotMetadataFunc callback,
3962- gpointer user_data);
3963-
3964-
3965-G_END_DECLS
3966-
3967-#endif
3968
3969=== removed file 'libsyncdaemon/syncdaemon-folder-info.c'
3970--- libsyncdaemon/syncdaemon-folder-info.c 2012-04-09 20:07:05 +0000
3971+++ libsyncdaemon/syncdaemon-folder-info.c 1970-01-01 00:00:00 +0000
3972@@ -1,176 +0,0 @@
3973-/*
3974- * Syncdaemon API
3975- *
3976- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
3977- *
3978- * Copyright 2010-2012 Canonical Ltd.
3979- *
3980- * This program is free software: you can redistribute it and/or modify it
3981- * under the terms of the GNU General Public License version 3, as published
3982- * by the Free Software Foundation.
3983- *
3984- * This program is distributed in the hope that it will be useful, but
3985- * WITHOUT ANY WARRANTY; without even the implied warranties of
3986- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3987- * PURPOSE. See the GNU General Public License for more details.
3988- *
3989- * You should have received a copy of the GNU General Public License along
3990- * with this program. If not, see <http://www.gnu.org/licenses/>.
3991- *
3992- * In addition, as a special exception, the copyright holders give
3993- * permission to link the code of portions of this program with the
3994- * OpenSSL library under certain conditions as described in each
3995- * individual source file, and distribute linked combinations
3996- * including the two.
3997- * You must obey the GNU General Public License in all respects
3998- * for all of the code used other than OpenSSL. If you modify
3999- * file(s) with this exception, you may extend this exception to your
4000- * version of the file(s), but you are not obligated to do so. If you
4001- * do not wish to do so, delete this exception statement from your
4002- * version. If you delete this exception statement from all source
4003- * files in the program, then also delete it here.
4004- *
4005- */
4006-
4007-#include "syncdaemon-folder-info.h"
4008-
4009-G_DEFINE_TYPE(SyncdaemonFolderInfo, syncdaemon_folder_info, G_TYPE_OBJECT)
4010-
4011-struct _SyncdaemonFolderInfoPrivate {
4012- gchar *path;
4013- gboolean subscribed;
4014- gchar *volume_id;
4015-};
4016-
4017-static void
4018-syncdaemon_folder_info_finalize (GObject *object)
4019-{
4020- SyncdaemonFolderInfo *finfo = SYNCDAEMON_FOLDER_INFO (object);
4021-
4022- if (finfo->priv != NULL) {
4023- if (finfo->priv->path != NULL)
4024- g_free (finfo->priv->path);
4025-
4026- if (finfo->priv->volume_id != NULL)
4027- g_free (finfo->priv->volume_id);
4028-
4029- g_free (finfo->priv);
4030- }
4031-
4032- G_OBJECT_CLASS (syncdaemon_folder_info_parent_class)->finalize (object);
4033-}
4034-
4035-static void
4036-syncdaemon_folder_info_class_init (SyncdaemonFolderInfoClass *klass)
4037-{
4038- GObjectClass *object_class = G_OBJECT_CLASS (klass);
4039-
4040- object_class->finalize = syncdaemon_folder_info_finalize;
4041-}
4042-
4043-static void
4044-syncdaemon_folder_info_init (SyncdaemonFolderInfo *finfo)
4045-{
4046- finfo->priv = g_new0 (SyncdaemonFolderInfoPrivate, 1);
4047-}
4048-
4049-/**
4050- * syncdaemon_folder_info_new:
4051- */
4052-SyncdaemonFolderInfo *
4053-syncdaemon_folder_info_new (void)
4054-{
4055- return g_object_new (SYNCDAEMON_TYPE_FOLDER_INFO, NULL);
4056-}
4057-
4058-/**
4059- * syncdaemon_folder_info_new_from_hash_table:
4060- */
4061-SyncdaemonFolderInfo *
4062-syncdaemon_folder_info_new_from_hash_table (GHashTable *hash)
4063-{
4064- SyncdaemonFolderInfo *finfo;
4065-
4066- finfo = g_object_new (SYNCDAEMON_TYPE_FOLDER_INFO, NULL);
4067- if (hash != NULL) {
4068- syncdaemon_folder_info_set_path (finfo, g_hash_table_lookup (hash, "path"));
4069- syncdaemon_folder_info_set_subscribed (
4070- finfo,
4071- g_strcmp0 (g_hash_table_lookup (hash, "subscribed"), "True") == 0);
4072- syncdaemon_folder_info_set_volume_id (finfo, g_hash_table_lookup (hash, "volume_id"));
4073- }
4074-
4075- return finfo;
4076-}
4077-
4078-/**
4079- * syncdaemon_folder_info_get_path:
4080- */
4081-const gchar *
4082-syncdaemon_folder_info_get_path (SyncdaemonFolderInfo *finfo)
4083-{
4084- g_return_val_if_fail (SYNCDAEMON_IS_FOLDER_INFO (finfo), NULL);
4085-
4086- return (const gchar *) finfo->priv->path;
4087-}
4088-
4089-/**
4090- * syncdaemon_folder_info_set_path:
4091- */
4092-void
4093-syncdaemon_folder_info_set_path (SyncdaemonFolderInfo *finfo, const gchar *path)
4094-{
4095- g_return_if_fail (SYNCDAEMON_IS_FOLDER_INFO (finfo));
4096-
4097- if (finfo->priv->path != NULL)
4098- g_free (finfo->priv->path);
4099-
4100- finfo->priv->path = g_strdup (path);
4101-}
4102-
4103-/**
4104- * syncdaemon_folder_info_get_subscribed:
4105- */
4106-gboolean
4107-syncdaemon_folder_info_get_subscribed (SyncdaemonFolderInfo *finfo)
4108-{
4109- g_return_val_if_fail (SYNCDAEMON_IS_FOLDER_INFO (finfo), FALSE);
4110-
4111- return finfo->priv->subscribed;
4112-}
4113-
4114-/**
4115- * syncdaemon_folder_info_set_subscribed:
4116- */
4117-void
4118-syncdaemon_folder_info_set_subscribed (SyncdaemonFolderInfo *finfo, gboolean subscribed)
4119-{
4120- g_return_if_fail (SYNCDAEMON_IS_FOLDER_INFO (finfo));
4121-
4122- finfo->priv->subscribed = subscribed;
4123-}
4124-
4125-/**
4126- * syncdaemon_folder_info_get_volume_id:
4127- */
4128-const gchar *
4129-syncdaemon_folder_info_get_volume_id (SyncdaemonFolderInfo *finfo)
4130-{
4131- g_return_val_if_fail (SYNCDAEMON_IS_FOLDER_INFO (finfo), NULL);
4132-
4133- return (const gchar *) finfo->priv->volume_id;
4134-}
4135-
4136-/**
4137- * syncdaemon_folder_info_set_volume_id:
4138- */
4139-void
4140-syncdaemon_folder_info_set_volume_id (SyncdaemonFolderInfo *finfo, const gchar *volume_id)
4141-{
4142- g_return_if_fail (SYNCDAEMON_IS_FOLDER_INFO (finfo));
4143-
4144- if (finfo->priv->volume_id != NULL)
4145- g_free (finfo->priv->volume_id);
4146-
4147- finfo->priv->volume_id = g_strdup (volume_id);
4148-}
4149
4150=== removed file 'libsyncdaemon/syncdaemon-folder-info.h'
4151--- libsyncdaemon/syncdaemon-folder-info.h 2012-04-09 20:07:05 +0000
4152+++ libsyncdaemon/syncdaemon-folder-info.h 1970-01-01 00:00:00 +0000
4153@@ -1,73 +0,0 @@
4154-/*
4155- * Syncdaemon API
4156- *
4157- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
4158- *
4159- * Copyright 2010-2012 Canonical Ltd.
4160- *
4161- * This program is free software: you can redistribute it and/or modify it
4162- * under the terms of the GNU General Public License version 3, as published
4163- * by the Free Software Foundation.
4164- *
4165- * This program is distributed in the hope that it will be useful, but
4166- * WITHOUT ANY WARRANTY; without even the implied warranties of
4167- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
4168- * PURPOSE. See the GNU General Public License for more details.
4169- *
4170- * You should have received a copy of the GNU General Public License along
4171- * with this program. If not, see <http://www.gnu.org/licenses/>.
4172- *
4173- * In addition, as a special exception, the copyright holders give
4174- * permission to link the code of portions of this program with the
4175- * OpenSSL library under certain conditions as described in each
4176- * individual source file, and distribute linked combinations
4177- * including the two.
4178- * You must obey the GNU General Public License in all respects
4179- * for all of the code used other than OpenSSL. If you modify
4180- * file(s) with this exception, you may extend this exception to your
4181- * version of the file(s), but you are not obligated to do so. If you
4182- * do not wish to do so, delete this exception statement from your
4183- * version. If you delete this exception statement from all source
4184- * files in the program, then also delete it here.
4185- *
4186- */
4187-
4188-#ifndef __SYNCDAEMON_FOLDER_INFO_H__
4189-#define __SYNCDAEMON_FOLDER_INFO_H__
4190-
4191-#include <glib-object.h>
4192-
4193-G_BEGIN_DECLS
4194-
4195-#define SYNCDAEMON_TYPE_FOLDER_INFO (syncdaemon_folder_info_get_type ())
4196-#define SYNCDAEMON_FOLDER_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_FOLDER_INFO, SyncdaemonFolderInfo))
4197-#define SYNCDAEMON_IS_FOLDER_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_FOLDER_INFO))
4198-#define SYNCDAEMON_FOLDER_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_FOLDER_INFO, SyncdaemonFolderInfoClass))
4199-#define SYNCDAEMON_IS_FOLDER_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_FOLDER_INFO))
4200-#define SYNCDAEMON_FOLDER_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_FOLDER_INFO, SyncdaemonFolderInfoClass))
4201-
4202-typedef struct _SyncdaemonFolderInfoPrivate SyncdaemonFolderInfoPrivate;
4203-
4204-typedef struct {
4205- GObject parent;
4206- SyncdaemonFolderInfoPrivate *priv;
4207-} SyncdaemonFolderInfo;
4208-
4209-typedef struct {
4210- GObjectClass parent_class;
4211-} SyncdaemonFolderInfoClass;
4212-
4213-GType syncdaemon_folder_info_get_type (void);
4214-SyncdaemonFolderInfo *syncdaemon_folder_info_new (void);
4215-SyncdaemonFolderInfo *syncdaemon_folder_info_new_from_hash_table (GHashTable *hash);
4216-
4217-const gchar *syncdaemon_folder_info_get_path (SyncdaemonFolderInfo *finfo);
4218-void syncdaemon_folder_info_set_path (SyncdaemonFolderInfo *finfo, const gchar *path);
4219-gboolean syncdaemon_folder_info_get_subscribed (SyncdaemonFolderInfo *finfo);
4220-void syncdaemon_folder_info_set_subscribed (SyncdaemonFolderInfo *finfo, gboolean subscribed);
4221-const gchar *syncdaemon_folder_info_get_volume_id (SyncdaemonFolderInfo *finfo);
4222-void syncdaemon_folder_info_set_volume_id (SyncdaemonFolderInfo *finfo, const gchar *volume_id);
4223-
4224-G_END_DECLS
4225-
4226-#endif
4227
4228=== removed file 'libsyncdaemon/syncdaemon-folders-interface.c'
4229--- libsyncdaemon/syncdaemon-folders-interface.c 2012-04-09 20:07:05 +0000
4230+++ libsyncdaemon/syncdaemon-folders-interface.c 1970-01-01 00:00:00 +0000
4231@@ -1,494 +0,0 @@
4232-/*
4233- * Syncdaemon API
4234- *
4235- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
4236- *
4237- * Copyright 2010-2012 Canonical Ltd.
4238- *
4239- * This program is free software: you can redistribute it and/or modify it
4240- * under the terms of the GNU General Public License version 3, as published
4241- * by the Free Software Foundation.
4242- *
4243- * This program is distributed in the hope that it will be useful, but
4244- * WITHOUT ANY WARRANTY; without even the implied warranties of
4245- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
4246- * PURPOSE. See the GNU General Public License for more details.
4247- *
4248- * You should have received a copy of the GNU General Public License along
4249- * with this program. If not, see <http://www.gnu.org/licenses/>.
4250- *
4251- * In addition, as a special exception, the copyright holders give
4252- * permission to link the code of portions of this program with the
4253- * OpenSSL library under certain conditions as described in each
4254- * individual source file, and distribute linked combinations
4255- * including the two.
4256- * You must obey the GNU General Public License in all respects
4257- * for all of the code used other than OpenSSL. If you modify
4258- * file(s) with this exception, you may extend this exception to your
4259- * version of the file(s), but you are not obligated to do so. If you
4260- * do not wish to do so, delete this exception statement from your
4261- * version. If you delete this exception statement from all source
4262- * files in the program, then also delete it here.
4263- *
4264- */
4265-
4266-#include "config.h"
4267-#include "syncdaemon-folders-interface.h"
4268-#include "utils.h"
4269-
4270-G_DEFINE_TYPE(SyncdaemonFoldersInterface, syncdaemon_folders_interface, SYNCDAEMON_TYPE_INTERFACE)
4271-
4272-struct _SyncdaemonFoldersInterfacePrivate {
4273- GObject *proxy;
4274- GHashTable *folders;
4275-};
4276-
4277-static void
4278-syncdaemon_folders_interface_finalize (GObject *object)
4279-{
4280- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (object);
4281-
4282- if (interface->priv != NULL) {
4283- if (interface->priv->folders != NULL)
4284- g_hash_table_destroy (interface->priv->folders);
4285-
4286- g_free (interface->priv);
4287- }
4288-
4289- G_OBJECT_CLASS (syncdaemon_folders_interface_parent_class)->finalize (object);
4290-}
4291-
4292-static void
4293-syncdaemon_folders_interface_class_init (SyncdaemonFoldersInterfaceClass *klass)
4294-{
4295- GObjectClass *object_class = G_OBJECT_CLASS (klass);
4296-
4297- object_class->finalize = syncdaemon_folders_interface_finalize;
4298-}
4299-
4300-static void
4301-folder_created_cb (DBusGProxy *proxy, GHashTable *hash, gpointer user_data)
4302-{
4303- SyncdaemonFolderInfo *folder_info;
4304- SyncdaemonDaemon *daemon = NULL;
4305- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (user_data);
4306-
4307- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4308-
4309- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
4310-
4311- /* Update our cache of folders */
4312- if (interface->priv->folders != NULL) {
4313- g_hash_table_insert (interface->priv->folders,
4314- g_strdup (syncdaemon_folder_info_get_path (folder_info)),
4315- folder_info);
4316-
4317- if (daemon != NULL)
4318- g_signal_emit_by_name (daemon, "folder_created", TRUE, folder_info);
4319- } else {
4320- if (daemon != NULL)
4321- g_signal_emit_by_name (daemon, "folder_created", TRUE, folder_info);
4322- g_object_unref (G_OBJECT (folder_info));
4323- }
4324-}
4325-
4326-static void
4327-folder_create_error_cb (DBusGProxy *proxy, GHashTable *hash, gchar *error, gpointer user_data)
4328-{
4329- SyncdaemonDaemon *daemon = NULL;
4330- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (user_data);
4331-
4332- /* Notify listeners */
4333- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
4334- if (daemon != NULL) {
4335- SyncdaemonFolderInfo *folder_info;
4336-
4337- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4338- g_signal_emit_by_name (daemon, "folder_created", FALSE, folder_info);
4339- g_object_unref (G_OBJECT (folder_info));
4340- }
4341-}
4342-
4343-static void
4344-folder_deleted_cb (DBusGProxy *proxy, GHashTable *hash, gpointer user_data)
4345-{
4346- SyncdaemonFolderInfo *folder_info;
4347- SyncdaemonDaemon *daemon = NULL;
4348- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (user_data);
4349-
4350- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4351-
4352- /* Notify listeners */
4353- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
4354- if (daemon != NULL)
4355- g_signal_emit_by_name (daemon, "folder_deleted", TRUE, folder_info);
4356-
4357- /* Update our cache of folders */
4358- if (interface->priv->folders != NULL)
4359- g_hash_table_remove (interface->priv->folders,
4360- syncdaemon_folder_info_get_path (folder_info));
4361-
4362- g_object_unref (G_OBJECT (folder_info));
4363-}
4364-
4365-static void
4366-folder_delete_error_cb (DBusGProxy *proxy, GHashTable *hash, gchar *error, gpointer user_data)
4367-{
4368- SyncdaemonFolderInfo *folder_info;
4369- SyncdaemonDaemon *daemon = NULL;
4370- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (user_data);
4371-
4372- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4373-
4374- /* Notify listeners */
4375- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
4376- if (daemon != NULL)
4377- g_signal_emit_by_name (daemon, "folder_deleted", FALSE, folder_info);
4378-
4379- g_object_unref (G_OBJECT (folder_info));
4380-}
4381-
4382-static void
4383-folder_subscribed_cb (DBusGProxy *proxy, GHashTable *hash, gpointer user_data)
4384-{
4385- SyncdaemonFolderInfo *folder_info;
4386- SyncdaemonDaemon *daemon = NULL;
4387- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (user_data);
4388-
4389- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4390-
4391- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
4392- if (daemon != NULL)
4393- g_signal_emit_by_name (daemon, "folder_subscribed", TRUE, folder_info);
4394-
4395- if (interface->priv->folders != NULL) {
4396- g_hash_table_insert (interface->priv->folders,
4397- g_strdup (syncdaemon_folder_info_get_path (folder_info)),
4398- folder_info);
4399- } else
4400- g_object_unref (G_OBJECT (folder_info));
4401-}
4402-
4403-static void
4404-folder_subscribe_error_cb (DBusGProxy *proxy, GHashTable *hash, gchar *error, gpointer user_data)
4405-{
4406- SyncdaemonFolderInfo *folder_info;
4407- SyncdaemonDaemon *daemon = NULL;
4408- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (user_data);
4409-
4410- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4411-
4412- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
4413- if (daemon != NULL)
4414- g_signal_emit_by_name (daemon, "folder_subscribed", FALSE, folder_info);
4415-
4416- g_object_unref (G_OBJECT (folder_info));
4417-}
4418-
4419-static void
4420-folder_unsubscribed_cb (DBusGProxy *proxy, GHashTable *hash, gpointer user_data)
4421-{
4422- SyncdaemonFolderInfo *folder_info;
4423- SyncdaemonDaemon *daemon = NULL;
4424- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (user_data);
4425-
4426- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4427-
4428- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
4429- if (daemon != NULL)
4430- g_signal_emit_by_name (daemon, "folder_unsubscribed", TRUE, folder_info);
4431-
4432- if (interface->priv->folders != NULL) {
4433- g_hash_table_insert (interface->priv->folders,
4434- g_strdup (syncdaemon_folder_info_get_path (folder_info)),
4435- folder_info);
4436- } else
4437- g_object_unref (G_OBJECT (folder_info));
4438-}
4439-
4440-static void
4441-folder_unsubscribe_error_cb (DBusGProxy *proxy, GHashTable *hash, gchar *error, gpointer user_data)
4442-{
4443- SyncdaemonFolderInfo *folder_info;
4444- SyncdaemonDaemon *daemon = NULL;
4445- SyncdaemonFoldersInterface *interface = SYNCDAEMON_FOLDERS_INTERFACE (user_data);
4446-
4447- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4448-
4449- g_object_get (G_OBJECT (interface), "daemon", &daemon, NULL);
4450- if (daemon != NULL)
4451- g_signal_emit_by_name (daemon, "folder_unsubscribed", FALSE, folder_info);
4452-
4453- g_object_unref (G_OBJECT (folder_info));
4454-}
4455-
4456-static void
4457-syncdaemon_folders_interface_init (SyncdaemonFoldersInterface *interface)
4458-{
4459- interface->priv = g_new0 (SyncdaemonFoldersInterfacePrivate, 1);
4460-
4461- /* Setup DBus proxy */
4462- interface->priv->proxy = syncdaemon_interface_setup_proxy (SYNCDAEMON_INTERFACE (interface),
4463- "com.ubuntuone.SyncDaemon",
4464- "/folders", "com.ubuntuone.SyncDaemon.Folders");
4465- if (interface->priv->proxy != NULL) {
4466- /* Connect to DBus proxy signals */
4467- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderCreated",
4468- dbus_g_type_get_map ("GHashTable",
4469- G_TYPE_STRING,
4470- G_TYPE_STRING),
4471- G_TYPE_INVALID);
4472- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderCreated",
4473- G_CALLBACK (folder_created_cb), interface, NULL);
4474-
4475- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderDeleted",
4476- dbus_g_type_get_map ("GHashTable",
4477- G_TYPE_STRING,
4478- G_TYPE_STRING),
4479- G_TYPE_INVALID);
4480- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderDeleted",
4481- G_CALLBACK (folder_deleted_cb), interface, NULL);
4482-
4483- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderSubscribed",
4484- dbus_g_type_get_map ("GHashTable",
4485- G_TYPE_STRING,
4486- G_TYPE_STRING),
4487- G_TYPE_INVALID);
4488- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderSubscribed",
4489- G_CALLBACK (folder_subscribed_cb), interface, NULL);
4490-
4491- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderUnSubscribed",
4492- dbus_g_type_get_map ("GHashTable",
4493- G_TYPE_STRING,
4494- G_TYPE_STRING),
4495- G_TYPE_INVALID);
4496- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderUnSubscribed",
4497- G_CALLBACK (folder_unsubscribed_cb), interface, NULL);
4498-
4499- /* Error signals */
4500- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderCreateError",
4501- dbus_g_type_get_map ("GHashTable",
4502- G_TYPE_STRING,
4503- G_TYPE_STRING),
4504- G_TYPE_STRING,
4505- G_TYPE_INVALID);
4506- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderCreateError",
4507- G_CALLBACK (folder_create_error_cb), interface, NULL);
4508-
4509- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderDeleteError",
4510- dbus_g_type_get_map ("GHashTable",
4511- G_TYPE_STRING,
4512- G_TYPE_STRING),
4513- G_TYPE_STRING,
4514- G_TYPE_INVALID);
4515- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderDeleteError",
4516- G_CALLBACK (folder_delete_error_cb), interface, NULL);
4517-
4518- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderSubscribeError",
4519- dbus_g_type_get_map ("GHashTable",
4520- G_TYPE_STRING,
4521- G_TYPE_STRING),
4522- G_TYPE_STRING,
4523- G_TYPE_INVALID);
4524- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderSubscribeError",
4525- G_CALLBACK (folder_subscribe_error_cb), interface, NULL);
4526-
4527- dbus_g_proxy_add_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderUnSubscribeError",
4528- dbus_g_type_get_map ("GHashTable",
4529- G_TYPE_STRING,
4530- G_TYPE_STRING),
4531- G_TYPE_STRING,
4532- G_TYPE_INVALID);
4533- dbus_g_proxy_connect_signal (DBUS_G_PROXY (interface->priv->proxy), "FolderUnSubscribeError",
4534- G_CALLBACK (folder_unsubscribe_error_cb), interface, NULL);
4535- }
4536-}
4537-
4538-/**
4539- * syncdaemon_folders_interface_new:
4540- */
4541-SyncdaemonFoldersInterface *
4542-syncdaemon_folders_interface_new (SyncdaemonDaemon *daemon)
4543-{
4544- g_return_val_if_fail (SYNCDAEMON_IS_DAEMON (daemon), NULL);
4545-
4546- return g_object_new (SYNCDAEMON_TYPE_FOLDERS_INTERFACE, "daemon", daemon, NULL);
4547-}
4548-
4549-/**
4550- * syncdaemon_folders_interface_create:
4551- */
4552-void
4553-syncdaemon_folders_interface_create (SyncdaemonFoldersInterface *interface, const gchar *path)
4554-{
4555- g_return_if_fail (SYNCDAEMON_IS_FOLDERS_INTERFACE (interface));
4556- g_return_if_fail (path != NULL);
4557-
4558- dbus_g_proxy_begin_call (DBUS_G_PROXY (interface->priv->proxy), "create",
4559- no_output_dbus_call_ended_cb, interface, NULL,
4560- G_TYPE_STRING, path,
4561- G_TYPE_INVALID);
4562-}
4563-
4564-/**
4565- * syncdaemon_folders_interface_delete:
4566- */
4567-void
4568-syncdaemon_folders_interface_delete (SyncdaemonFoldersInterface *interface, const gchar *folder_id)
4569-{
4570- g_return_if_fail (SYNCDAEMON_IS_FOLDERS_INTERFACE (interface));
4571- g_return_if_fail (folder_id != NULL);
4572-
4573- dbus_g_proxy_begin_call (DBUS_G_PROXY (interface->priv->proxy), "delete",
4574- no_output_dbus_call_ended_cb, interface, NULL,
4575- G_TYPE_STRING, folder_id,
4576- G_TYPE_INVALID);
4577-}
4578-
4579-/**
4580- * syncdaemon_folders_interface_get_folders:
4581- *
4582- * Return value: A GSList of #SyncdaemonFolderInfo containing all the folders being
4583- * synchronized by the user. When no longer needed, the list should be freed
4584- * by calling g_slist_free.
4585- */
4586-GSList *
4587-syncdaemon_folders_interface_get_folders (SyncdaemonFoldersInterface *interface)
4588-{
4589- GSList *returned_folders = NULL;
4590- GError *error = NULL;
4591-
4592- g_return_val_if_fail (SYNCDAEMON_IS_FOLDERS_INTERFACE (interface), NULL);
4593-
4594- if (interface->priv->folders != NULL) {
4595- GHashTableIter iter;
4596- gchar *path;
4597- SyncdaemonFolderInfo *folder_info;
4598-
4599- /* If we already got the folders list, no need for an extra DBus call */
4600- g_hash_table_iter_init (&iter, interface->priv->folders);
4601- while (g_hash_table_iter_next (&iter, (gpointer *) &path, (gpointer *) &folder_info))
4602- returned_folders = g_slist_append (returned_folders, folder_info);
4603- } else {
4604- GSList *list;
4605-
4606- if (dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), "get_folders", &error,
4607- G_TYPE_INVALID,
4608- dbus_g_type_get_collection ("GSList",
4609- dbus_g_type_get_map
4610- ("GHashTable",
4611- G_TYPE_STRING,
4612- G_TYPE_STRING)), &list,
4613- G_TYPE_INVALID)) {
4614- GSList *l;
4615-
4616- /* Add the folders to our live-updating list */
4617- interface->priv->folders = g_hash_table_new_full (g_str_hash, g_str_equal,
4618- g_free, g_object_unref);
4619- for (l = list; l != NULL; l = l->next) {
4620- SyncdaemonFolderInfo *folder_info;
4621-
4622- folder_info = syncdaemon_folder_info_new_from_hash_table (l->data);
4623- g_hash_table_insert (interface->priv->folders,
4624- g_strdup (g_hash_table_lookup (l->data, "path")),
4625- folder_info);
4626-
4627- returned_folders = g_slist_append (returned_folders, folder_info);
4628- }
4629-
4630- /* Free memory */
4631- g_slist_foreach (list, (GFunc) g_hash_table_destroy, NULL);
4632- g_slist_free (list);
4633- } else {
4634- g_warning ("Error calling get_folders: %s", error->message);
4635- g_error_free (error);
4636- }
4637- }
4638-
4639- return returned_folders;
4640-}
4641-
4642-/**
4643- * syncdaemon_folders_interface_get_info:
4644- *
4645- * Return value: A #SyncdaemonFolderInfo object containing all the information
4646- * for the node. When no longer needed, it should be freed by calling
4647- * g_object_unref.
4648- */
4649-SyncdaemonFolderInfo *
4650-syncdaemon_folders_interface_get_info (SyncdaemonFoldersInterface *interface, const gchar *path)
4651-{
4652- SyncdaemonFolderInfo *folder_info = NULL;
4653- GError *error = NULL;
4654-
4655- g_return_val_if_fail (SYNCDAEMON_IS_FOLDERS_INTERFACE (interface), NULL);
4656- g_return_val_if_fail (path != NULL, NULL);
4657-
4658- if (interface->priv->folders != NULL) {
4659- folder_info = g_hash_table_lookup (interface->priv->folders, path);
4660- if (folder_info != NULL)
4661- folder_info = g_object_ref (G_OBJECT (folder_info));
4662- }
4663-
4664- if (!folder_info) {
4665- GHashTable *hash;
4666-
4667- if (dbus_g_proxy_call (DBUS_G_PROXY (interface->priv->proxy), "get_info", &error,
4668- G_TYPE_STRING, path,
4669- G_TYPE_INVALID,
4670- dbus_g_type_get_map ("GHashTable",
4671- G_TYPE_STRING,
4672- G_TYPE_STRING), &hash,
4673- G_TYPE_INVALID)) {
4674- folder_info = syncdaemon_folder_info_new_from_hash_table (hash);
4675- } else {
4676- g_warning ("Error calling get_info: %s", error->message);
4677- g_error_free (error);
4678- }
4679- }
4680-
4681- return folder_info;
4682-}
4683-
4684-/**
4685- * syncdaemon_folders_interface_refresh_volumes:
4686- */
4687-void
4688-syncdaemon_folders_interface_refresh_volumes (SyncdaemonFoldersInterface *interface)
4689-{
4690- g_return_if_fail (SYNCDAEMON_IS_FOLDERS_INTERFACE (interface));
4691-
4692- dbus_g_proxy_begin_call (DBUS_G_PROXY (interface->priv->proxy), "refresh_volumes",
4693- no_output_dbus_call_ended_cb, interface, NULL,
4694- G_TYPE_INVALID);
4695-}
4696-
4697-/**
4698- * syncdaemon_folders_interface_subscribe:
4699- */
4700-void
4701-syncdaemon_folders_interface_subscribe (SyncdaemonFoldersInterface *interface, const gchar *folder_id)
4702-{
4703- g_return_if_fail (SYNCDAEMON_IS_FOLDERS_INTERFACE (interface));
4704- g_return_if_fail (folder_id != NULL);
4705-
4706- dbus_g_proxy_begin_call (DBUS_G_PROXY (interface->priv->proxy), "subscribe",
4707- no_output_dbus_call_ended_cb, interface, NULL,
4708- G_TYPE_STRING, folder_id,
4709- G_TYPE_INVALID);
4710-}
4711-
4712-/**
4713- * syncdaemon_folders_interface_unsubscribe:
4714- */
4715-void
4716-syncdaemon_folders_interface_unsubscribe (SyncdaemonFoldersInterface *interface, const gchar *folder_id)
4717-{
4718- g_return_if_fail (SYNCDAEMON_IS_FOLDERS_INTERFACE (interface));
4719- g_return_if_fail (folder_id != NULL);
4720-
4721- dbus_g_proxy_begin_call (DBUS_G_PROXY (interface->priv->proxy), "unsubscribe",
4722- no_output_dbus_call_ended_cb, interface, NULL,
4723- G_TYPE_STRING, folder_id,
4724- G_TYPE_INVALID);
4725-}
4726
4727=== removed file 'libsyncdaemon/syncdaemon-folders-interface.h'
4728--- libsyncdaemon/syncdaemon-folders-interface.h 2012-04-09 20:07:05 +0000
4729+++ libsyncdaemon/syncdaemon-folders-interface.h 1970-01-01 00:00:00 +0000
4730@@ -1,76 +0,0 @@
4731-/*
4732- * Syncdaemon API
4733- *
4734- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
4735- *
4736- * Copyright 2010-2012 Canonical Ltd.
4737- *
4738- * This program is free software: you can redistribute it and/or modify it
4739- * under the terms of the GNU General Public License version 3, as published
4740- * by the Free Software Foundation.
4741- *
4742- * This program is distributed in the hope that it will be useful, but
4743- * WITHOUT ANY WARRANTY; without even the implied warranties of
4744- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
4745- * PURPOSE. See the GNU General Public License for more details.
4746- *
4747- * You should have received a copy of the GNU General Public License along
4748- * with this program. If not, see <http://www.gnu.org/licenses/>.
4749- *
4750- * In addition, as a special exception, the copyright holders give
4751- * permission to link the code of portions of this program with the
4752- * OpenSSL library under certain conditions as described in each
4753- * individual source file, and distribute linked combinations
4754- * including the two.
4755- * You must obey the GNU General Public License in all respects
4756- * for all of the code used other than OpenSSL. If you modify
4757- * file(s) with this exception, you may extend this exception to your
4758- * version of the file(s), but you are not obligated to do so. If you
4759- * do not wish to do so, delete this exception statement from your
4760- * version. If you delete this exception statement from all source
4761- * files in the program, then also delete it here.
4762- *
4763- */
4764-
4765-#ifndef __SYNCDAEMON_FOLDERS_INTERFACE_H__
4766-#define __SYNCDAEMON_FOLDERS_INTERFACE_H__
4767-
4768-#include "syncdaemon-daemon.h"
4769-#include "syncdaemon-folder-info.h"
4770-#include "syncdaemon-interface.h"
4771-
4772-G_BEGIN_DECLS
4773-
4774-#define SYNCDAEMON_TYPE_FOLDERS_INTERFACE (syncdaemon_folders_interface_get_type ())
4775-#define SYNCDAEMON_FOLDERS_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNCDAEMON_TYPE_FOLDERS_INTERFACE, SyncdaemonFoldersInterface))
4776-#define SYNCDAEMON_IS_FOLDERS_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNCDAEMON_TYPE_FOLDERS_INTERFACE))
4777-#define SYNCDAEMON_FOLDERS_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNCDAEMON_TYPE_FOLDERS_INTERFACE, SyncdaemonFoldersInterfaceClass))
4778-#define SYNCDAEMON_IS_FOLDERS_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNCDAEMON_TYPE_FOLDERS_INTERFACE))
4779-#define SYNCDAEMON_FOLDERS_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNCDAEMON_TYPE_FOLDERS_INTERFACE, SyncdaemonFoldersInterfaceClass))
4780-
4781-typedef struct _SyncdaemonFoldersInterfacePrivate SyncdaemonFoldersInterfacePrivate;
4782-
4783-typedef struct {
4784- SyncdaemonInterface parent;
4785- SyncdaemonFoldersInterfacePrivate *priv;
4786-} SyncdaemonFoldersInterface;
4787-
4788-typedef struct {
4789- SyncdaemonInterfaceClass parent_class;
4790-} SyncdaemonFoldersInterfaceClass;
4791-
4792-GType syncdaemon_folders_interface_get_type (void);
4793-
4794-SyncdaemonFoldersInterface *syncdaemon_folders_interface_new (SyncdaemonDaemon *daemon);
4795-
4796-void syncdaemon_folders_interface_create (SyncdaemonFoldersInterface *interface, const gchar *path);
4797-void syncdaemon_folders_interface_delete (SyncdaemonFoldersInterface *interface, const gchar *folder_id);
4798-GSList *syncdaemon_folders_interface_get_folders (SyncdaemonFoldersInterface *interface);
4799-SyncdaemonFolderInfo *syncdaemon_folders_interface_get_info (SyncdaemonFoldersInterface *interface, const gchar *path);
4800-void syncdaemon_folders_interface_refresh_volumes (SyncdaemonFoldersInterface *interface);
4801-void syncdaemon_folders_interface_subscribe (SyncdaemonFoldersInterface *interface, const gchar *folder_id);
4802-void syncdaemon_folders_interface_unsubscribe (SyncdaemonFoldersInterface *interface, const gchar *folder_id);
4803-
4804-G_END_DECLS
4805-
4806-#endif
4807
4808=== removed file 'libsyncdaemon/syncdaemon-interface.c'
4809--- libsyncdaemon/syncdaemon-interface.c 2012-04-09 20:07:05 +0000
4810+++ libsyncdaemon/syncdaemon-interface.c 1970-01-01 00:00:00 +0000
4811@@ -1,274 +0,0 @@
4812-/*
4813- * Syncdaemon API
4814- *
4815- * Authors: Rodrigo Moya <rodrigo.moya@canonical.com>
4816- *
4817- * Copyright 2010-2012 Canonical Ltd.
4818- *
4819- * This program is free software: you can redistribute it and/or modify it
4820- * under the terms of the GNU General Public License version 3, as published
4821- * by the Free Software Foundation.
4822- *
4823- * This program is distributed in the hope that it will be useful, but
4824- * WITHOUT ANY WARRANTY; without even the implied warranties of
4825- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
4826- * PURPOSE. See the GNU General Public License for more details.
4827- *
4828- * You should have received a copy of the GNU General Public License along
4829- * with this program. If not, see <http://www.gnu.org/licenses/>.
4830- *
4831- * In addition, as a special exception, the copyright holders give
4832- * permission to link the code of portions of this program with the
4833- * OpenSSL library under certain conditions as described in each
4834- * individual source file, and distribute linked combinations
4835- * including the two.
4836- * You must obey the GNU General Public License in all respects
4837- * for all of the code used other than OpenSSL. If you modify
4838- * file(s) with this exception, you may extend this exception to your
4839- * version of the file(s), but you are not obligated to do so. If you
4840- * do not wish to do so, delete this exception statement from your
4841- * version. If you delete this exception statement from all source
4842- * files in the program, then also delete it here.
4843- *
4844- */
4845-
4846-#include "config.h"
4847-#ifdef HAVE_GDBUS
4848-#include <gio/gio.h>
4849-#else
4850-#include <dbus/dbus-glib.h>
4851-#endif
4852-#include "syncdaemon-daemon.h"
4853-#include "syncdaemon-interface.h"
4854-#include "syncdaemon-marshal.h"
4855-
4856-G_DEFINE_TYPE(SyncdaemonInterface, syncdaemon_interface, G_TYPE_OBJECT)
4857-
4858-struct _SyncdaemonInterfacePrivate {
4859- SyncdaemonDaemon *daemon;
4860-#ifdef HAVE_GDBUS
4861- GDBusConnection *bus;
4862- GDBusProxy *proxy;
4863-#else
4864- DBusGConnection *bus;
4865- DBusGProxy *proxy;
4866-#endif
4867-};
4868-
4869-enum {
4870- PROP_0,
4871- PROP_DAEMON
4872-};
4873-
4874-static void
4875-syncdaemon_interface_finalize (GObject *object)
4876-{
4877- SyncdaemonInterface *interface = SYNCDAEMON_INTERFACE (object);
4878-
4879- if (interface->priv != NULL) {
4880- if (interface->priv->proxy != NULL)
4881- g_object_unref (G_OBJECT (interface->priv->proxy));
4882-
4883- if (interface->priv->bus != NULL) {
4884-#ifdef HAVE_GDBUS
4885- g_object_unref (G_OBJECT (interface->priv->bus));
4886-#else
4887- dbus_g_connection_unref (interface->priv->bus);
4888-#endif
4889- }
4890-
4891- if (interface->priv->daemon != NULL)
4892- g_object_unref (G_OBJECT (interface->priv->daemon));
4893-
4894- g_free (interface->priv);
4895- interface->priv = NULL;
4896- }
4897-
4898- G_OBJECT_CLASS (syncdaemon_interface_parent_class)->finalize (object);
4899-}
4900-
4901-static void
4902-syncdaemon_interface_set_property (GObject *object,
4903- guint prop_id,
4904- const GValue *value,
4905- GParamSpec *pspec)
4906-{
4907- SyncdaemonInterface *interface = SYNCDAEMON_INTERFACE (object);
4908-
4909- switch (prop_id) {
4910- case PROP_DAEMON:
4911- if (interface->priv->daemon != NULL)
4912- g_object_unref (G_OBJECT (interface->priv->daemon));
4913- interface->priv->daemon = g_object_ref (G_OBJECT (g_value_get_object (value)));
4914- break;
4915- default:
4916- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
4917- break;
4918- }
4919-}
4920-
4921-static void
4922-syncdaemon_interface_get_property (GObject *object,
4923- guint prop_id,
4924- GValue *value,
4925- GParamSpec *pspec)
4926-{
4927- SyncdaemonInterface *interface = SYNCDAEMON_INTERFACE (object);
4928-
4929- switch (prop_id) {
4930- case PROP_DAEMON:
4931- g_value_set_object (value, interface->priv->daemon);
4932- break;
4933- default:
4934- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
4935- break;
4936- }
4937-}
4938-
4939-static void
4940-syncdaemon_interface_class_init (SyncdaemonInterfaceClass *klass)
4941-{
4942- GObjectClass *object_class = G_OBJECT_CLASS (klass);
4943-
4944- object_class->finalize = syncdaemon_interface_finalize;
4945- object_class->set_property = syncdaemon_interface_set_property;
4946- object_class->get_property = syncdaemon_interface_get_property;
4947-
4948- /* Install properties */
4949- g_object_class_install_property (object_class,
4950- PROP_DAEMON,
4951- g_param_spec_object ("daemon",
4952- "SyncdaemonDaemon object",
4953- "Daemon object from which this interface was created",
4954- SYNCDAEMON_TYPE_DAEMON,
4955- G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
4956-
4957- /* Register DBus marshallers */
4958- dbus_g_object_register_marshaller (_syncdaemon_marshal_VOID__STRING_POINTER,
4959- G_TYPE_NONE,
4960- G_TYPE_STRING,
4961- dbus_g_type_get_map ("GHashTable",
4962- G_TYPE_STRING,
4963- G_TYPE_STRING),
4964- G_TYPE_INVALID);
4965- dbus_g_object_register_marshaller (_syncdaemon_marshal_VOID__POINTER_STRING,
4966- G_TYPE_NONE,
4967- dbus_g_type_get_map ("GHashTable",
4968- G_TYPE_STRING,
4969- G_TYPE_STRING),
4970- G_TYPE_STRING,
4971- G_TYPE_INVALID);
4972-}
4973-
4974-static void
4975-syncdaemon_interface_init (SyncdaemonInterface *interface)
4976-{
4977- GError *error = NULL;
4978-
4979- interface->priv = g_new0 (SyncdaemonInterfacePrivate, 1);
4980-
4981- /* Initialize DBus */
4982-#ifdef HAVE_GDBUS
4983- interface->priv->bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
4984-#else
4985- interface->priv->bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
4986-#endif
4987- if (error != NULL) {
4988- g_warning ("Couldn't get session bus: %s", error->message);
4989- g_error_free (error);
4990- }
4991-}
4992-
4993-static void
4994-#ifdef HAVE_GDBUS
4995-#else
4996-signal_error_cb (DBusGProxy *proxy, const gchar *signal, GHashTable *extra_args, gpointer user_data)
4997-#endif
4998-{
4999- SyncdaemonInterface *interface = SYNCDAEMON_INTERFACE (user_data);
5000-
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches