Merge lp:~dobey/ubuntu/natty/libubuntuone/release-0-9-1 into lp:ubuntu/natty/libubuntuone

Proposed by dobey
Status: Merged
Merged at revision: 84
Proposed branch: lp:~dobey/ubuntu/natty/libubuntuone/release-0-9-1
Merge into: lp:ubuntu/natty/libubuntuone
Diff against target: 786 lines (+287/-116)
13 files modified
configure (+19/-19)
configure.ac (+2/-2)
data/u1-preview.js (+1/-1)
debian/changelog (+12/-0)
debian/control (+0/-2)
libubuntuone/Makefile.am (+2/-0)
libubuntuone/Makefile.in (+4/-1)
libubuntuone/u1-marshal.c (+1/-38)
libubuntuone/u1-marshal.h (+1/-10)
libubuntuone/u1-marshal.list (+0/-1)
libubuntuone/u1-music-store.c (+106/-42)
libubuntuone/u1-request-chrome.c (+90/-0)
libubuntuone/u1-request-chrome.h (+49/-0)
To merge this branch: bzr merge lp:~dobey/ubuntu/natty/libubuntuone/release-0-9-1
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+54070@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure'
--- configure 2011-03-10 01:14:13 +0000
+++ configure 2011-03-18 20:44:28 +0000
@@ -1,6 +1,6 @@
1#! /bin/sh1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.67 for libubuntuone 0.9.0.3# Generated by GNU Autoconf 2.67 for libubuntuone 0.9.1.
4#4#
5#5#
6# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,6# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -698,8 +698,8 @@
698# Identity of this package.698# Identity of this package.
699PACKAGE_NAME='libubuntuone'699PACKAGE_NAME='libubuntuone'
700PACKAGE_TARNAME='libubuntuone'700PACKAGE_TARNAME='libubuntuone'
701PACKAGE_VERSION='0.9.0'701PACKAGE_VERSION='0.9.1'
702PACKAGE_STRING='libubuntuone 0.9.0'702PACKAGE_STRING='libubuntuone 0.9.1'
703PACKAGE_BUGREPORT=''703PACKAGE_BUGREPORT=''
704PACKAGE_URL=''704PACKAGE_URL=''
705705
@@ -1535,7 +1535,7 @@
1535 # Omit some internal or obsolete options to make the list less imposing.1535 # Omit some internal or obsolete options to make the list less imposing.
1536 # This message is too long to be a string in the A/UX 3.1 sh.1536 # This message is too long to be a string in the A/UX 3.1 sh.
1537 cat <<_ACEOF1537 cat <<_ACEOF
1538\`configure' configures libubuntuone 0.9.0 to adapt to many kinds of systems.1538\`configure' configures libubuntuone 0.9.1 to adapt to many kinds of systems.
15391539
1540Usage: $0 [OPTION]... [VAR=VALUE]...1540Usage: $0 [OPTION]... [VAR=VALUE]...
15411541
@@ -1605,7 +1605,7 @@
16051605
1606if test -n "$ac_init_help"; then1606if test -n "$ac_init_help"; then
1607 case $ac_init_help in1607 case $ac_init_help in
1608 short | recursive ) echo "Configuration of libubuntuone 0.9.0:";;1608 short | recursive ) echo "Configuration of libubuntuone 0.9.1:";;
1609 esac1609 esac
1610 cat <<\_ACEOF1610 cat <<\_ACEOF
16111611
@@ -1730,7 +1730,7 @@
1730test -n "$ac_init_help" && exit $ac_status1730test -n "$ac_init_help" && exit $ac_status
1731if $ac_init_version; then1731if $ac_init_version; then
1732 cat <<\_ACEOF1732 cat <<\_ACEOF
1733libubuntuone configure 0.9.01733libubuntuone configure 0.9.1
1734generated by GNU Autoconf 2.671734generated by GNU Autoconf 2.67
17351735
1736Copyright (C) 2010 Free Software Foundation, Inc.1736Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2095,7 +2095,7 @@
2095This file contains any messages produced by compilers while2095This file contains any messages produced by compilers while
2096running configure, to aid debugging if configure makes a mistake.2096running configure, to aid debugging if configure makes a mistake.
20972097
2098It was created by libubuntuone $as_me 0.9.0, which was2098It was created by libubuntuone $as_me 0.9.1, which was
2099generated by GNU Autoconf 2.67. Invocation command line was2099generated by GNU Autoconf 2.67. Invocation command line was
21002100
2101 $ $0 $@2101 $ $0 $@
@@ -2918,7 +2918,7 @@
29182918
2919# Define the identity of the package.2919# Define the identity of the package.
2920 PACKAGE='libubuntuone'2920 PACKAGE='libubuntuone'
2921 VERSION='0.9.0'2921 VERSION='0.9.1'
29222922
29232923
2924cat >>confdefs.h <<_ACEOF2924cat >>confdefs.h <<_ACEOF
@@ -12750,12 +12750,12 @@
12750 pkg_cv_LIBUBUNTUONE_CFLAGS="$LIBUBUNTUONE_CFLAGS"12750 pkg_cv_LIBUBUNTUONE_CFLAGS="$LIBUBUNTUONE_CFLAGS"
12751 elif test -n "$PKG_CONFIG"; then12751 elif test -n "$PKG_CONFIG"; then
12752 if test -n "$PKG_CONFIG" && \12752 if test -n "$PKG_CONFIG" && \
12753 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2\""; } >&512753 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2\""; } >&5
12754 ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2") 2>&512754 ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2") 2>&5
12755 ac_status=$?12755 ac_status=$?
12756 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&512756 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12757 test $ac_status = 0; }; then12757 test $ac_status = 0; }; then
12758 pkg_cv_LIBUBUNTUONE_CFLAGS=`$PKG_CONFIG --cflags "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>/dev/null`12758 pkg_cv_LIBUBUNTUONE_CFLAGS=`$PKG_CONFIG --cflags "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>/dev/null`
12759else12759else
12760 pkg_failed=yes12760 pkg_failed=yes
12761fi12761fi
@@ -12766,12 +12766,12 @@
12766 pkg_cv_LIBUBUNTUONE_LIBS="$LIBUBUNTUONE_LIBS"12766 pkg_cv_LIBUBUNTUONE_LIBS="$LIBUBUNTUONE_LIBS"
12767 elif test -n "$PKG_CONFIG"; then12767 elif test -n "$PKG_CONFIG"; then
12768 if test -n "$PKG_CONFIG" && \12768 if test -n "$PKG_CONFIG" && \
12769 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2\""; } >&512769 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2\""; } >&5
12770 ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2") 2>&512770 ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2") 2>&5
12771 ac_status=$?12771 ac_status=$?
12772 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&512772 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12773 test $ac_status = 0; }; then12773 test $ac_status = 0; }; then
12774 pkg_cv_LIBUBUNTUONE_LIBS=`$PKG_CONFIG --libs "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>/dev/null`12774 pkg_cv_LIBUBUNTUONE_LIBS=`$PKG_CONFIG --libs "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>/dev/null`
12775else12775else
12776 pkg_failed=yes12776 pkg_failed=yes
12777fi12777fi
@@ -12791,14 +12791,14 @@
12791 _pkg_short_errors_supported=no12791 _pkg_short_errors_supported=no
12792fi12792fi
12793 if test $_pkg_short_errors_supported = yes; then12793 if test $_pkg_short_errors_supported = yes; then
12794 LIBUBUNTUONE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>&1`12794 LIBUBUNTUONE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>&1`
12795 else12795 else
12796 LIBUBUNTUONE_PKG_ERRORS=`$PKG_CONFIG --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>&1`12796 LIBUBUNTUONE_PKG_ERRORS=`$PKG_CONFIG --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>&1`
12797 fi12797 fi
12798 # Put the nasty error message in config.log where it belongs12798 # Put the nasty error message in config.log where it belongs
12799 echo "$LIBUBUNTUONE_PKG_ERRORS" >&512799 echo "$LIBUBUNTUONE_PKG_ERRORS" >&5
1280012800
12801 as_fn_error $? "Package requirements (gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2) were not met:12801 as_fn_error $? "Package requirements (gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2) were not met:
1280212802
12803$LIBUBUNTUONE_PKG_ERRORS12803$LIBUBUNTUONE_PKG_ERRORS
1280412804
@@ -14638,7 +14638,7 @@
14638# report actual input values of CONFIG_FILES etc. instead of their14638# report actual input values of CONFIG_FILES etc. instead of their
14639# values after options handling.14639# values after options handling.
14640ac_log="14640ac_log="
14641This file was extended by libubuntuone $as_me 0.9.0, which was14641This file was extended by libubuntuone $as_me 0.9.1, which was
14642generated by GNU Autoconf 2.67. Invocation command line was14642generated by GNU Autoconf 2.67. Invocation command line was
1464314643
14644 CONFIG_FILES = $CONFIG_FILES14644 CONFIG_FILES = $CONFIG_FILES
@@ -14704,7 +14704,7 @@
14704cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=114704cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14705ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"14705ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
14706ac_cs_version="\\14706ac_cs_version="\\
14707libubuntuone config.status 0.9.014707libubuntuone config.status 0.9.1
14708configured by $0, generated by GNU Autoconf 2.67,14708configured by $0, generated by GNU Autoconf 2.67,
14709 with options \\"\$ac_cs_config\\"14709 with options \\"\$ac_cs_config\\"
1471014710
1471114711
=== modified file 'configure.ac'
--- configure.ac 2011-03-10 01:13:12 +0000
+++ configure.ac 2011-03-18 20:44:28 +0000
@@ -1,4 +1,4 @@
1AC_INIT([libubuntuone], [0.9.0], [], [libubuntuone])1AC_INIT([libubuntuone], [0.9.1], [], [libubuntuone])
22
3AC_PREREQ([2.59])3AC_PREREQ([2.59])
44
@@ -32,7 +32,7 @@
32AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)32AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
3333
34dnl Look for needed modules34dnl Look for needed modules
35PKG_CHECK_MODULES(LIBUBUNTUONE, gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 gnome-keyring-1 dbus-glib-1 libxml-2.0 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2)35PKG_CHECK_MODULES(LIBUBUNTUONE, gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2)
36AC_SUBST(LIBUBUNTUONE_CFLAGS)36AC_SUBST(LIBUBUNTUONE_CFLAGS)
37AC_SUBST(LIBUBUNTUONE_LIBS)37AC_SUBST(LIBUBUNTUONE_LIBS)
3838
3939
=== modified file 'data/u1-preview.js'
--- data/u1-preview.js 2010-04-01 17:42:58 +0000
+++ data/u1-preview.js 2011-03-18 20:44:28 +0000
@@ -53,7 +53,7 @@
53 // add a padlock if this is a secure page53 // add a padlock if this is a secure page
54 if (location.href.substr(0,6) == "https:") {54 if (location.href.substr(0,6) == "https:") {
55 var padlock = document.createElement("img");55 var padlock = document.createElement("img");
56 padlock.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAYAAACwXJejAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAINJREFUeNpiTEtLYwACfiCeBsQ2QCwHxK%2BBeB8QZwHxOyYGCOgFYl0gjgNiQyD2B2IJIJ4DkmSBKvIGYjcgvsyAAOlAfAzEgJkkCsQ3GVDBI6gzwIp4gJgZiH%2BhKfoOFQdb9xkq%2BJ8BO/jPxEAEGABFTwmoeQpSlALEL3AoAImnAAQYAHZ7FWCCovUtAAAAAElFTkSuQmCC";56 padlock.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAYAAACwXJejAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAINJREFUeNpiTEtLYwACfiCeBsQ2QCwHxK+BeB8QZwHxOyYGCOgFYl0gjgNiQyD2B2IJIJ4DkmSBKvIGYjcgvsyAAOlAfAzEgJkkCsQ3GVDBI6gzwIp4gJgZiH+hKfoOFQdb9xkq+J8BO/jPxEAEGABFTwmoeQpSlALEL3AoAImnAAQYAHZ7FWCCovUtAAAAAElFTkSuQmCC";
57 padlock.style.position = "fixed";57 padlock.style.position = "fixed";
58 padlock.style.bottom = "0";58 padlock.style.bottom = "0";
59 padlock.style.right = "0";59 padlock.style.right = "0";
6060
=== modified file 'debian/changelog'
--- debian/changelog 2011-03-10 01:14:13 +0000
+++ debian/changelog 2011-03-18 20:44:28 +0000
@@ -1,3 +1,15 @@
1libubuntuone (0.9.1-0ubuntu1) natty; urgency=low
2
3 * New upstream release.
4 - Remove unneeded dbus-glib usage (LP: #732761)
5 - Custom URI scheme handler for internal pages (LP: #733479)
6 - False connection error message (LP: #596394)
7 - Notify user when purchased folder is not subscribed to (LP: #727558)
8 - Memory leak in navigation_requested_cb (LP: #733283)
9 - Lock icon is broken in store pages (LP: #733308)
10
11 -- Rodney Dawes <rodney.dawes@ubuntu.com> Fri, 18 Mar 2011 16:30:19 -0400
12
1libubuntuone (0.9.0-0ubuntu1) natty; urgency=low13libubuntuone (0.9.0-0ubuntu1) natty; urgency=low
214
3 * New upstream release.15 * New upstream release.
416
=== modified file 'debian/control'
--- debian/control 2011-02-11 21:56:37 +0000
+++ debian/control 2011-03-18 20:44:28 +0000
@@ -18,9 +18,7 @@
18 python-gtk2-dev,18 python-gtk2-dev,
19 python-gobject-dev,19 python-gobject-dev,
20 libssl-dev,20 libssl-dev,
21 libgnome-keyring-dev,
22 libxml2-dev,21 libxml2-dev,
23 libdbus-glib-1-dev,
24 mono-gmcs,22 mono-gmcs,
25 gtk-sharp2-gapi,23 gtk-sharp2-gapi,
26 cli-common-dev (>= 0.5.7),24 cli-common-dev (>= 0.5.7),
2725
=== modified file 'libubuntuone/Makefile.am'
--- libubuntuone/Makefile.am 2011-01-14 22:24:48 +0000
+++ libubuntuone/Makefile.am 2011-03-18 20:44:28 +0000
@@ -20,6 +20,8 @@
20 oauth.c \20 oauth.c \
21 oauth.h \21 oauth.h \
22 u1-music-store.c \22 u1-music-store.c \
23 u1-request-chrome.c \
24 u1-request-chrome.h \
23 xmalloc.c \25 xmalloc.c \
24 xmalloc.h26 xmalloc.h
25libubuntuone_1_0_la_LDFLAGS = -version-info $(LIBUBUNTUONE_CURRENT):$(LIBUBUNTUONE_REVISION):$(LIBUBUNTUONE_AGE)27libubuntuone_1_0_la_LDFLAGS = -version-info $(LIBUBUNTUONE_CURRENT):$(LIBUBUNTUONE_REVISION):$(LIBUBUNTUONE_AGE)
2628
=== modified file 'libubuntuone/Makefile.in'
--- libubuntuone/Makefile.in 2011-01-14 22:29:52 +0000
+++ libubuntuone/Makefile.in 2011-03-18 20:44:28 +0000
@@ -79,7 +79,7 @@
79 $(am__DEPENDENCIES_1)79 $(am__DEPENDENCIES_1)
80am__objects_1 = u1-marshal.lo80am__objects_1 = u1-marshal.lo
81am_libubuntuone_1_0_la_OBJECTS = $(am__objects_1) oauth.lo \81am_libubuntuone_1_0_la_OBJECTS = $(am__objects_1) oauth.lo \
82 u1-music-store.lo xmalloc.lo82 u1-music-store.lo u1-request-chrome.lo xmalloc.lo
83libubuntuone_1_0_la_OBJECTS = $(am_libubuntuone_1_0_la_OBJECTS)83libubuntuone_1_0_la_OBJECTS = $(am_libubuntuone_1_0_la_OBJECTS)
84AM_V_lt = $(am__v_lt_$(V))84AM_V_lt = $(am__v_lt_$(V))
85am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))85am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
@@ -319,6 +319,8 @@
319 oauth.c \319 oauth.c \
320 oauth.h \320 oauth.h \
321 u1-music-store.c \321 u1-music-store.c \
322 u1-request-chrome.c \
323 u1-request-chrome.h \
322 xmalloc.c \324 xmalloc.c \
323 xmalloc.h325 xmalloc.h
324326
@@ -426,6 +428,7 @@
426@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth.Plo@am__quote@428@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth.Plo@am__quote@
427@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-marshal.Plo@am__quote@429@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-marshal.Plo@am__quote@
428@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-music-store.Plo@am__quote@430@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-music-store.Plo@am__quote@
431@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-request-chrome.Plo@am__quote@
429@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Plo@am__quote@432@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Plo@am__quote@
430433
431.c.o:434.c.o:
432435
=== modified file 'libubuntuone/u1-marshal.c'
--- libubuntuone/u1-marshal.c 2010-07-21 15:39:51 +0000
+++ libubuntuone/u1-marshal.c 2011-03-18 20:44:28 +0000
@@ -49,44 +49,7 @@
49#endif /* !G_ENABLE_DEBUG */49#endif /* !G_ENABLE_DEBUG */
5050
5151
52/* NONE:STRING,OBJECT (u1-marshal.list:1) */52/* NONE:STRING,STRING (u1-marshal.list:1) */
53void
54_u1_marshal_VOID__STRING_OBJECT (GClosure *closure,
55 GValue *return_value G_GNUC_UNUSED,
56 guint n_param_values,
57 const GValue *param_values,
58 gpointer invocation_hint G_GNUC_UNUSED,
59 gpointer marshal_data)
60{
61 typedef void (*GMarshalFunc_VOID__STRING_OBJECT) (gpointer data1,
62 gpointer arg_1,
63 gpointer arg_2,
64 gpointer data2);
65 register GMarshalFunc_VOID__STRING_OBJECT callback;
66 register GCClosure *cc = (GCClosure*) closure;
67 register gpointer data1, data2;
68
69 g_return_if_fail (n_param_values == 3);
70
71 if (G_CCLOSURE_SWAP_DATA (closure))
72 {
73 data1 = closure->data;
74 data2 = g_value_peek_pointer (param_values + 0);
75 }
76 else
77 {
78 data1 = g_value_peek_pointer (param_values + 0);
79 data2 = closure->data;
80 }
81 callback = (GMarshalFunc_VOID__STRING_OBJECT) (marshal_data ? marshal_data : cc->callback);
82
83 callback (data1,
84 g_marshal_value_peek_string (param_values + 1),
85 g_marshal_value_peek_object (param_values + 2),
86 data2);
87}
88
89/* NONE:STRING,STRING (u1-marshal.list:2) */
90void53void
91_u1_marshal_VOID__STRING_STRING (GClosure *closure,54_u1_marshal_VOID__STRING_STRING (GClosure *closure,
92 GValue *return_value G_GNUC_UNUSED,55 GValue *return_value G_GNUC_UNUSED,
9356
=== modified file 'libubuntuone/u1-marshal.h'
--- libubuntuone/u1-marshal.h 2010-02-16 20:56:56 +0000
+++ libubuntuone/u1-marshal.h 2011-03-18 20:44:28 +0000
@@ -6,16 +6,7 @@
66
7G_BEGIN_DECLS7G_BEGIN_DECLS
88
9/* NONE:STRING,OBJECT (u1-marshal.list:1) */9/* NONE:STRING,STRING (u1-marshal.list:1) */
10extern void _u1_marshal_VOID__STRING_OBJECT (GClosure *closure,
11 GValue *return_value,
12 guint n_param_values,
13 const GValue *param_values,
14 gpointer invocation_hint,
15 gpointer marshal_data);
16#define _u1_marshal_NONE__STRING_OBJECT _u1_marshal_VOID__STRING_OBJECT
17
18/* NONE:STRING,STRING (u1-marshal.list:2) */
19extern void _u1_marshal_VOID__STRING_STRING (GClosure *closure,10extern void _u1_marshal_VOID__STRING_STRING (GClosure *closure,
20 GValue *return_value,11 GValue *return_value,
21 guint n_param_values,12 guint n_param_values,
2213
=== modified file 'libubuntuone/u1-marshal.list'
--- libubuntuone/u1-marshal.list 2009-12-21 13:09:23 +0000
+++ libubuntuone/u1-marshal.list 2011-03-18 20:44:28 +0000
@@ -1,2 +1,1 @@
1NONE:STRING,OBJECT
2NONE:STRING,STRING1NONE:STRING,STRING
32
=== modified file 'libubuntuone/u1-music-store.c'
--- libubuntuone/u1-music-store.c 2011-03-10 01:13:12 +0000
+++ libubuntuone/u1-music-store.c 2011-03-18 20:44:28 +0000
@@ -24,13 +24,13 @@
24#include <libxml/HTMLparser.h>24#include <libxml/HTMLparser.h>
25#include <glib/gi18n.h>25#include <glib/gi18n.h>
26#include <webkit/webkit.h>26#include <webkit/webkit.h>
27#include <dbus/dbus-glib.h>
28#include <libsoup/soup-gnome-features.h>27#include <libsoup/soup-gnome-features.h>
29#include <libsoup/soup-uri.h>28#include <libsoup/soup-uri.h>
30#include <libsyncdaemon/libsyncdaemon.h>29#include <libsyncdaemon/libsyncdaemon.h>
31#include "oauth.h"30#include "oauth.h"
32#include "u1-music-store.h"31#include "u1-music-store.h"
33#include "u1-marshal.h"32#include "u1-marshal.h"
33#include "u1-request-chrome.h"
3434
35#define U1_MUSIC_LIBRARY_LOCATION ".ubuntuone/Purchased from Ubuntu One"35#define U1_MUSIC_LIBRARY_LOCATION ".ubuntuone/Purchased from Ubuntu One"
3636
@@ -50,7 +50,6 @@
50#define MAXIMUM_AUTH_RETRIES 550#define MAXIMUM_AUTH_RETRIES 5
5151
52struct _U1MusicStorePrivate {52struct _U1MusicStorePrivate {
53 DBusGConnection *bus;
54 SyncdaemonDaemon *syncdaemon;53 SyncdaemonDaemon *syncdaemon;
55 gchar *base_url;54 gchar *base_url;
5655
@@ -60,6 +59,14 @@
60 WebKitWebFrame *frame_to_use;59 WebKitWebFrame *frame_to_use;
61 GtkWidget *progress;60 GtkWidget *progress;
6261
62 /* Alert bar widgets
63 * We use two button widgets here, to avoid overlapping conditions
64 */
65 GtkWidget *alertbar;
66 GtkWidget *alert_label;
67 GtkWidget *subscribe_btn;
68 gboolean folder_subscribed;
69
63 guint watch_id;70 guint watch_id;
64 guint idle_cb;71 guint idle_cb;
65 GHashTable *watched_downloads;72 GHashTable *watched_downloads;
@@ -97,9 +104,6 @@
97 if (music_store->priv->base_url != NULL)104 if (music_store->priv->base_url != NULL)
98 g_free (music_store->priv->base_url);105 g_free (music_store->priv->base_url);
99106
100 if (music_store->priv->bus != NULL)
101 dbus_g_connection_unref (music_store->priv->bus);
102
103 if (music_store->priv->syncdaemon != NULL)107 if (music_store->priv->syncdaemon != NULL)
104 g_object_unref (G_OBJECT (music_store->priv->syncdaemon));108 g_object_unref (G_OBJECT (music_store->priv->syncdaemon));
105109
@@ -237,7 +241,7 @@
237241
238 *oauth_consumer_token = *oauth_consumer_secret = *oauth_token = *oauth_token_secret = NULL;242 *oauth_consumer_token = *oauth_consumer_secret = *oauth_token = *oauth_token_secret = NULL;
239243
240 /* Get the OAuth token from the keyring */244 /* Get the OAuth token from the SSO client */
241 if ((credentials = syncdaemon_authentication_find_credentials (245 if ((credentials = syncdaemon_authentication_find_credentials (
242 syncdaemon_daemon_get_authentication (music_store->priv->syncdaemon)))) {246 syncdaemon_daemon_get_authentication (music_store->priv->syncdaemon)))) {
243 *oauth_consumer_token = g_strdup (syncdaemon_credentials_get_consumer_key (credentials));247 *oauth_consumer_token = g_strdup (syncdaemon_credentials_get_consumer_key (credentials));
@@ -508,6 +512,7 @@
508 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);512 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
509 SoupURI *parsed_uri;513 SoupURI *parsed_uri;
510 gchar *internal_uri;514 gchar *internal_uri;
515 gboolean return_val = FALSE;
511516
512 /* Remove watching callback for the page */517 /* Remove watching callback for the page */
513 if (music_store->priv->watch_id != 0) {518 if (music_store->priv->watch_id != 0) {
@@ -547,7 +552,7 @@
547 g_debug ("overriding the library page to ours");552 g_debug ("overriding the library page to ours");
548 load_delayed_page (web_view, library_override, policy_decision);553 load_delayed_page (web_view, library_override, policy_decision);
549554
550 return TRUE;555 return_val = TRUE;
551 }556 }
552 } else if (!g_strcmp0 ((const gchar *) parsed_uri->host, "www.7digital.com")) {557 } else if (!g_strcmp0 ((const gchar *) parsed_uri->host, "www.7digital.com")) {
553 /* host is 7digital.com. It must be in our store. */558 /* host is 7digital.com. It must be in our store. */
@@ -566,7 +571,7 @@
566 g_free (internal_uri);571 g_free (internal_uri);
567 g_free (to_and_from_error_uris);572 g_free (to_and_from_error_uris);
568573
569 return TRUE;574 return_val = TRUE;
570 }575 }
571 } else if (!g_strcmp0 ((const gchar *) parsed_uri->host, "one.ubuntu.com")) {576 } else if (!g_strcmp0 ((const gchar *) parsed_uri->host, "one.ubuntu.com")) {
572 /* host is one.ubuntu.com. It must not be the login page */577 /* host is one.ubuntu.com. It must not be the login page */
@@ -593,7 +598,7 @@
593 g_free (internal_uri);598 g_free (internal_uri);
594 g_free (to_and_from_error_uris);599 g_free (to_and_from_error_uris);
595600
596 return TRUE;601 return_val = TRUE;
597 }602 }
598 } else if (!g_strcmp0 ((const gchar *) parsed_uri->host, "login.ubuntu.com")) {603 } else if (!g_strcmp0 ((const gchar *) parsed_uri->host, "login.ubuntu.com")) {
599 gchar *real_url;604 gchar *real_url;
@@ -618,13 +623,13 @@
618 g_free (internal_uri);623 g_free (internal_uri);
619 g_free (to_and_from_error_uris);624 g_free (to_and_from_error_uris);
620625
621 return TRUE;626 return_val = TRUE;
622 }627 }
623628
624 /* Free memory */629 /* Free memory */
625 soup_uri_free (parsed_uri);630 soup_uri_free (parsed_uri);
626631
627 return FALSE;632 return return_val;
628}633}
629634
630static void635static void
@@ -824,8 +829,10 @@
824load_finished_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data)829load_finished_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data)
825{830{
826 const gchar *library_override;831 const gchar *library_override;
827 gchar *tmp_url;
828 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);832 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
833 SoupURI * uri;
834
835 uri = soup_uri_new (webkit_web_view_get_uri (web_view));
829836
830 /* Remove the initial view if still around */837 /* Remove the initial view if still around */
831 if (music_store->priv->initial_web_viewer != NULL) {838 if (music_store->priv->initial_web_viewer != NULL) {
@@ -846,8 +853,15 @@
846 execute_script (web_view, "u1-library-override.js", library_override);853 execute_script (web_view, "u1-library-override.js", library_override);
847854
848 /* If the URL just loaded is the library page, update download status */855 /* If the URL just loaded is the library page, update download status */
849 tmp_url = g_strdup_printf ("%s%s", music_store->priv->base_url, U1_LIBRARY_URL);856 if (g_str_has_prefix (uri->path, U1_LIBRARY_URL)) {
850 if (g_str_has_prefix (webkit_web_view_get_uri (web_view), tmp_url)) {857 /* Show the alert bar if folder is unsubscribed */
858 if (!music_store->priv->folder_subscribed) {
859 gtk_label_set_text (GTK_LABEL (music_store->priv->alert_label),
860 _("Your 'Purchased Music' folder is not subscribed. New purchases will not download to this computer."));
861 gtk_widget_show (music_store->priv->subscribe_btn);
862 gtk_widget_show (music_store->priv->alertbar);
863 }
864
851 /* Inject JavaScript to make songs clickable 865 /* Inject JavaScript to make songs clickable
852 Needs to be done before update-status-in-library-page */866 Needs to be done before update-status-in-library-page */
853 execute_script (web_view, "u1-songs-clickable.js", NULL);867 execute_script (web_view, "u1-songs-clickable.js", NULL);
@@ -859,13 +873,13 @@
859 music_store->priv->watch_id = g_timeout_add (1000, (GSourceFunc) poll_downloads_cb, music_store);873 music_store->priv->watch_id = g_timeout_add (1000, (GSourceFunc) poll_downloads_cb, music_store);
860 }874 }
861875
862 g_free (tmp_url);
863
864 /* Signal users the URL finished loading */876 /* Signal users the URL finished loading */
865 gtk_widget_hide (music_store->priv->progress);877 gtk_widget_hide (music_store->priv->progress);
866878
867 g_signal_emit (music_store, u1_music_store_signals[URL_LOADED_SIGNAL], 0,879 g_signal_emit (music_store, u1_music_store_signals[URL_LOADED_SIGNAL], 0,
868 (const gchar *) webkit_web_view_get_uri (WEBKIT_WEB_VIEW (music_store->priv->web_viewer)));880 (const gchar *) webkit_web_view_get_uri (WEBKIT_WEB_VIEW (music_store->priv->web_viewer)));
881
882 soup_uri_free (uri);
869}883}
870884
871static void885static void
@@ -902,9 +916,12 @@
902static gboolean916static gboolean
903load_error_cb (WebKitWebView *web_view, WebKitWebFrame *frame, const gchar *uri, GError *error, gpointer user_data)917load_error_cb (WebKitWebView *web_view, WebKitWebFrame *frame, const gchar *uri, GError *error, gpointer user_data)
904{918{
905 load_internal_html_page (web_view, U1_DEFAULT_ERROR_PAGE, uri);919 if (error->domain == WEBKIT_NETWORK_ERROR) {
920 load_internal_html_page (web_view, U1_DEFAULT_ERROR_PAGE, uri);
921 return TRUE;
922 }
906923
907 return TRUE;924 return FALSE;
908}925}
909926
910static gboolean927static gboolean
@@ -944,11 +961,40 @@
944}961}
945962
946static void963static void
964sd_folder_subscribed_cb (SyncdaemonDaemon *daemon, gboolean success,
965 SyncdaemonFolderInfo *folder_info, gpointer user_data)
966{
967 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
968 const gchar *new_path = syncdaemon_folder_info_get_path (folder_info);
969 const gchar *lib_path = u1_music_store_get_library_location (music_store);
970
971 if (success && g_strcmp0 (new_path, lib_path) == 0) {
972 music_store->priv->folder_subscribed = TRUE;
973 gtk_widget_hide (music_store->priv->subscribe_btn);
974 gtk_widget_hide (music_store->priv->alertbar);
975 }
976}
977
978static void
979subscribe_purchased_folder (GtkButton *button, gpointer user_data)
980{
981 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
982 SyncdaemonFolderInfo *folder_info;
983
984 folder_info = syncdaemon_daemon_get_folder_info (music_store->priv->syncdaemon,
985 u1_music_store_get_library_location (music_store));
986 syncdaemon_daemon_subscribe_folder (music_store->priv->syncdaemon,
987 syncdaemon_folder_info_get_volume_id (folder_info));
988}
989
990static void
947u1_music_store_init (U1MusicStore *music_store)991u1_music_store_init (U1MusicStore *music_store)
948{992{
949 gchar *new_user_agent;993 gchar *new_user_agent;
950 const gchar *url_to_use;994 const gchar *url_to_use;
951 GError *error = NULL;995 SoupSession *session;
996 GtkWidget *alert_icon;
997 SyncdaemonFolderInfo *folder_info;
952998
953 if (!g_thread_get_initialized ())999 if (!g_thread_get_initialized ())
954 g_thread_init (NULL);1000 g_thread_init (NULL);
@@ -957,32 +1003,16 @@
957 music_store->priv->watched_downloads = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);1003 music_store->priv->watched_downloads = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
958 music_store->priv->syncdaemon = syncdaemon_daemon_new ();1004 music_store->priv->syncdaemon = syncdaemon_daemon_new ();
9591005
1006 g_signal_connect (G_OBJECT (music_store->priv->syncdaemon),
1007 "folder_subscribed",
1008 G_CALLBACK (sd_folder_subscribed_cb), music_store);
1009
960 /* If U1MUSICSTOREURL is defined, use that instead of the real URL */1010 /* If U1MUSICSTOREURL is defined, use that instead of the real URL */
961 if (! (url_to_use = g_getenv ("U1MUSICSTOREURL")))1011 if (! (url_to_use = g_getenv ("U1MUSICSTOREURL")))
962 url_to_use = "https://one.ubuntu.com";1012 url_to_use = "https://one.ubuntu.com";
9631013
964 music_store->priv->base_url = g_strdup (url_to_use);1014 music_store->priv->base_url = g_strdup (url_to_use);
9651015
966 /* Initialize DBus */
967 music_store->priv->bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
968 if (error) {
969 g_warning ("Couldn't get session bus: %s", error->message);
970 g_error_free (error);
971
972 }
973
974 dbus_g_object_register_marshaller (_u1_marshal_VOID__STRING_STRING,
975 G_TYPE_NONE,
976 G_TYPE_STRING, G_TYPE_STRING,
977 G_TYPE_INVALID);
978 dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__VOID,
979 G_TYPE_NONE,
980 G_TYPE_INVALID);
981 dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__STRING,
982 G_TYPE_NONE,
983 G_TYPE_STRING,
984 G_TYPE_INVALID);
985
986 /* Create web viewer object */1016 /* Create web viewer object */
987 music_store->priv->scroll = gtk_scrolled_window_new (NULL, NULL);1017 music_store->priv->scroll = gtk_scrolled_window_new (NULL, NULL);
988 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (music_store->priv->scroll),1018 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (music_store->priv->scroll),
@@ -1002,8 +1032,13 @@
1002 NULL);1032 NULL);
1003 g_free(new_user_agent);1033 g_free(new_user_agent);
10041034
1035 session = webkit_get_default_session ();
1036
1005 /* Use GNOME proxy settings */1037 /* Use GNOME proxy settings */
1006 soup_session_add_feature_by_type (webkit_get_default_session (), SOUP_TYPE_PROXY_RESOLVER_GNOME);1038 soup_session_add_feature_by_type (session, SOUP_TYPE_PROXY_RESOLVER_GNOME);
1039
1040 /* Add our handler for u1chrome: URIs */
1041 soup_session_add_feature_by_type (session, U1_TYPE_REQUEST_CHROME);
10071042
1008 g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "navigation-policy-decision-requested",1043 g_signal_connect (G_OBJECT (music_store->priv->web_viewer), "navigation-policy-decision-requested",
1009 G_CALLBACK (navigation_requested_cb), music_store);1044 G_CALLBACK (navigation_requested_cb), music_store);
@@ -1024,6 +1059,34 @@
1024 gtk_widget_show (music_store->priv->initial_web_viewer);1059 gtk_widget_show (music_store->priv->initial_web_viewer);
1025 gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->initial_web_viewer);1060 gtk_container_add (GTK_CONTAINER (music_store->priv->scroll), music_store->priv->initial_web_viewer);
10261061
1062 /* Create the alert bar */
1063 music_store->priv->alertbar = gtk_hbox_new (FALSE, 12);
1064 alert_icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
1065 GTK_ICON_SIZE_MENU);
1066 gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar), alert_icon,
1067 FALSE, FALSE, 0);
1068 gtk_widget_show (alert_icon);
1069
1070 music_store->priv->alert_label = gtk_label_new ("");
1071 gtk_misc_set_alignment (GTK_MISC (music_store->priv->alert_label),
1072 0.0, 0.5);
1073 gtk_box_pack_start (GTK_BOX (music_store->priv->alertbar),
1074 music_store->priv->alert_label,
1075 TRUE, TRUE, 0);
1076 gtk_widget_show (music_store->priv->alert_label);
1077
1078 /* Button to subscribe the Purchased Music folder */
1079 music_store->priv->subscribe_btn = gtk_button_new_with_label (_("Subscribe"));
1080 gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
1081 music_store->priv->subscribe_btn,
1082 FALSE, FALSE, 6);
1083 g_signal_connect (G_OBJECT (music_store->priv->subscribe_btn), "clicked",
1084 G_CALLBACK (subscribe_purchased_folder), music_store);
1085
1086 /* Figure out if the Purchased Music folder is subscribed */
1087 folder_info = syncdaemon_daemon_get_folder_info (music_store->priv->syncdaemon, u1_music_store_get_library_location (music_store));
1088 music_store->priv->folder_subscribed = syncdaemon_folder_info_get_subscribed (folder_info);
1089
1027 /* Create a hidden progress bar */1090 /* Create a hidden progress bar */
1028 music_store->priv->progress = gtk_progress_bar_new ();1091 music_store->priv->progress = gtk_progress_bar_new ();
1029 1092
@@ -1033,8 +1096,9 @@
1033 /* And load the real store in the background */1096 /* And load the real store in the background */
1034 music_store->priv->idle_cb = g_idle_add ((GSourceFunc) load_real_store_cb, music_store);1097 music_store->priv->idle_cb = g_idle_add ((GSourceFunc) load_real_store_cb, music_store);
10351098
1036 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 3);1099 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->alertbar, FALSE, FALSE, 6);
1037 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->progress, FALSE, FALSE, 3);1100 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 0);
1101 gtk_box_pack_end (GTK_BOX (music_store), music_store->priv->progress, FALSE, FALSE, 0);
1038}1102}
10391103
1040/**1104/**
10411105
=== added file 'libubuntuone/u1-request-chrome.c'
--- libubuntuone/u1-request-chrome.c 1970-01-01 00:00:00 +0000
+++ libubuntuone/u1-request-chrome.c 2011-03-18 20:44:28 +0000
@@ -0,0 +1,90 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright (C) 2011 Canonical, Ltd.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU Lesser General Public
7 * License as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifdef HAVE_CONFIG_H
21#include <config.h>
22#endif
23
24#include <gio/gio.h>
25#include <glib/gi18n-lib.h>
26#include <libsoup/soup-uri.h>
27
28#include "u1-request-chrome.h"
29
30static GInputStream *u1_request_chrome_send (SoupRequest *request,
31 GCancellable *cancellable,
32 GError **error);
33static goffset u1_request_chrome_get_content_length (SoupRequest *request);
34static const gchar *u1_request_chrome_get_content_type (SoupRequest *request);
35
36G_DEFINE_TYPE (U1RequestChrome, u1_request_chrome, SOUP_TYPE_REQUEST)
37
38/* The URI schemes we handle */
39static const gchar *chrome_schemes[] = { "u1chrome", NULL };
40
41struct _U1RequestChromePrivate {
42};
43
44static void
45u1_request_chrome_init (U1RequestChrome *chrome)
46{
47 chrome->priv = G_TYPE_INSTANCE_GET_PRIVATE (chrome, U1_TYPE_REQUEST_CHROME, U1RequestChromePrivate);
48}
49
50static void
51u1_request_chrome_class_init (U1RequestChromeClass *klass)
52{
53 SoupRequestClass *request_class = SOUP_REQUEST_CLASS (klass);
54
55 request_class->schemes = chrome_schemes;
56
57 g_type_class_add_private (klass, sizeof (U1RequestChromeClass));
58
59 request_class->send = u1_request_chrome_send;
60 request_class->get_content_length = u1_request_chrome_get_content_length;
61 request_class->get_content_type = u1_request_chrome_get_content_type;
62}
63
64static GInputStream *
65u1_request_chrome_send (SoupRequest *request,
66 GCancellable *cancellable,
67 GError **error)
68{
69 SoupURI *uri = soup_request_get_uri (request);
70 gchar *data;
71
72 if (uri->path && !g_ascii_strcasecmp (uri->path, "empty"))
73 data = g_strdup ("");
74 else
75 data = g_strdup ("");
76
77 return g_memory_input_stream_new_from_data (data, strlen (data), g_free);
78}
79
80static goffset
81u1_request_chrome_get_content_length (SoupRequest *request)
82{
83 return -1;
84}
85
86static const gchar *
87u1_request_chrome_get_content_type (SoupRequest *request)
88{
89 return "text/plain";
90}
091
=== added file 'libubuntuone/u1-request-chrome.h'
--- libubuntuone/u1-request-chrome.h 1970-01-01 00:00:00 +0000
+++ libubuntuone/u1-request-chrome.h 2011-03-18 20:44:28 +0000
@@ -0,0 +1,49 @@
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright (C) 2011 Canonical, Ltd.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU Lesser General Public
7 * License as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifndef __U1_REQUEST_CHROME_H__
21#define __U1_REQUEST_CHROME_H__
22
23#define LIBSOUP_USE_UNSTABLE_REQUEST_API
24#include <libsoup/soup-request.h>
25
26#define U1_TYPE_REQUEST_CHROME (u1_request_chrome_get_type ())
27#define U1_REQUEST_CHROME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), U1_TYPE_REQUEST_CHROME, U1RequestChrome))
28#define U1_IS_REQUEST_CHROME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), U1_TYPE_REQUEST_CHROME))
29#define U1_REQUEST_CHROME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), U1_TYPE_REQUEST_CHROME, U1RequestChrome))
30#define U1_IS_REQUEST_CHROME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), U1_TYPE_REQUEST_CHROME))
31#define U1_REQUEST_CHROME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), U1_TYPE_REQUEST_CHROME, U1RequestChrome))
32
33typedef struct _U1RequestChrome U1RequestChrome;
34typedef struct _U1RequestChromeClass U1RequestChromeClass;
35typedef struct _U1RequestChromePrivate U1RequestChromePrivate;
36
37struct _U1RequestChrome {
38 SoupRequest parent;
39
40 U1RequestChromePrivate *priv;
41};
42
43struct _U1RequestChromeClass {
44 SoupRequestClass parent_class;
45};
46
47GType u1_request_chrome_get_type (void);
48
49#endif

Subscribers

People subscribed via source and target branches

to all changes: