{
res.append (node.get_string ());
if (index < len - 1)
res.append (separator);
});
return res.str;
}
public string[] json_array_to_str_array (Json.Array array)
{
string [] res = {};
array.foreach_element ((a, index, node) =>
{
res += node.get_string ();
});
return res;
}
public RemoteVideoDetails process_details_results (string json_data) throws Error
{
//此函数去掉或者将下列代码注释掉,preview页面图片不能正常显示,具体原因尚未搞清楚
var parser = new Json.Parser ();
parser.load_from_data (json_data);
var details = parser.get_root ().get_object ();
var video = RemoteVideoDetails ();
video.title = details.get_string_member ("title");
video.image = details.get_string_member ("image");
video.description = details.get_string_member ("description");
video.source = details.get_string_member ("source");
if (details.has_member ("release_date"))
{
// v1 spec states release_date will be YYYY-MM-DD
var release_date = GLib.Time ();
if (release_date.strptime (details.get_string_member ("release_date"), "%Y-%m-%d") != null)
{
video.release_date = release_date.format ("%Y");
}
else
{
warning ("Failed to parse release_date: '%s'", details.get_string_member ("release_date"));
}
}
video.price = details.has_member ("formatted_price") ? details.get_string_member ("formatted_price") : "";
video.duration = 0;
if (details.has_member ("duration"))
video.duration = int.parse (details.get_string_member ("duration")) / 60;
video.directors = {};
if (details.has_member ("directors"))
{
var directors = details.get_array_member ("directors");
video.directors = json_array_to_str_array (directors);
}
if (details.has_member ("starring"))
{
var starring = details.get_array_member ("starring");
video.starring = join_array (starring, ", ");
}
video.genres = {};
if (details.has_member ("genres"))
{
var genres = details.get_array_member ("genres");
video.genres = json_array_to_str_array (genres);
}
if (details.has_member ("uploaded_by"))
video.uploaded_by = details.get_string_member ("uploaded_by");
if (details.has_member ("date_uploaded"))
video.date_uploaded = details.get_string_member ("date_uploaded");
return video;
}
/**
* Parses JSON data returned by 'sources' query, returns list of sources (e.g. "Amazon", "Youtube" etc.)
*/
public Gee.ArrayList
? process_sources_results (string json_data) throws Error
{
var parser = new Json.Parser ();
parser.load_from_data (json_data);
var sources_array = parser.get_root ().get_array ();
var results = new Gee.ArrayList (null);
sources_array.foreach_element ((array, index, node) =>
{
results.add (node.get_string ());
});
return results;
}
}
unity-china-video-scope/vapi/ 000775 001750 001750 00000000000 12607616420 017004 5 ustar 00kylin kylin 000000 000000 unity-china-video-scope/README 000664 001750 001750 00000000202 12607616420 016717 0 ustar 00kylin kylin 000000 000000
#Install
sudo mkdir /usr/share/unity/lenses/video
sudo cp video.lens /usr/share/unity/lenses/video
#Run
./src/unity-lens-video
unity-china-video-scope/src/a.log 000664 001750 001750 00000000000 12607616420 017545 0 ustar 00kylin kylin 000000 000000 unity-china-video-scope/src/video-file.c 000664 001750 001750 00000033112 12607616420 021023 0 ustar 00kylin kylin 000000 000000 /* video-file.c generated by valac 0.20.1, the Vala compiler
* generated from video-file.vala, do not modify */
/*
* Copyright (C) 2012 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by Pawel Stolowski
*
*/
#include
#include
#include
#include
#define UNITY_VIDEO_LENS_TYPE_VIDEO_FILE (unity_video_lens_video_file_get_type ())
typedef struct _UnityVideoLensVideoFile UnityVideoLensVideoFile;
#define _g_free0(var) (var = (g_free (var), NULL))
#define UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_FILE (unity_video_lens_remote_video_file_get_type ())
typedef struct _UnityVideoLensRemoteVideoFile UnityVideoLensRemoteVideoFile;
#define UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_DETAILS (unity_video_lens_remote_video_details_get_type ())
typedef struct _UnityVideoLensRemoteVideoDetails UnityVideoLensRemoteVideoDetails;
struct _UnityVideoLensVideoFile {
gchar* title;
gchar* lc_title;
gchar* comment;
gchar* uri;
gchar* icon;
gint category;
};
struct _UnityVideoLensRemoteVideoFile {
gchar* title;
gchar* comment;
gchar* uri;
gchar* icon;
gchar* details_uri;
gchar* price;
gint category;
};
struct _UnityVideoLensRemoteVideoDetails {
gchar* title;
gchar* description;
gchar* uri;
gchar* image;
gchar* source;
gchar* release_date;
gint duration;
gchar** directors;
gint directors_length1;
gchar* starring;
gchar** genres;
gint genres_length1;
gchar* uploaded_by;
gchar* date_uploaded;
gchar* price;
};
GType unity_video_lens_video_file_get_type (void) G_GNUC_CONST;
UnityVideoLensVideoFile* unity_video_lens_video_file_dup (const UnityVideoLensVideoFile* self);
void unity_video_lens_video_file_free (UnityVideoLensVideoFile* self);
void unity_video_lens_video_file_copy (const UnityVideoLensVideoFile* self, UnityVideoLensVideoFile* dest);
void unity_video_lens_video_file_destroy (UnityVideoLensVideoFile* self);
GType unity_video_lens_remote_video_file_get_type (void) G_GNUC_CONST;
UnityVideoLensRemoteVideoFile* unity_video_lens_remote_video_file_dup (const UnityVideoLensRemoteVideoFile* self);
void unity_video_lens_remote_video_file_free (UnityVideoLensRemoteVideoFile* self);
void unity_video_lens_remote_video_file_copy (const UnityVideoLensRemoteVideoFile* self, UnityVideoLensRemoteVideoFile* dest);
void unity_video_lens_remote_video_file_destroy (UnityVideoLensRemoteVideoFile* self);
GType unity_video_lens_remote_video_details_get_type (void) G_GNUC_CONST;
UnityVideoLensRemoteVideoDetails* unity_video_lens_remote_video_details_dup (const UnityVideoLensRemoteVideoDetails* self);
void unity_video_lens_remote_video_details_free (UnityVideoLensRemoteVideoDetails* self);
void unity_video_lens_remote_video_details_copy (const UnityVideoLensRemoteVideoDetails* self, UnityVideoLensRemoteVideoDetails* dest);
void unity_video_lens_remote_video_details_destroy (UnityVideoLensRemoteVideoDetails* self);
static gchar** _vala_array_dup2 (gchar** self, int length);
static gchar** _vala_array_dup3 (gchar** self, int length);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
void unity_video_lens_video_file_copy (const UnityVideoLensVideoFile* self, UnityVideoLensVideoFile* dest) {
const gchar* _tmp0_;
gchar* _tmp1_;
const gchar* _tmp2_;
gchar* _tmp3_;
const gchar* _tmp4_;
gchar* _tmp5_;
const gchar* _tmp6_;
gchar* _tmp7_;
const gchar* _tmp8_;
gchar* _tmp9_;
gint _tmp10_;
_tmp0_ = (*self).title;
_tmp1_ = g_strdup (_tmp0_);
_g_free0 ((*dest).title);
(*dest).title = _tmp1_;
_tmp2_ = (*self).lc_title;
_tmp3_ = g_strdup (_tmp2_);
_g_free0 ((*dest).lc_title);
(*dest).lc_title = _tmp3_;
_tmp4_ = (*self).comment;
_tmp5_ = g_strdup (_tmp4_);
_g_free0 ((*dest).comment);
(*dest).comment = _tmp5_;
_tmp6_ = (*self).uri;
_tmp7_ = g_strdup (_tmp6_);
_g_free0 ((*dest).uri);
(*dest).uri = _tmp7_;
_tmp8_ = (*self).icon;
_tmp9_ = g_strdup (_tmp8_);
_g_free0 ((*dest).icon);
(*dest).icon = _tmp9_;
_tmp10_ = (*self).category;
(*dest).category = _tmp10_;
}
void unity_video_lens_video_file_destroy (UnityVideoLensVideoFile* self) {
_g_free0 ((*self).title);
_g_free0 ((*self).lc_title);
_g_free0 ((*self).comment);
_g_free0 ((*self).uri);
_g_free0 ((*self).icon);
}
UnityVideoLensVideoFile* unity_video_lens_video_file_dup (const UnityVideoLensVideoFile* self) {
UnityVideoLensVideoFile* dup;
dup = g_new0 (UnityVideoLensVideoFile, 1);
unity_video_lens_video_file_copy (self, dup);
return dup;
}
void unity_video_lens_video_file_free (UnityVideoLensVideoFile* self) {
unity_video_lens_video_file_destroy (self);
g_free (self);
}
GType unity_video_lens_video_file_get_type (void) {
static volatile gsize unity_video_lens_video_file_type_id__volatile = 0;
if (g_once_init_enter (&unity_video_lens_video_file_type_id__volatile)) {
GType unity_video_lens_video_file_type_id;
unity_video_lens_video_file_type_id = g_boxed_type_register_static ("UnityVideoLensVideoFile", (GBoxedCopyFunc) unity_video_lens_video_file_dup, (GBoxedFreeFunc) unity_video_lens_video_file_free);
g_once_init_leave (&unity_video_lens_video_file_type_id__volatile, unity_video_lens_video_file_type_id);
}
return unity_video_lens_video_file_type_id__volatile;
}
void unity_video_lens_remote_video_file_copy (const UnityVideoLensRemoteVideoFile* self, UnityVideoLensRemoteVideoFile* dest) {
const gchar* _tmp0_;
gchar* _tmp1_;
const gchar* _tmp2_;
gchar* _tmp3_;
const gchar* _tmp4_;
gchar* _tmp5_;
const gchar* _tmp6_;
gchar* _tmp7_;
const gchar* _tmp8_;
gchar* _tmp9_;
const gchar* _tmp10_;
gchar* _tmp11_;
gint _tmp12_;
_tmp0_ = (*self).title;
_tmp1_ = g_strdup (_tmp0_);
_g_free0 ((*dest).title);
(*dest).title = _tmp1_;
_tmp2_ = (*self).comment;
_tmp3_ = g_strdup (_tmp2_);
_g_free0 ((*dest).comment);
(*dest).comment = _tmp3_;
_tmp4_ = (*self).uri;
_tmp5_ = g_strdup (_tmp4_);
_g_free0 ((*dest).uri);
(*dest).uri = _tmp5_;
_tmp6_ = (*self).icon;
_tmp7_ = g_strdup (_tmp6_);
_g_free0 ((*dest).icon);
(*dest).icon = _tmp7_;
_tmp8_ = (*self).details_uri;
_tmp9_ = g_strdup (_tmp8_);
_g_free0 ((*dest).details_uri);
(*dest).details_uri = _tmp9_;
_tmp10_ = (*self).price;
_tmp11_ = g_strdup (_tmp10_);
_g_free0 ((*dest).price);
(*dest).price = _tmp11_;
_tmp12_ = (*self).category;
(*dest).category = _tmp12_;
}
void unity_video_lens_remote_video_file_destroy (UnityVideoLensRemoteVideoFile* self) {
_g_free0 ((*self).title);
_g_free0 ((*self).comment);
_g_free0 ((*self).uri);
_g_free0 ((*self).icon);
_g_free0 ((*self).details_uri);
_g_free0 ((*self).price);
}
UnityVideoLensRemoteVideoFile* unity_video_lens_remote_video_file_dup (const UnityVideoLensRemoteVideoFile* self) {
UnityVideoLensRemoteVideoFile* dup;
dup = g_new0 (UnityVideoLensRemoteVideoFile, 1);
unity_video_lens_remote_video_file_copy (self, dup);
return dup;
}
void unity_video_lens_remote_video_file_free (UnityVideoLensRemoteVideoFile* self) {
unity_video_lens_remote_video_file_destroy (self);
g_free (self);
}
GType unity_video_lens_remote_video_file_get_type (void) {
static volatile gsize unity_video_lens_remote_video_file_type_id__volatile = 0;
if (g_once_init_enter (&unity_video_lens_remote_video_file_type_id__volatile)) {
GType unity_video_lens_remote_video_file_type_id;
unity_video_lens_remote_video_file_type_id = g_boxed_type_register_static ("UnityVideoLensRemoteVideoFile", (GBoxedCopyFunc) unity_video_lens_remote_video_file_dup, (GBoxedFreeFunc) unity_video_lens_remote_video_file_free);
g_once_init_leave (&unity_video_lens_remote_video_file_type_id__volatile, unity_video_lens_remote_video_file_type_id);
}
return unity_video_lens_remote_video_file_type_id__volatile;
}
static gchar** _vala_array_dup2 (gchar** self, int length) {
gchar** result;
int i;
result = g_new0 (gchar*, length + 1);
for (i = 0; i < length; i++) {
gchar* _tmp0_;
_tmp0_ = g_strdup (self[i]);
result[i] = _tmp0_;
}
return result;
}
static gchar** _vala_array_dup3 (gchar** self, int length) {
gchar** result;
int i;
result = g_new0 (gchar*, length + 1);
for (i = 0; i < length; i++) {
gchar* _tmp0_;
_tmp0_ = g_strdup (self[i]);
result[i] = _tmp0_;
}
return result;
}
void unity_video_lens_remote_video_details_copy (const UnityVideoLensRemoteVideoDetails* self, UnityVideoLensRemoteVideoDetails* dest) {
const gchar* _tmp0_;
gchar* _tmp1_;
const gchar* _tmp2_;
gchar* _tmp3_;
const gchar* _tmp4_;
gchar* _tmp5_;
const gchar* _tmp6_;
gchar* _tmp7_;
const gchar* _tmp8_;
gchar* _tmp9_;
const gchar* _tmp10_;
gchar* _tmp11_;
gint _tmp12_;
gchar** _tmp13_;
gint _tmp13__length1;
gchar** _tmp14_;
gint _tmp14__length1;
const gchar* _tmp15_;
gchar* _tmp16_;
gchar** _tmp17_;
gint _tmp17__length1;
gchar** _tmp18_;
gint _tmp18__length1;
const gchar* _tmp19_;
gchar* _tmp20_;
const gchar* _tmp21_;
gchar* _tmp22_;
const gchar* _tmp23_;
gchar* _tmp24_;
_tmp0_ = (*self).title;
_tmp1_ = g_strdup (_tmp0_);
_g_free0 ((*dest).title);
(*dest).title = _tmp1_;
_tmp2_ = (*self).description;
_tmp3_ = g_strdup (_tmp2_);
_g_free0 ((*dest).description);
(*dest).description = _tmp3_;
_tmp4_ = (*self).uri;
_tmp5_ = g_strdup (_tmp4_);
_g_free0 ((*dest).uri);
(*dest).uri = _tmp5_;
_tmp6_ = (*self).image;
_tmp7_ = g_strdup (_tmp6_);
_g_free0 ((*dest).image);
(*dest).image = _tmp7_;
_tmp8_ = (*self).source;
_tmp9_ = g_strdup (_tmp8_);
_g_free0 ((*dest).source);
(*dest).source = _tmp9_;
_tmp10_ = (*self).release_date;
_tmp11_ = g_strdup (_tmp10_);
_g_free0 ((*dest).release_date);
(*dest).release_date = _tmp11_;
_tmp12_ = (*self).duration;
(*dest).duration = _tmp12_;
_tmp13_ = (*self).directors;
_tmp13__length1 = (*self).directors_length1;
_tmp14_ = (_tmp13_ != NULL) ? _vala_array_dup2 (_tmp13_, _tmp13__length1) : ((gpointer) _tmp13_);
_tmp14__length1 = _tmp13__length1;
(*dest).directors = (_vala_array_free ((*dest).directors, (*dest).directors_length1, (GDestroyNotify) g_free), NULL);
(*dest).directors = _tmp14_;
(*dest).directors_length1 = _tmp14__length1;
_tmp15_ = (*self).starring;
_tmp16_ = g_strdup (_tmp15_);
_g_free0 ((*dest).starring);
(*dest).starring = _tmp16_;
_tmp17_ = (*self).genres;
_tmp17__length1 = (*self).genres_length1;
_tmp18_ = (_tmp17_ != NULL) ? _vala_array_dup3 (_tmp17_, _tmp17__length1) : ((gpointer) _tmp17_);
_tmp18__length1 = _tmp17__length1;
(*dest).genres = (_vala_array_free ((*dest).genres, (*dest).genres_length1, (GDestroyNotify) g_free), NULL);
(*dest).genres = _tmp18_;
(*dest).genres_length1 = _tmp18__length1;
_tmp19_ = (*self).uploaded_by;
_tmp20_ = g_strdup (_tmp19_);
_g_free0 ((*dest).uploaded_by);
(*dest).uploaded_by = _tmp20_;
_tmp21_ = (*self).date_uploaded;
_tmp22_ = g_strdup (_tmp21_);
_g_free0 ((*dest).date_uploaded);
(*dest).date_uploaded = _tmp22_;
_tmp23_ = (*self).price;
_tmp24_ = g_strdup (_tmp23_);
_g_free0 ((*dest).price);
(*dest).price = _tmp24_;
}
void unity_video_lens_remote_video_details_destroy (UnityVideoLensRemoteVideoDetails* self) {
_g_free0 ((*self).title);
_g_free0 ((*self).description);
_g_free0 ((*self).uri);
_g_free0 ((*self).image);
_g_free0 ((*self).source);
_g_free0 ((*self).release_date);
(*self).directors = (_vala_array_free ((*self).directors, (*self).directors_length1, (GDestroyNotify) g_free), NULL);
_g_free0 ((*self).starring);
(*self).genres = (_vala_array_free ((*self).genres, (*self).genres_length1, (GDestroyNotify) g_free), NULL);
_g_free0 ((*self).uploaded_by);
_g_free0 ((*self).date_uploaded);
_g_free0 ((*self).price);
}
UnityVideoLensRemoteVideoDetails* unity_video_lens_remote_video_details_dup (const UnityVideoLensRemoteVideoDetails* self) {
UnityVideoLensRemoteVideoDetails* dup;
dup = g_new0 (UnityVideoLensRemoteVideoDetails, 1);
unity_video_lens_remote_video_details_copy (self, dup);
return dup;
}
void unity_video_lens_remote_video_details_free (UnityVideoLensRemoteVideoDetails* self) {
unity_video_lens_remote_video_details_destroy (self);
g_free (self);
}
GType unity_video_lens_remote_video_details_get_type (void) {
static volatile gsize unity_video_lens_remote_video_details_type_id__volatile = 0;
if (g_once_init_enter (&unity_video_lens_remote_video_details_type_id__volatile)) {
GType unity_video_lens_remote_video_details_type_id;
unity_video_lens_remote_video_details_type_id = g_boxed_type_register_static ("UnityVideoLensRemoteVideoDetails", (GBoxedCopyFunc) unity_video_lens_remote_video_details_dup, (GBoxedFreeFunc) unity_video_lens_remote_video_details_free);
g_once_init_leave (&unity_video_lens_remote_video_details_type_id__volatile, unity_video_lens_remote_video_details_type_id);
}
return unity_video_lens_remote_video_details_type_id__volatile;
}
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
if ((array != NULL) && (destroy_func != NULL)) {
int i;
for (i = 0; i < array_length; i = i + 1) {
if (((gpointer*) array)[i] != NULL) {
destroy_func (((gpointer*) array)[i]);
}
}
}
}
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
_vala_array_destroy (array, array_length, destroy_func);
g_free (array);
}
unity-china-video-scope/po/unity-china-video-scope.pot 000664 001750 001750 00000003231 12607616420 023651 0 ustar 00kylin kylin 000000 000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-07-24 16:53+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: ../src/remote-scope.vala:215
msgid "Online"
msgstr ""
#: ../src/remote-scope.vala:216
msgid "More suggestions"
msgstr ""
#: ../src/remote-scope.vala:363
#, c-format
msgid "%d min"
msgid_plural "%d mins"
msgstr[0] ""
msgstr[1] ""
#: ../src/remote-scope.vala:374
msgid "Play"
msgstr ""
#: ../src/remote-scope.vala:385
msgid "Director"
msgid_plural "Directors"
msgstr[0] ""
msgstr[1] ""
#: ../src/remote-scope.vala:388
msgid "Cast"
msgstr ""
#: ../src/remote-scope.vala:391
msgid "Genre"
msgid_plural "Genres"
msgstr[0] ""
msgstr[1] ""
#: ../src/remote-scope.vala:395
msgid "Uploaded by"
msgstr ""
#: ../src/remote-scope.vala:398
msgid "Uploaded on"
msgstr ""
#: ../data/videoyouku.scope.in.in.h:1
msgid "Youku videos"
msgstr ""
#: ../data/videoyouku.scope.in.in.h:2
msgid ""
"This is an Ubuntu search plugin that enables information from various video "
"providers to be searched and displayed in the Dash underneath the Video "
"header. If you do not wish to search these content sources, you can disable "
"this search plugin."
msgstr ""
unity-china-video-scope/Makefile.am.coverage 000664 001750 001750 00000002505 12607616420 021675 0 ustar 00kylin kylin 000000 000000
# Coverage targets
.PHONY: clean-gcno clean-gcda \
coverage-html generate-coverage-html clean-coverage-html \
coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
if HAVE_GCOV
clean-gcno:
@echo Removing old coverage instrumentation
-find -name '*.gcno' -print | xargs -r rm
clean-gcda:
@echo Removing old coverage results
-find -name '*.gcda' -print | xargs -r rm
coverage-html: clean-gcda
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
generate-coverage-html:
@echo Collecting coverage data
$(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
clean-coverage-html: clean-gcda
-$(LCOV) --directory $(top_builddir) -z
-rm -rf coverage.info coveragereport
if HAVE_GCOVR
coverage-gcovr: clean-gcda
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
generate-coverage-gcovr:
@echo Generating coverage GCOVR report
$(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
clean-coverage-gcovr: clean-gcda
-rm -rf $(top_builddir)/coverage.xml
endif # HAVE_GCOVR
endif # HAVE_GCOV
unity-china-video-scope/.pc/ 000775 001750 001750 00000000000 12607616420 016525 5 ustar 00kylin kylin 000000 000000 unity-china-video-scope/tests/unit/data/video3.mpg 000664 001750 001750 00000000000 12607616420 022763 0 ustar 00kylin kylin 000000 000000 unity-china-video-scope/po/zh_CN.po 000664 001750 001750 00000004113 12607616420 020023 0 ustar 00kylin kylin 000000 000000 # Chinese (Simplified) translation for unity-china-music-scope
# Copyright (c) 2013 Ubuntu Kylin Members Team Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the unity-china-video-scope package.
# shijing , 2013.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: unity-china-music-scope\n"
"Report-Msgid-Bugs-To: shijing \n"
"POT-Creation-Date: 2013-07-20 10:01+0800\n"
"PO-Revision-Date: 2013-07-20 10:01+0800\n"
"Last-Translator: shijing \n"
"Language-Team: Chinese (Simplified) \n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../src/remote-scope.vala:132
msgid "Online"
msgstr "在线"
#: ../src/remote-scope.vala:133
msgid "More suggestions"
msgstr "更多建议"
#: ../src/remote-scope.vala:280
#, c-format
msgid "%d min"
msgid_plural "%d mins"
msgstr[0] "%d 分"
msgstr[1] "%d 分"
#: ../src/remote-scope.vala:291
msgid "Play"
msgstr "播放"
#: ../src/remote-scope.vala:302
msgid "Director"
msgid_plural "Directors"
msgstr[0] "导演"
msgstr[1] "导演"
#: ../src/remote-scope.vala:305
msgid "Cast"
msgstr "演员表"
#: ../src/remote-scope.vala:308
msgid "Genre"
msgid_plural "Genres"
msgstr[0] "类型"
msgstr[1] "类型"
#: ../src/remote-scope.vala:312
msgid "Uploaded by"
msgstr "更新"
#: ../src/remote-scope.vala:315
msgid "Uploaded on"
msgstr "上传"
#: ../data/videoyouku.scope.in.in.h:1
msgid "Youku videos"
msgstr "优酷视频"
#: ../data/videoyouku.scope.in.in.h:2
msgid ""
"This is an Ubuntu search plugin that enables information from various video "
"providers to be searched and displayed in the Dash underneath the Video "
"header. If you do not wish to search these content sources, you can disable "
"this search plugin."
msgstr "这是一个Ubuntu搜索插件,可以从视频提供者获得各种视频信息"
"显示在dash中。"
"如果你不希望搜索这些内容的来源,您可以禁用"
"这个搜索插件。"
unity-china-video-scope/.pc/.quilt_series 000664 001750 001750 00000000007 12607616420 021233 0 ustar 00kylin kylin 000000 000000 series
unity-china-video-scope/tests/ 000775 001750 001750 00000000000 12607616420 017207 5 ustar 00kylin kylin 000000 000000 unity-china-video-scope/tests/unit/data/ 000775 001750 001750 00000000000 12607616420 021077 5 ustar 00kylin kylin 000000 000000 unity-china-video-scope/src/Makefile.am 000664 001750 001750 00000003250 12607616420 020670 0 ustar 00kylin kylin 000000 000000 NULL =
BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
DATADIR = $(datadir)
AM_CFLAGS = -w
AM_CPPFLAGS = $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(COVERAGE_LDFLAGS)
pkglibexec_PROGRAMS = \
unity-china-video-scope \
$(NULL)
unity_china_video_scope_CPPFLAGS = \
-DDATADIR=\"$(DATADIR)\" \
-DPKGDATADIR=\"$(PKGDATADIR)\" \
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
-DG_LOG_DOMAIN=\"unity-china-video-scope\" \
$(SCOPE_DAEMON_CFLAGS) \
$(MAINTAINER_CFLAGS) \
-I$(srcdir) \
$(NULL)
unity_china_video_scope_VALAFLAGS = \
-C \
--pkg dee-1.0 \
--pkg unity \
--pkg unity-extras \
--pkg gio-2.0 \
--pkg gio-unix-2.0 \
--pkg glib-2.0 \
--pkg gee-0.8 \
--pkg zeitgeist-1.0 \
--pkg libsoup-gnome-2.4 \
--pkg libsoup-2.4 \
--pkg json-glib-1.0 \
--vapidir $(srcdir) \
--vapidir $(top_srcdir)/vapi \
--target-glib=2.26 \
$(MAINTAINER_VALAFLAGS) \
$(NULL)
unity_china_video_scope_LDADD = \
$(SCOPE_DAEMON_LIBS) \
$(NULL)
unity_china_video_scope_VALASOURCES = \
config.vala \
remote-scope-globals.vala \
remote-video-main.vala \
remote-scope.vala \
remote-uri.vala \
youku-video-search.vala \
utils.vala \
video-file.vala \
$(NULL)
unity_china_video_scope_SOURCES = \
$(unity_china_video_scope_VALASOURCES:.vala=.c) \
$(NULL)
BUILT_SOURCES += \
unity_china_video_scope.vala.stamp \
$(NULL)
EXTRA_DIST += \
unity_china_video_scope.vala.stamp \
$(unity_china_video_scope_VALASOURCES) \
$(NULL)
unity_china_video_scope.vala.stamp: $(unity_china_video_scope_VALASOURCES)
$(AM_V_GEN) $(VALAC) $(unity_china_video_scope_VALAFLAGS) $^
@touch $@
CLEANFILES += \
*.stamp \
$(unity_china_video_scope_VALASOURCES:.vala=.c) \
$(NULL)
unity-china-video-scope/data/Makefile.am 000664 001750 001750 00000001056 12607616420 021014 0 ustar 00kylin kylin 000000 000000 dbus_servicesdir = $(DBUSSERVICEDIR)
service_in_files = \
unity-china-video-scope.service.in \
$(NULL)
dbus_services_DATA = $(service_in_files:.service.in=.service)
%.service: %.service.in
$(AM_V_GEN)sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
scope_in_files = videoyouku.scope.in
scopedir = $(SCOPESDIR)/video
scope_DATA = $(scope_in_files:.scope.in=.scope)
@INTLTOOL_SCOPE_RULE@
EXTRA_DIST = \
$(service_in_files) \
$(scope_in_files) \
$(NULL)
CLEANFILES = \
unity-china-video-scope.service \
videoyouku.scope \
$(NULL)
unity-china-video-scope/po/LINGUAS 000664 001750 001750 00000000006 12607616420 017504 0 ustar 00kylin kylin 000000 000000 zh_CN
unity-china-video-scope/ 000775 001750 001750 00000000000 12607616700 016046 5 ustar 00kylin kylin 000000 000000 unity-china-video-scope/.bzr/repository/ 000775 001750 001750 00000000000 12607616420 021137 5 ustar 00kylin kylin 000000 000000 unity-china-video-scope/tests/manual/ 000775 001750 001750 00000000000 12607616420 020464 5 ustar 00kylin kylin 000000 000000 unity-china-video-scope/src/remote-scope.c 000664 001750 001750 00000375063 12607616420 021420 0 ustar 00kylin kylin 000000 000000 /* remote-scope.c generated by valac 0.20.1, the Vala compiler
* generated from remote-scope.vala, do not modify */
/*
* Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by Weihua Zhang
* Authored by shijing
* Modified Information:
* 1. Modify build_preview function , get the description information of video from youku.
* 2. Modify preview_result function, get the uri of single video from youku.
*
*/
/*
* Copyright (C) 2012 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by Pawel Stolowski
* based on python code by David Calle
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE (unity_video_lens_remote_video_scope_get_type ())
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE, UnityVideoLensRemoteVideoScope))
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE, UnityVideoLensRemoteVideoScopeClass))
#define UNITY_VIDEO_LENS_IS_REMOTE_VIDEO_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE))
#define UNITY_VIDEO_LENS_IS_REMOTE_VIDEO_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE))
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE, UnityVideoLensRemoteVideoScopeClass))
typedef struct _UnityVideoLensRemoteVideoScope UnityVideoLensRemoteVideoScope;
typedef struct _UnityVideoLensRemoteVideoScopeClass UnityVideoLensRemoteVideoScopeClass;
typedef struct _UnityVideoLensRemoteVideoScopePrivate UnityVideoLensRemoteVideoScopePrivate;
#define UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_FILE (unity_video_lens_remote_video_file_get_type ())
typedef struct _UnityVideoLensRemoteVideoFile UnityVideoLensRemoteVideoFile;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define __g_slist_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_free0_ (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _UnityVideoLensRemoteVideoScopeActivateResultData UnityVideoLensRemoteVideoScopeActivateResultData;
#define UNITY_VIDEO_LENS_TYPE_REMOTE_URI (unity_video_lens_remote_uri_get_type ())
#define UNITY_VIDEO_LENS_REMOTE_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_URI, UnityVideoLensRemoteUri))
#define UNITY_VIDEO_LENS_REMOTE_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_VIDEO_LENS_TYPE_REMOTE_URI, UnityVideoLensRemoteUriClass))
#define UNITY_VIDEO_LENS_IS_REMOTE_URI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_URI))
#define UNITY_VIDEO_LENS_IS_REMOTE_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_VIDEO_LENS_TYPE_REMOTE_URI))
#define UNITY_VIDEO_LENS_REMOTE_URI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_URI, UnityVideoLensRemoteUriClass))
typedef struct _UnityVideoLensRemoteUri UnityVideoLensRemoteUri;
typedef struct _UnityVideoLensRemoteUriClass UnityVideoLensRemoteUriClass;
#define _unity_video_lens_remote_uri_unref0(var) ((var == NULL) ? NULL : (var = (unity_video_lens_remote_uri_unref (var), NULL)))
#define UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_DETAILS (unity_video_lens_remote_video_details_get_type ())
typedef struct _UnityVideoLensRemoteVideoDetails UnityVideoLensRemoteVideoDetails;
#define _unity_video_lens_remote_video_details_free0(var) ((var == NULL) ? NULL : (var = (unity_video_lens_remote_video_details_free (var), NULL)))
typedef struct _UnityVideoLensRemoteVideoScopePreviewResultData UnityVideoLensRemoteVideoScopePreviewResultData;
typedef struct _Block1Data Block1Data;
typedef struct _UnityVideoLensRemoteVideoScopeGetDetailsData UnityVideoLensRemoteVideoScopeGetDetailsData;
typedef struct _UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData;
typedef struct _Block2Data Block2Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _UnityVideoLensRemoteVideoScopePerformSearchData UnityVideoLensRemoteVideoScopePerformSearchData;
#define _unity_video_lens_remote_video_file_free0(var) ((var == NULL) ? NULL : (var = (unity_video_lens_remote_video_file_free (var), NULL)))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
struct _UnityVideoLensRemoteVideoScope {
UnityDeprecatedScope parent_instance;
UnityVideoLensRemoteVideoScopePrivate * priv;
};
struct _UnityVideoLensRemoteVideoScopeClass {
UnityDeprecatedScopeClass parent_class;
};
struct _UnityVideoLensRemoteVideoFile {
gchar* title;
gchar* comment;
gchar* uri;
gchar* icon;
gchar* details_uri;
gchar* price;
gint category;
};
struct _UnityVideoLensRemoteVideoScopePrivate {
SoupSession* session;
UnityPreferencesManager* preferences;
GeeArrayList* recommendations;
gint64 recommendations_last_update;
ZeitgeistDataSourceRegistry* zg_sources;
gboolean use_zeitgeist;
};
struct _UnityVideoLensRemoteVideoScopeActivateResultData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GSimpleAsyncResult* _async_result;
UnityVideoLensRemoteVideoScope* self;
UnityScopeResult _result_;
UnityActivationResponse* result;
UnityScopeResult _tmp0_;
GHashTable* _tmp1_;
const gchar* _tmp2_;
gconstpointer _tmp3_;
GVariant* _tmp4_;
GVariant* realcat;
gboolean _tmp5_;
GVariant* _tmp6_;
GVariant* _tmp7_;
gboolean _tmp8_;
gboolean _tmp9_;
UnityScopeResult _tmp10_;
UnityPreview* _tmp11_;
UnityPreview* preview;
UnityPreview* _tmp12_;
UnityActivationResponse* _tmp13_;
UnityScopeResult _tmp14_;
const gchar* _tmp15_;
UnityActivationResponse* _tmp16_;
};
struct _UnityVideoLensRemoteVideoDetails {
gchar* title;
gchar* description;
gchar* uri;
gchar* image;
gchar* source;
gchar* release_date;
gint duration;
gchar** directors;
gint directors_length1;
gchar* starring;
gchar** genres;
gint genres_length1;
gchar* uploaded_by;
gchar* date_uploaded;
gchar* price;
};
struct _UnityVideoLensRemoteVideoScopePreviewResultData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GSimpleAsyncResult* _async_result;
UnityVideoLensRemoteVideoScope* self;
UnityScopeResult _result_;
UnityPreview* result;
UnityScopeResult _tmp0_;
const gchar* _tmp1_;
UnityVideoLensRemoteUri* _tmp2_;
UnityVideoLensRemoteUri* fakeuri;
UnityVideoLensRemoteUri* _tmp3_;
UnityVideoLensRemoteVideoDetails* details;
gboolean _tmp4_;
UnityVideoLensRemoteUri* _tmp5_;
const gchar* _tmp6_;
const gchar* _tmp7_;
UnityVideoLensRemoteUri* _tmp8_;
const gchar* _tmp9_;
const gchar* _tmp10_;
gboolean _tmp11_;
UnityVideoLensRemoteUri* _tmp12_;
const gchar* _tmp13_;
const gchar* _tmp14_;
UnityVideoLensRemoteVideoDetails* _tmp15_;
UnityVideoLensRemoteVideoDetails* _tmp16_;
GError* e;
GError* _tmp17_;
const gchar* _tmp18_;
UnityVideoLensRemoteUri* _tmp19_;
UnityVideoLensRemoteVideoDetails* _tmp20_;
UnityPreview* _tmp21_;
UnityScopeResult _tmp22_;
const gchar* _tmp23_;
GError * _inner_error_;
};
struct _Block1Data {
int _ref_count_;
UnityVideoLensRemoteVideoScope * self;
SoupMessage* msg;
gpointer _async_data_;
};
struct _UnityVideoLensRemoteVideoScopeGetDetailsData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GSimpleAsyncResult* _async_result;
UnityVideoLensRemoteVideoScope* self;
gchar* url;
UnityVideoLensRemoteVideoDetails* result;
Block1Data* _data1_;
const gchar* _tmp0_;
SoupMessage* _tmp1_;
SoupSession* _tmp2_;
SoupMessage* _tmp3_;
SoupMessage* _tmp4_;
SoupMessage* _tmp5_;
guint _tmp6_;
guint _tmp7_;
SoupMessage* _tmp8_;
guint _tmp9_;
guint _tmp10_;
SoupMessage* _tmp11_;
gchar* _tmp12_;
gchar* _tmp13_;
gchar* _tmp14_;
SoupMessage* _tmp15_;
SoupMessageBody* _tmp16_;
guint8* _tmp17_;
gint _tmp17__length1;
UnityVideoLensRemoteVideoDetails _tmp18_;
UnityVideoLensRemoteVideoDetails details;
UnityVideoLensRemoteVideoDetails _tmp19_;
UnityVideoLensRemoteVideoDetails* _tmp20_;
UnityVideoLensRemoteVideoDetails* _tmp21_;
GError * _inner_error_;
};
struct _UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GSimpleAsyncResult* _async_result;
UnityVideoLensRemoteVideoScope* self;
UnityDeprecatedScopeSearch* search;
UnitySearchType search_type;
GCancellable* cancellable;
GCancellable* _tmp0_;
gboolean _tmp1_;
UnityDeprecatedScopeSearch* _tmp2_;
const gchar* _tmp3_;
const gchar* _tmp4_;
gchar* _tmp5_;
gchar* search_string;
const gchar* _tmp6_;
UnityDeprecatedScopeSearch* _tmp7_;
DeeSerializableModel* _tmp8_;
DeeSerializableModel* _tmp9_;
DeeSerializableModel* _tmp10_;
DeeSerializableModel* model;
DeeSerializableModel* _tmp11_;
UnityPreferencesManager* _tmp12_;
UnityPreferencesManagerRemoteContent _tmp13_;
UnityPreferencesManagerRemoteContent _tmp14_;
UnityDeprecatedScopeSearch* _tmp15_;
GeeArrayList* _tmp16_;
GeeArrayList* active_sources;
UnityOptionsFilter* _tmp17_;
UnityOptionsFilter* _tmp18_;
GList* _tmp19_;
GList* opt_collection;
GList* opt_it;
UnityFilterOption* _tmp20_;
UnityFilterOption* opt;
UnityFilterOption* _tmp21_;
const gchar* _tmp22_;
const gchar* _tmp23_;
gboolean _tmp24_;
GeeArrayList* _tmp25_;
UnityFilterOption* _tmp26_;
const gchar* _tmp27_;
const gchar* _tmp28_;
GeeArrayList* _tmp29_;
gint _tmp30_;
gint _tmp31_;
UnityOptionsFilter* _tmp32_;
UnityOptionsFilter* _tmp33_;
GList* _tmp34_;
guint _tmp35_;
GeeArrayList* _tmp36_;
UnitySearchType _tmp37_;
GeeArrayList* _tmp38_;
gboolean _tmp39_;
const gchar* _tmp40_;
UnityDeprecatedScopeSearch* _tmp41_;
GeeArrayList* _tmp42_;
GCancellable* _tmp43_;
GError* e;
GError* _tmp44_;
const gchar* _tmp45_;
UnityDeprecatedScopeSearch* _tmp46_;
GError* _vala1_e;
GError* _tmp47_;
const gchar* _tmp48_;
GError * _inner_error_;
};
struct _Block2Data {
int _ref_count_;
UnityVideoLensRemoteVideoScope * self;
SoupMessage* msg;
gboolean cancelled;
gpointer _async_data_;
};
struct _UnityVideoLensRemoteVideoScopePerformSearchData {
int _state_;
GObject* _source_object_;
GAsyncResult* _res_;
GSimpleAsyncResult* _async_result;
UnityVideoLensRemoteVideoScope* self;
gchar* search_string;
UnityDeprecatedScopeSearch* search;
GeeArrayList* active_sources;
GCancellable* cancellable;
Block2Data* _data2_;
UnityDeprecatedScopeSearch* _tmp0_;
DeeSerializableModel* _tmp1_;
DeeSerializableModel* _tmp2_;
gboolean _tmp3_;
gboolean _tmp4_;
gboolean _tmp5_;
const gchar* _tmp6_;
const gchar* _tmp7_;
gboolean _tmp8_;
GeeArrayList* _tmp9_;
gint _tmp10_;
gint _tmp11_;
gboolean _tmp12_;
GeeArrayList* _tmp13_;
gint _tmp14_;
gint _tmp15_;
gboolean _tmp16_;
GDateTime* _tmp17_;
GDateTime* time;
GDateTime* _tmp18_;
gint64 _tmp19_;
gint64 _tmp20_;
gint _tmp21_;
UnityDeprecatedScopeSearch* _tmp22_;
DeeSerializableModel* _tmp23_;
DeeSerializableModel* _tmp24_;
GeeArrayList* _tmp25_;
const gchar* _tmp26_;
GeeArrayList* _tmp27_;
gchar* _tmp28_;
gchar* url;
const gchar* _tmp29_;
gboolean _tmp30_;
gboolean _tmp31_;
const gchar* _tmp32_;
const gchar* _tmp33_;
gboolean _tmp34_;
GeeArrayList* _tmp35_;
gint _tmp36_;
gint _tmp37_;
gboolean _tmp38_;
gboolean is_treat_yourself;
const gchar* _tmp39_;
SoupMessage* _tmp40_;
SoupSession* _tmp41_;
SoupMessage* _tmp42_;
SoupMessage* _tmp43_;
gulong cancel_id;
GCancellable* _tmp44_;
GCancellable* _tmp45_;
gulong _tmp46_;
gboolean _tmp47_;
GCancellable* _tmp48_;
gulong _tmp49_;
GError* _tmp50_;
GCancellable* _tmp51_;
GCancellable* _tmp52_;
gulong _tmp53_;
SoupMessage* _tmp54_;
gboolean _tmp55_;
GeeArrayList* _tmp56_;
GeeArrayList* results;
GeeArrayList* _tmp57_;
gboolean _tmp58_;
const gchar* _tmp59_;
gboolean _tmp60_;
const gchar* _tmp61_;
gchar* _tmp62_;
gchar* _tmp63_;
gboolean _tmp64_;
GeeArrayList* _tmp65_;
gint _tmp66_;
gint _tmp67_;
gboolean _tmp68_;
gboolean _tmp69_;
GDateTime* _tmp70_;
GDateTime* _vala1_time;
GeeArrayList* _tmp71_;
GeeArrayList* _tmp72_;
GDateTime* _tmp73_;
gint64 _tmp74_;
UnityDeprecatedScopeSearch* _tmp75_;
DeeSerializableModel* _tmp76_;
DeeSerializableModel* _tmp77_;
GeeArrayList* _tmp78_;
GError * _inner_error_;
};
static gpointer unity_video_lens_remote_video_scope_parent_class = NULL;
static gint unity_video_lens_remote_video_scope_REFRESH_INTERVAL;
static gint unity_video_lens_remote_video_scope_REFRESH_INTERVAL = 3600;
static gint unity_video_lens_remote_video_scope_RETRY_INTERVAL;
static gint unity_video_lens_remote_video_scope_RETRY_INTERVAL = 60;
static gchar* unity_video_lens_remote_video_scope_IS_IN_CHINA;
static gchar* unity_video_lens_remote_video_scope_IS_IN_CHINA = NULL;
static gchar* unity_video_lens_remote_video_scope_PREVIEW_ON_LMB;
static gchar* unity_video_lens_remote_video_scope_PREVIEW_ON_LMB = NULL;
extern gint unity_video_lens_CAT_INDEX_MORE;
GType unity_video_lens_remote_video_scope_get_type (void) G_GNUC_CONST;
GType unity_video_lens_remote_video_file_get_type (void) G_GNUC_CONST;
UnityVideoLensRemoteVideoFile* unity_video_lens_remote_video_file_dup (const UnityVideoLensRemoteVideoFile* self);
void unity_video_lens_remote_video_file_free (UnityVideoLensRemoteVideoFile* self);
void unity_video_lens_remote_video_file_copy (const UnityVideoLensRemoteVideoFile* self, UnityVideoLensRemoteVideoFile* dest);
void unity_video_lens_remote_video_file_destroy (UnityVideoLensRemoteVideoFile* self);
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE, UnityVideoLensRemoteVideoScopePrivate))
enum {
UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_DUMMY_PROPERTY
};
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_ASK_IP_SERVER_URI_ONE "http://ip.chinaz.com/"
#define UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_ASK_IP_SERVER_URI_TWO "http://www.123myip.co.uk/"
static gboolean unity_video_lens_remote_video_scope_is_in_China (UnityVideoLensRemoteVideoScope* self, GCancellable* cancellable);
UnityVideoLensRemoteVideoScope* unity_video_lens_remote_video_scope_new (void);
UnityVideoLensRemoteVideoScope* unity_video_lens_remote_video_scope_construct (GType object_type);
static void unity_video_lens_remote_video_scope_real_constructed (GObject* base);
static void unity_video_lens_remote_video_scope_zeitgeist_init (UnityVideoLensRemoteVideoScope* self, GError** error);
#define CONFIG_VERSION "1.0"
static void __lambda3_ (UnityVideoLensRemoteVideoScope* self, UnityDeprecatedScopeSearch* search, UnitySearchType search_type, GCancellable* cancellable);
static void unity_video_lens_remote_video_scope_update_search_async (UnityVideoLensRemoteVideoScope* self, UnityDeprecatedScopeSearch* search, UnitySearchType search_type, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void unity_video_lens_remote_video_scope_update_search_finish (UnityVideoLensRemoteVideoScope* self, GAsyncResult* _res_);
static void ___lambda3__unity_deprecated_scope_search_changed (UnityDeprecatedScope* _sender, UnityDeprecatedScopeSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
static gchar* __lambda6_ (UnityVideoLensRemoteVideoScope* self, UnityDeprecatedScope* scope, UnityDeprecatedScopeSearch* search);
static gchar* ___lambda6__unity_deprecated_scope_generate_search_key (UnityDeprecatedScope* _sender, UnityDeprecatedScopeSearch* search, gpointer self);
static void __lambda7_ (UnityVideoLensRemoteVideoScope* self, GObject* obj, GParamSpec* pspec);
static void ___lambda7__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void unity_video_lens_remote_video_scope_populate_categories (UnityVideoLensRemoteVideoScope* self);
static void unity_video_lens_remote_video_scope_query_list_of_sources (UnityVideoLensRemoteVideoScope* self);
static gboolean __lambda10_ (UnityVideoLensRemoteVideoScope* self);
static gboolean ___lambda10__gsource_func (gpointer self);
#define CONFIG_ICON_PATH "/usr/share/icons/unity-icon-theme/places/svg"
gchar* unity_video_lens_ubuntu_video_search_sources_uri (void);
static void unity_video_lens_remote_video_scope_sources_cb (UnityVideoLensRemoteVideoScope* self, SoupSession* session, SoupMessage* msg);
static void _unity_video_lens_remote_video_scope_sources_cb_soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self);
static GeeArrayList* unity_video_lens_remote_video_scope_handle_search_response (UnityVideoLensRemoteVideoScope* self, SoupMessage* msg, gboolean is_treat_yourself);
GeeArrayList* unity_video_lens_ubuntu_video_search_process_search_results (const gchar* json_data, gboolean is_treat_yourself, GError** error);
GeeArrayList* unity_video_lens_ubuntu_video_search_process_sources_results (const gchar* json_data, GError** error);
static void _g_free0_ (gpointer var);
static void _g_slist_free__g_free0_ (GSList* self);
static gboolean __lambda9_ (UnityVideoLensRemoteVideoScope* self);
static gboolean ___lambda9__gsource_func (gpointer self);
static void unity_video_lens_remote_video_scope_real_activate_result_data_free (gpointer _data);
static void unity_video_lens_remote_video_scope_real_activate_result (UnityDeprecatedScope* base, UnityScopeResult* _result_, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean unity_video_lens_remote_video_scope_real_activate_result_co (UnityVideoLensRemoteVideoScopeActivateResultData* _data_);
static void unity_video_lens_remote_video_scope_activate_result_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static UnityActivationResponse* unity_video_lens_remote_video_scope_on_activate_uri (UnityVideoLensRemoteVideoScope* self, const gchar* rawuri);
gpointer unity_video_lens_remote_uri_ref (gpointer instance);
void unity_video_lens_remote_uri_unref (gpointer instance);
GParamSpec* unity_video_lens_param_spec_remote_uri (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void unity_video_lens_value_set_remote_uri (GValue* value, gpointer v_object);
void unity_video_lens_value_take_remote_uri (GValue* value, gpointer v_object);
gpointer unity_video_lens_value_get_remote_uri (const GValue* value);
GType unity_video_lens_remote_uri_get_type (void) G_GNUC_CONST;
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_from_rawuri (const gchar* raw_uri);
static void unity_video_lens_remote_video_scope_zeitgeist_insert_event (UnityVideoLensRemoteVideoScope* self, const gchar* uri, const gchar* title, const gchar* icon);
const gchar* unity_video_lens_remote_uri_get_uri (UnityVideoLensRemoteUri* self);
const gchar* unity_video_lens_remote_uri_get_title (UnityVideoLensRemoteUri* self);
const gchar* unity_video_lens_remote_uri_get_icon (UnityVideoLensRemoteUri* self);
static UnityActivationResponse* unity_video_lens_remote_video_scope_on_play_video (UnityVideoLensRemoteVideoScope* self, const gchar* rawuri);
GType unity_video_lens_remote_video_details_get_type (void) G_GNUC_CONST;
UnityVideoLensRemoteVideoDetails* unity_video_lens_remote_video_details_dup (const UnityVideoLensRemoteVideoDetails* self);
void unity_video_lens_remote_video_details_free (UnityVideoLensRemoteVideoDetails* self);
void unity_video_lens_remote_video_details_copy (const UnityVideoLensRemoteVideoDetails* self, UnityVideoLensRemoteVideoDetails* dest);
void unity_video_lens_remote_video_details_destroy (UnityVideoLensRemoteVideoDetails* self);
static UnityPreview* unity_video_lens_remote_video_scope_build_preview (UnityVideoLensRemoteVideoScope* self, UnityVideoLensRemoteUri* uri, UnityVideoLensRemoteVideoDetails* details);
static UnityActivationResponse* _unity_video_lens_remote_video_scope_on_play_video_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
static void unity_video_lens_remote_video_scope_real_preview_result_data_free (gpointer _data);
static void unity_video_lens_remote_video_scope_real_preview_result (UnityDeprecatedScope* base, UnityScopeResult* _result_, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean unity_video_lens_remote_video_scope_real_preview_result_co (UnityVideoLensRemoteVideoScopePreviewResultData* _data_);
const gchar* unity_video_lens_remote_uri_get_details_uri (UnityVideoLensRemoteUri* self);
static void unity_video_lens_remote_video_scope_get_details (UnityVideoLensRemoteVideoScope* self, const gchar* url, GAsyncReadyCallback _callback_, gpointer _user_data_);
static UnityVideoLensRemoteVideoDetails* unity_video_lens_remote_video_scope_get_details_finish (UnityVideoLensRemoteVideoScope* self, GAsyncResult* _res_, GError** error);
static void unity_video_lens_remote_video_scope_preview_result_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void unity_video_lens_remote_video_scope_get_details_data_free (gpointer _data);
static gboolean unity_video_lens_remote_video_scope_get_details_co (UnityVideoLensRemoteVideoScopeGetDetailsData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda11_ (Block1Data* _data1_, SoupSession* session_, SoupMessage* msg_);
static void ___lambda11__soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self);
void unity_video_lens_ubuntu_video_search_process_details_results (const gchar* json_data, UnityVideoLensRemoteVideoDetails* result, GError** error);
static void unity_video_lens_remote_video_scope_update_search_async_data_free (gpointer _data);
static gboolean unity_video_lens_remote_video_scope_update_search_async_co (UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData* _data_);
static gboolean unity_video_lens_remote_video_scope_source_activated (UnityVideoLensRemoteVideoScope* self, const gchar* id);
static gboolean unity_video_lens_remote_video_scope_at_least_one_source_is_on (UnityVideoLensRemoteVideoScope* self, GeeArrayList* active_sources);
static void unity_video_lens_remote_video_scope_perform_search (UnityVideoLensRemoteVideoScope* self, const gchar* search_string, UnityDeprecatedScopeSearch* search, GeeArrayList* active_sources, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void unity_video_lens_remote_video_scope_perform_search_finish (UnityVideoLensRemoteVideoScope* self, GAsyncResult* _res_, GError** error);
static void unity_video_lens_remote_video_scope_update_search_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void unity_video_lens_remote_video_scope_perform_search_data_free (gpointer _data);
static gboolean unity_video_lens_remote_video_scope_perform_search_co (UnityVideoLensRemoteVideoScopePerformSearchData* _data_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void unity_video_lens_remote_video_scope_update_results_model (UnityVideoLensRemoteVideoScope* self, DeeModel* model, GeeArrayList* results);
gchar* unity_video_lens_ubuntu_video_search_build_search_uri (const gchar* query, GeeArrayList* sources);
static void __lambda4_ (Block2Data* _data2_, SoupSession* session_, SoupMessage* msg_);
static void ___lambda4__soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self);
static void ___lambda5_ (Block2Data* _data2_);
static void ____lambda5__gfunc (gconstpointer data, gpointer self);
static gboolean _unity_video_lens_remote_video_scope_perform_search_co_gsource_func (gpointer self);
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_new (const gchar* uri, const gchar* title, const gchar* icon, const gchar* details_uri);
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_construct (GType object_type, const gchar* uri, const gchar* title, const gchar* icon, const gchar* details_uri);
static GVariant* _variant_new1 (const gchar* value);
static GVariant* _variant_new2 (gboolean value);
gchar* unity_video_lens_remote_uri_to_rawuri (UnityVideoLensRemoteUri* self);
static void unity_video_lens_remote_video_scope_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) {
gint result = 0;
gint _tmp0_;
const gchar* _tmp1_;
gchar* _tmp2_ = NULL;
gchar* _result_;
gchar* _tmp3_;
g_return_val_if_fail (self != NULL, 0);
g_return_val_if_fail (needle != NULL, 0);
_tmp0_ = start_index;
_tmp1_ = needle;
_tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
_result_ = _tmp2_;
_tmp3_ = _result_;
if (_tmp3_ != NULL) {
gchar* _tmp4_;
_tmp4_ = _result_;
result = (gint) (_tmp4_ - ((gchar*) self));
return result;
} else {
result = -1;
return result;
}
}
static gboolean unity_video_lens_remote_video_scope_is_in_China (UnityVideoLensRemoteVideoScope* self, GCancellable* cancellable) {
gboolean result = FALSE;
const gchar* _tmp0_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
_tmp0_ = unity_video_lens_remote_video_scope_IS_IN_CHINA;
if (g_strcmp0 (_tmp0_, "Unknown") == 0) {
GFile* _tmp1_ = NULL;
GFile* file;
guint8* data = NULL;
gint data_length1 = 0;
gint _data_size_ = 0;
gchar* content = NULL;
gchar* etag_out = NULL;
GFile* _tmp2_;
GCancellable* _tmp3_;
guint8* _tmp4_ = NULL;
gsize _tmp5_;
gchar* _tmp6_ = NULL;
gboolean _tmp7_ = FALSE;
gboolean _tmp8_;
_tmp1_ = g_file_new_for_uri (UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_ASK_IP_SERVER_URI_ONE);
file = _tmp1_;
_tmp2_ = file;
_tmp3_ = cancellable;
_tmp7_ = g_file_load_contents (_tmp2_, _tmp3_, &_tmp4_, &_tmp5_, &_tmp6_, &_inner_error_);
data = (g_free (data), NULL);
data = _tmp4_;
data_length1 = _tmp5_;
_data_size_ = data_length1;
_g_free0 (etag_out);
etag_out = _tmp6_;
_tmp8_ = _tmp7_;
if (_inner_error_ != NULL) {
_g_free0 (etag_out);
_g_free0 (content);
data = (g_free (data), NULL);
_g_object_unref0 (file);
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return FALSE;
}
if (_tmp8_) {
guint8* _tmp9_;
gint _tmp9__length1;
gchar* _tmp10_;
const gchar* _tmp11_;
gint _tmp12_ = 0;
const gchar* _tmp13_;
gint _tmp14_ = 0;
const gchar* _tmp15_;
gint _tmp16_ = 0;
const gchar* _tmp17_;
gint _tmp18_ = 0;
const gchar* _tmp19_;
gint _tmp20_ = 0;
const gchar* _tmp21_;
gint _tmp22_ = 0;
const gchar* _tmp23_;
gint _tmp24_ = 0;
const gchar* _tmp25_;
gint _tmp26_ = 0;
const gchar* _tmp27_;
gint _tmp28_ = 0;
const gchar* _tmp29_;
gint _tmp30_ = 0;
const gchar* _tmp31_;
gint _tmp32_ = 0;
const gchar* _tmp33_;
gint _tmp34_ = 0;
const gchar* _tmp35_;
gint _tmp36_ = 0;
const gchar* _tmp37_;
gint _tmp38_ = 0;
const gchar* _tmp39_;
gint _tmp40_ = 0;
const gchar* _tmp41_;
gint _tmp42_ = 0;
const gchar* _tmp43_;
gint _tmp44_ = 0;
const gchar* _tmp45_;
gint _tmp46_ = 0;
const gchar* _tmp47_;
gint _tmp48_ = 0;
const gchar* _tmp49_;
gint _tmp50_ = 0;
const gchar* _tmp51_;
gint _tmp52_ = 0;
const gchar* _tmp53_;
gint _tmp54_ = 0;
const gchar* _tmp55_;
gint _tmp56_ = 0;
const gchar* _tmp57_;
gint _tmp58_ = 0;
const gchar* _tmp59_;
gint _tmp60_ = 0;
const gchar* _tmp61_;
gint _tmp62_ = 0;
const gchar* _tmp63_;
gint _tmp64_ = 0;
const gchar* _tmp65_;
gint _tmp66_ = 0;
const gchar* _tmp67_;
gint _tmp68_ = 0;
const gchar* _tmp69_;
gint _tmp70_ = 0;
const gchar* _tmp71_;
gint _tmp72_ = 0;
const gchar* _tmp73_;
gint _tmp74_ = 0;
gint location;
gint _tmp75_;
_tmp9_ = data;
_tmp9__length1 = data_length1;
_tmp10_ = g_strdup ((const gchar*) _tmp9_);
_g_free0 (content);
content = _tmp10_;
_tmp11_ = content;
_tmp12_ = string_index_of (_tmp11_, "北京", 0);
_tmp13_ = content;
_tmp14_ = string_index_of (_tmp13_, "上海", 0);
_tmp15_ = content;
_tmp16_ = string_index_of (_tmp15_, "天津", 0);
_tmp17_ = content;
_tmp18_ = string_index_of (_tmp17_, "重庆", 0);
_tmp19_ = content;
_tmp20_ = string_index_of (_tmp19_, "黑龙江", 0);
_tmp21_ = content;
_tmp22_ = string_index_of (_tmp21_, "吉林", 0);
_tmp23_ = content;
_tmp24_ = string_index_of (_tmp23_, "辽宁", 0);
_tmp25_ = content;
_tmp26_ = string_index_of (_tmp25_, "江苏", 0);
_tmp27_ = content;
_tmp28_ = string_index_of (_tmp27_, "山东", 0);
_tmp29_ = content;
_tmp30_ = string_index_of (_tmp29_, "安徽", 0);
_tmp31_ = content;
_tmp32_ = string_index_of (_tmp31_, "河北", 0);
_tmp33_ = content;
_tmp34_ = string_index_of (_tmp33_, "河南", 0);
_tmp35_ = content;
_tmp36_ = string_index_of (_tmp35_, "湖北", 0);
_tmp37_ = content;
_tmp38_ = string_index_of (_tmp37_, "湖南", 0);
_tmp39_ = content;
_tmp40_ = string_index_of (_tmp39_, "江西", 0);
_tmp41_ = content;
_tmp42_ = string_index_of (_tmp41_, "陕西", 0);
_tmp43_ = content;
_tmp44_ = string_index_of (_tmp43_, "山西", 0);
_tmp45_ = content;
_tmp46_ = string_index_of (_tmp45_, "四川", 0);
_tmp47_ = content;
_tmp48_ = string_index_of (_tmp47_, "青海", 0);
_tmp49_ = content;
_tmp50_ = string_index_of (_tmp49_, "海南", 0);
_tmp51_ = content;
_tmp52_ = string_index_of (_tmp51_, "广东", 0);
_tmp53_ = content;
_tmp54_ = string_index_of (_tmp53_, "贵州", 0);
_tmp55_ = content;
_tmp56_ = string_index_of (_tmp55_, "浙江", 0);
_tmp57_ = content;
_tmp58_ = string_index_of (_tmp57_, "福建", 0);
_tmp59_ = content;
_tmp60_ = string_index_of (_tmp59_, "台湾", 0);
_tmp61_ = content;
_tmp62_ = string_index_of (_tmp61_, "甘肃", 0);
_tmp63_ = content;
_tmp64_ = string_index_of (_tmp63_, "云南", 0);
_tmp65_ = content;
_tmp66_ = string_index_of (_tmp65_, "内蒙古", 0);
_tmp67_ = content;
_tmp68_ = string_index_of (_tmp67_, "宁夏", 0);
_tmp69_ = content;
_tmp70_ = string_index_of (_tmp69_, "新疆", 0);
_tmp71_ = content;
_tmp72_ = string_index_of (_tmp71_, "西藏", 0);
_tmp73_ = content;
_tmp74_ = string_index_of (_tmp73_, "广西", 0);
location = ((((((((((((((((((((((((((((((_tmp12_ + _tmp14_) + _tmp16_) + _tmp18_) + _tmp20_) + _tmp22_) + _tmp24_) + _tmp26_) + _tmp28_) + _tmp30_) + _tmp32_) + _tmp34_) + _tmp36_) + _tmp38_) + _tmp40_) + _tmp42_) + _tmp44_) + _tmp46_) + _tmp48_) + _tmp50_) + _tmp52_) + _tmp54_) + _tmp56_) + _tmp58_) + _tmp60_) + _tmp62_) + _tmp64_) + _tmp66_) + _tmp68_) + _tmp70_) + _tmp72_) + _tmp74_;
_tmp75_ = location;
if (_tmp75_ < 0) {
GFile* _tmp76_ = NULL;
_tmp76_ = g_file_new_for_uri (UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_ASK_IP_SERVER_URI_TWO);
_g_object_unref0 (file);
file = _tmp76_;
{
GFile* _tmp77_;
GCancellable* _tmp78_;
guint8* _tmp79_ = NULL;
gsize _tmp80_;
gchar* _tmp81_ = NULL;
gboolean _tmp82_ = FALSE;
gboolean _tmp83_;
_tmp77_ = file;
_tmp78_ = cancellable;
_tmp82_ = g_file_load_contents (_tmp77_, _tmp78_, &_tmp79_, &_tmp80_, &_tmp81_, &_inner_error_);
data = (g_free (data), NULL);
data = _tmp79_;
data_length1 = _tmp80_;
_data_size_ = data_length1;
_g_free0 (etag_out);
etag_out = _tmp81_;
_tmp83_ = _tmp82_;
if (_inner_error_ != NULL) {
goto __catch1_g_error;
}
if (_tmp83_) {
guint8* _tmp84_;
gint _tmp84__length1;
gchar* _tmp85_;
const gchar* _tmp86_;
gint _tmp87_ = 0;
gint _tmp88_;
_tmp84_ = data;
_tmp84__length1 = data_length1;
_tmp85_ = g_strdup ((const gchar*) _tmp84_);
_g_free0 (content);
content = _tmp85_;
_tmp86_ = content;
_tmp87_ = string_index_of (_tmp86_, "China", 0);
location = _tmp87_;
_tmp88_ = location;
if (_tmp88_ > 0) {
gchar* _tmp89_;
_tmp89_ = g_strdup ("Yes");
_g_free0 (unity_video_lens_remote_video_scope_IS_IN_CHINA);
unity_video_lens_remote_video_scope_IS_IN_CHINA = _tmp89_;
result = TRUE;
_g_free0 (etag_out);
_g_free0 (content);
data = (g_free (data), NULL);
_g_object_unref0 (file);
return result;
}
}
}
goto __finally1;
__catch1_g_error:
{
GError* e = NULL;
GFile* _tmp90_;
gchar* _tmp91_ = NULL;
gchar* _tmp92_;
GError* _tmp93_;
const gchar* _tmp94_;
e = _inner_error_;
_inner_error_ = NULL;
_tmp90_ = file;
_tmp91_ = g_file_get_uri (_tmp90_);
_tmp92_ = _tmp91_;
_tmp93_ = e;
_tmp94_ = _tmp93_->message;
g_warning ("remote-scope.vala:120: Error reading URL '%s': %s", _tmp92_, _tmp94_);
_g_free0 (_tmp92_);
_g_error_free0 (e);
}
__finally1:
if (_inner_error_ != NULL) {
_g_free0 (etag_out);
_g_free0 (content);
data = (g_free (data), NULL);
_g_object_unref0 (file);
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return FALSE;
}
} else {
gchar* _tmp95_;
_tmp95_ = g_strdup ("Yes");
_g_free0 (unity_video_lens_remote_video_scope_IS_IN_CHINA);
unity_video_lens_remote_video_scope_IS_IN_CHINA = _tmp95_;
result = TRUE;
_g_free0 (etag_out);
_g_free0 (content);
data = (g_free (data), NULL);
_g_object_unref0 (file);
return result;
}
}
_g_free0 (etag_out);
_g_free0 (content);
data = (g_free (data), NULL);
_g_object_unref0 (file);
} else {
result = TRUE;
return result;
}
result = TRUE;
return result;
}
UnityVideoLensRemoteVideoScope* unity_video_lens_remote_video_scope_construct (GType object_type) {
UnityVideoLensRemoteVideoScope * self = NULL;
self = (UnityVideoLensRemoteVideoScope*) g_object_new (object_type, "dbus-path", "/net/launchpad/scope/youkuvideos", "id", "videoyouku.scope", NULL);
return self;
}
UnityVideoLensRemoteVideoScope* unity_video_lens_remote_video_scope_new (void) {
return unity_video_lens_remote_video_scope_construct (UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE);
}
static void __lambda3_ (UnityVideoLensRemoteVideoScope* self, UnityDeprecatedScopeSearch* search, UnitySearchType search_type, GCancellable* cancellable) {
UnityDeprecatedScopeSearch* _tmp0_;
UnitySearchType _tmp1_;
GCancellable* _tmp2_;
g_return_if_fail (search != NULL);
g_return_if_fail (cancellable != NULL);
_tmp0_ = search;
_tmp1_ = search_type;
_tmp2_ = cancellable;
unity_video_lens_remote_video_scope_update_search_async (self, _tmp0_, _tmp1_, _tmp2_, NULL, NULL);
}
static void ___lambda3__unity_deprecated_scope_search_changed (UnityDeprecatedScope* _sender, UnityDeprecatedScopeSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
__lambda3_ (self, search, search_type, cancellable);
}
static gchar* string_strip (const gchar* self) {
gchar* result = NULL;
gchar* _tmp0_ = NULL;
gchar* _result_;
const gchar* _tmp1_;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = g_strdup (self);
_result_ = _tmp0_;
_tmp1_ = _result_;
g_strstrip (_tmp1_);
result = _result_;
return result;
}
static gchar* __lambda6_ (UnityVideoLensRemoteVideoScope* self, UnityDeprecatedScope* scope, UnityDeprecatedScopeSearch* search) {
gchar* result = NULL;
UnityDeprecatedScopeSearch* _tmp0_;
const gchar* _tmp1_;
const gchar* _tmp2_;
gchar* _tmp3_ = NULL;
g_return_val_if_fail (scope != NULL, NULL);
g_return_val_if_fail (search != NULL, NULL);
_tmp0_ = search;
_tmp1_ = unity_deprecated_scope_search_get_search_string (_tmp0_);
_tmp2_ = _tmp1_;
_tmp3_ = string_strip (_tmp2_);
result = _tmp3_;
return result;
}
static gchar* ___lambda6__unity_deprecated_scope_generate_search_key (UnityDeprecatedScope* _sender, UnityDeprecatedScopeSearch* search, gpointer self) {
gchar* result;
result = __lambda6_ (self, _sender, search);
return result;
}
static void __lambda7_ (UnityVideoLensRemoteVideoScope* self, GObject* obj, GParamSpec* pspec) {
g_return_if_fail (obj != NULL);
g_return_if_fail (pspec != NULL);
unity_deprecated_scope_queue_search_changed ((UnityDeprecatedScope*) self, UNITY_SEARCH_TYPE_DEFAULT);
}
static void ___lambda7__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
__lambda7_ (self, _sender, pspec);
}
static gboolean __lambda10_ (UnityVideoLensRemoteVideoScope* self) {
gboolean result = FALSE;
unity_deprecated_scope_queue_search_changed ((UnityDeprecatedScope*) self, UNITY_SEARCH_TYPE_DEFAULT);
result = TRUE;
return result;
}
static gboolean ___lambda10__gsource_func (gpointer self) {
gboolean result;
result = __lambda10_ (self);
return result;
}
static void unity_video_lens_remote_video_scope_real_constructed (GObject* base) {
UnityVideoLensRemoteVideoScope * self;
UnitySchema* _tmp0_;
UnitySchema* _tmp1_;
const gchar* _tmp2_;
GeeArrayList* _tmp3_;
SoupSessionAsync* _tmp4_;
SoupSession* _tmp5_;
SoupSession* _tmp6_;
SoupSession* _tmp7_;
SoupSession* _tmp8_;
UnityPreferencesManager* _tmp9_;
gint _tmp10_;
GError * _inner_error_ = NULL;
self = (UnityVideoLensRemoteVideoScope*) base;
G_OBJECT_CLASS (unity_video_lens_remote_video_scope_parent_class)->constructed ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, UNITY_TYPE_DEPRECATED_SCOPE, UnityDeprecatedScope));
_tmp0_ = unity_deprecated_scope_base_get_schema ((UnityDeprecatedScopeBase*) self);
_tmp1_ = _tmp0_;
_tmp2_ = unity_video_lens_remote_video_scope_PREVIEW_ON_LMB;
unity_schema_add_field (_tmp1_, _tmp2_, "b", UNITY_SCHEMA_FIELD_TYPE_OPTIONAL);
_tmp3_ = gee_array_list_new (UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_FILE, (GBoxedCopyFunc) unity_video_lens_remote_video_file_dup, unity_video_lens_remote_video_file_free, NULL);
_g_object_unref0 (self->priv->recommendations);
self->priv->recommendations = _tmp3_;
self->priv->use_zeitgeist = FALSE;
{
unity_video_lens_remote_video_scope_zeitgeist_init (self, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch2_g_error;
}
self->priv->use_zeitgeist = TRUE;
}
goto __finally2;
__catch2_g_error:
{
GError* e = NULL;
e = _inner_error_;
_inner_error_ = NULL;
g_warning ("remote-scope.vala:163: Failed to initialize Zeitgeist, won't store eve" \
"nts");
_g_error_free0 (e);
}
__finally2:
if (_inner_error_ != NULL) {
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return;
}
_tmp4_ = (SoupSessionAsync*) soup_session_async_new ();
_g_object_unref0 (self->priv->session);
self->priv->session = (SoupSession*) _tmp4_;
_tmp5_ = self->priv->session;
g_object_set (_tmp5_, "ssl-use-system-ca-file", TRUE, NULL);
_tmp6_ = self->priv->session;
g_object_set (_tmp6_, "ssl-strict", TRUE, NULL);
_tmp7_ = self->priv->session;
g_object_set (_tmp7_, "user-agent", "Unity Video Lens Remote Scope v" CONFIG_VERSION, NULL);
_tmp8_ = self->priv->session;
soup_session_add_feature_by_type (_tmp8_, soup_proxy_resolver_gnome_get_type ());
unity_deprecated_scope_base_set_search_in_global ((UnityDeprecatedScopeBase*) self, FALSE);
g_signal_connect_object ((UnityDeprecatedScope*) self, "search-changed", (GCallback) ___lambda3__unity_deprecated_scope_search_changed, self, 0);
g_signal_connect_object ((UnityDeprecatedScope*) self, "generate-search-key", (GCallback) ___lambda6__unity_deprecated_scope_generate_search_key, self, 0);
_tmp9_ = self->priv->preferences;
g_signal_connect_object ((GObject*) _tmp9_, "notify::remote-content-search", (GCallback) ___lambda7__g_object_notify, self, 0);
unity_video_lens_remote_video_scope_populate_categories (self);
unity_video_lens_remote_video_scope_query_list_of_sources (self);
_tmp10_ = unity_video_lens_remote_video_scope_REFRESH_INTERVAL;
g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) (_tmp10_ / 2), ___lambda10__gsource_func, g_object_ref (self), g_object_unref);
{
unity_deprecated_scope_base_export ((UnityDeprecatedScopeBase*) self, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch3_g_error;
}
}
goto __finally3;
__catch3_g_error:
{
GError* e = NULL;
const gchar* _tmp11_;
e = _inner_error_;
_inner_error_ = NULL;
_tmp11_ = e->message;
g_error ("remote-scope.vala:206: Failed to export scope: %s", _tmp11_);
_g_error_free0 (e);
}
__finally3:
if (_inner_error_ != NULL) {
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return;
}
}
static void unity_video_lens_remote_video_scope_populate_categories (UnityVideoLensRemoteVideoScope* self) {
UnityCategorySet* _tmp0_;
UnityCategorySet* categories;
GFile* _tmp1_ = NULL;
GFile* icon_dir;
const gchar* _tmp2_ = NULL;
GFile* _tmp3_ = NULL;
GFile* _tmp4_;
GFileIcon* _tmp5_;
GFileIcon* _tmp6_;
UnityCategory* _tmp7_;
UnityCategory* _tmp8_;
const gchar* _tmp9_ = NULL;
GFile* _tmp10_ = NULL;
GFile* _tmp11_;
GFileIcon* _tmp12_;
GFileIcon* _tmp13_;
UnityCategory* _tmp14_;
UnityCategory* _tmp15_;
g_return_if_fail (self != NULL);
_tmp0_ = unity_category_set_new ();
categories = _tmp0_;
_tmp1_ = g_file_new_for_path (CONFIG_ICON_PATH);
icon_dir = _tmp1_;
_tmp2_ = _ ("Online");
_tmp3_ = g_file_get_child (icon_dir, "group-internet.svg");
_tmp4_ = _tmp3_;
_tmp5_ = (GFileIcon*) g_file_icon_new (_tmp4_);
_tmp6_ = _tmp5_;
_tmp7_ = unity_category_new ("online", _tmp2_, (GIcon*) _tmp6_, UNITY_CATEGORY_RENDERER_VERTICAL_TILE);
_tmp8_ = _tmp7_;
unity_category_set_add (categories, _tmp8_);
_g_object_unref0 (_tmp8_);
_g_object_unref0 (_tmp6_);
_g_object_unref0 (_tmp4_);
_tmp9_ = _ ("More suggestions");
_tmp10_ = g_file_get_child (icon_dir, "group-treat-yourself.svg");
_tmp11_ = _tmp10_;
_tmp12_ = (GFileIcon*) g_file_icon_new (_tmp11_);
_tmp13_ = _tmp12_;
_tmp14_ = unity_category_new ("more", _tmp9_, (GIcon*) _tmp13_, UNITY_CATEGORY_RENDERER_VERTICAL_TILE);
_tmp15_ = _tmp14_;
unity_category_set_add (categories, _tmp15_);
_g_object_unref0 (_tmp15_);
_g_object_unref0 (_tmp13_);
_g_object_unref0 (_tmp11_);
unity_deprecated_scope_base_set_categories ((UnityDeprecatedScopeBase*) self, categories);
_g_object_unref0 (icon_dir);
_g_object_unref0 (categories);
}
static gpointer _g_object_ref0 (gpointer self) {
return self ? g_object_ref (self) : NULL;
}
static void _unity_video_lens_remote_video_scope_sources_cb_soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self) {
unity_video_lens_remote_video_scope_sources_cb (self, session, msg);
}
static void unity_video_lens_remote_video_scope_query_list_of_sources (UnityVideoLensRemoteVideoScope* self) {
gchar* _tmp0_ = NULL;
gchar* _tmp1_;
SoupMessage* _tmp2_;
SoupMessage* _tmp3_;
SoupMessage* msg;
SoupSession* _tmp4_;
SoupMessage* _tmp5_;
g_return_if_fail (self != NULL);
_tmp0_ = unity_video_lens_ubuntu_video_search_sources_uri ();
_tmp1_ = _tmp0_;
_tmp2_ = soup_message_new ("GET", _tmp1_);
_tmp3_ = _tmp2_;
_g_free0 (_tmp1_);
msg = _tmp3_;
_tmp4_ = self->priv->session;
_tmp5_ = _g_object_ref0 (msg);
soup_session_queue_message (_tmp4_, _tmp5_, _unity_video_lens_remote_video_scope_sources_cb_soup_session_callback, self);
_g_object_unref0 (msg);
}
static GeeArrayList* unity_video_lens_remote_video_scope_handle_search_response (UnityVideoLensRemoteVideoScope* self, SoupMessage* msg, gboolean is_treat_yourself) {
GeeArrayList* result = NULL;
SoupMessage* _tmp0_;
guint _tmp1_ = 0U;
guint _tmp2_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (msg != NULL, NULL);
_tmp0_ = msg;
g_object_get (_tmp0_, "status-code", &_tmp1_, NULL);
_tmp2_ = _tmp1_;
if (_tmp2_ != ((guint) 200)) {
SoupMessage* _tmp3_;
guint _tmp4_ = 0U;
guint _tmp5_;
SoupMessage* _tmp6_;
gchar* _tmp7_ = NULL;
gchar* _tmp8_;
gchar* _tmp9_;
_tmp3_ = msg;
g_object_get (_tmp3_, "status-code", &_tmp4_, NULL);
_tmp5_ = _tmp4_;
_tmp6_ = msg;
g_object_get (_tmp6_, "reason-phrase", &_tmp7_, NULL);
_tmp8_ = _tmp7_;
_tmp9_ = _tmp8_;
g_warning ("remote-scope.vala:234: Unable to get results from the server: %u, %s", _tmp5_, _tmp9_);
_g_free0 (_tmp9_);
} else {
{
SoupMessage* _tmp10_;
SoupMessageBody* _tmp11_;
guint8* _tmp12_;
gint _tmp12__length1;
gboolean _tmp13_;
GeeArrayList* _tmp14_ = NULL;
GeeArrayList* _tmp15_;
_tmp10_ = msg;
_tmp11_ = _tmp10_->response_body;
_tmp12_ = _tmp11_->data;
_tmp12__length1 = (gint) _tmp11_->length;
_tmp13_ = is_treat_yourself;
_tmp14_ = unity_video_lens_ubuntu_video_search_process_search_results ((const gchar*) _tmp12_, _tmp13_, &_inner_error_);
_tmp15_ = _tmp14_;
if (_inner_error_ != NULL) {
goto __catch4_g_error;
}
result = _tmp15_;
return result;
}
goto __finally4;
__catch4_g_error:
{
GError* e = NULL;
GError* _tmp16_;
const gchar* _tmp17_;
e = _inner_error_;
_inner_error_ = NULL;
_tmp16_ = e;
_tmp17_ = _tmp16_->message;
g_warning ("remote-scope.vala:245: Error processing search results: %s", _tmp17_);
_g_error_free0 (e);
}
__finally4:
if (_inner_error_ != NULL) {
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return NULL;
}
}
result = NULL;
return result;
}
static void _g_free0_ (gpointer var) {
var = (g_free (var), NULL);
}
static void _g_slist_free__g_free0_ (GSList* self) {
g_slist_foreach (self, (GFunc) _g_free0_, NULL);
g_slist_free (self);
}
static gboolean __lambda9_ (UnityVideoLensRemoteVideoScope* self) {
gboolean result = FALSE;
unity_video_lens_remote_video_scope_query_list_of_sources (self);
result = FALSE;
return result;
}
static gboolean ___lambda9__gsource_func (gpointer self) {
gboolean result;
result = __lambda9_ (self);
return result;
}
static void unity_video_lens_remote_video_scope_sources_cb (UnityVideoLensRemoteVideoScope* self, SoupSession* session, SoupMessage* msg) {
gint _tmp0_;
guint interval;
SoupMessage* _tmp1_;
guint _tmp2_ = 0U;
guint _tmp3_;
guint _tmp46_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (session != NULL);
g_return_if_fail (msg != NULL);
_tmp0_ = unity_video_lens_remote_video_scope_RETRY_INTERVAL;
interval = (guint) _tmp0_;
_tmp1_ = msg;
g_object_get (_tmp1_, "status-code", &_tmp2_, NULL);
_tmp3_ = _tmp2_;
if (_tmp3_ != ((guint) 200)) {
SoupMessage* _tmp4_;
guint _tmp5_ = 0U;
guint _tmp6_;
SoupMessage* _tmp7_;
gchar* _tmp8_ = NULL;
gchar* _tmp9_;
gchar* _tmp10_;
_tmp4_ = msg;
g_object_get (_tmp4_, "status-code", &_tmp5_, NULL);
_tmp6_ = _tmp5_;
_tmp7_ = msg;
g_object_get (_tmp7_, "reason-phrase", &_tmp8_, NULL);
_tmp9_ = _tmp8_;
_tmp10_ = _tmp9_;
g_warning ("remote-scope.vala:257: Unable to query the server for a list of source" \
"s, %u: %s", _tmp6_, _tmp10_);
_g_free0 (_tmp10_);
} else {
{
SoupMessage* _tmp11_;
SoupMessageBody* _tmp12_;
guint8* _tmp13_;
gint _tmp13__length1;
GeeArrayList* _tmp14_ = NULL;
GeeArrayList* sources_array;
GSList* to_remove;
UnityOptionsFilter* _tmp15_;
UnityOptionsFilter* _tmp16_;
GList* _tmp17_;
GSList* _tmp23_;
gint _tmp45_;
_tmp11_ = msg;
_tmp12_ = _tmp11_->response_body;
_tmp13_ = _tmp12_->data;
_tmp13__length1 = (gint) _tmp12_->length;
_tmp14_ = unity_video_lens_ubuntu_video_search_process_sources_results ((const gchar*) _tmp13_, &_inner_error_);
sources_array = _tmp14_;
if (_inner_error_ != NULL) {
goto __catch5_g_error;
}
to_remove = NULL;
_tmp15_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) self);
_tmp16_ = _tmp15_;
_tmp17_ = _tmp16_->options;
{
GList* opt_collection = NULL;
GList* opt_it = NULL;
opt_collection = _tmp17_;
for (opt_it = opt_collection; opt_it != NULL; opt_it = opt_it->next) {
UnityFilterOption* _tmp18_;
UnityFilterOption* opt = NULL;
_tmp18_ = _g_object_ref0 ((UnityFilterOption*) opt_it->data);
opt = _tmp18_;
{
UnityFilterOption* _tmp19_;
const gchar* _tmp20_;
const gchar* _tmp21_;
gchar* _tmp22_;
_tmp19_ = opt;
_tmp20_ = unity_filter_option_get_id (_tmp19_);
_tmp21_ = _tmp20_;
_tmp22_ = g_strdup (_tmp21_);
to_remove = g_slist_append (to_remove, _tmp22_);
_g_object_unref0 (opt);
}
}
}
_tmp23_ = to_remove;
{
GSList* id_collection = NULL;
GSList* id_it = NULL;
id_collection = _tmp23_;
for (id_it = id_collection; id_it != NULL; id_it = id_it->next) {
gchar* _tmp24_;
gchar* id = NULL;
_tmp24_ = g_strdup ((const gchar*) id_it->data);
id = _tmp24_;
{
UnityOptionsFilter* _tmp25_;
UnityOptionsFilter* _tmp26_;
const gchar* _tmp27_;
_tmp25_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) self);
_tmp26_ = _tmp25_;
_tmp27_ = id;
unity_options_filter_remove_option (_tmp26_, _tmp27_);
_g_free0 (id);
}
}
}
{
GeeArrayList* _tmp28_;
GeeArrayList* _tmp29_;
GeeArrayList* _src_list;
GeeArrayList* _tmp30_;
gint _tmp31_;
gint _tmp32_;
gint _src_size;
gint _src_index;
_tmp28_ = sources_array;
_tmp29_ = _g_object_ref0 (_tmp28_);
_src_list = _tmp29_;
_tmp30_ = _src_list;
_tmp31_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp30_);
_tmp32_ = _tmp31_;
_src_size = _tmp32_;
_src_index = -1;
while (TRUE) {
gint _tmp33_;
gint _tmp34_;
gint _tmp35_;
GeeArrayList* _tmp36_;
gint _tmp37_;
gpointer _tmp38_ = NULL;
gchar* src;
UnityOptionsFilter* _tmp39_;
UnityOptionsFilter* _tmp40_;
const gchar* _tmp41_;
const gchar* _tmp42_;
UnityFilterOption* _tmp43_ = NULL;
UnityFilterOption* _tmp44_;
_tmp33_ = _src_index;
_src_index = _tmp33_ + 1;
_tmp34_ = _src_index;
_tmp35_ = _src_size;
if (!(_tmp34_ < _tmp35_)) {
break;
}
_tmp36_ = _src_list;
_tmp37_ = _src_index;
_tmp38_ = gee_abstract_list_get ((GeeAbstractList*) _tmp36_, _tmp37_);
src = (gchar*) _tmp38_;
_tmp39_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) self);
_tmp40_ = _tmp39_;
_tmp41_ = src;
_tmp42_ = src;
_tmp43_ = unity_options_filter_add_option (_tmp40_, _tmp41_, _tmp42_, NULL);
_tmp44_ = _tmp43_;
_g_object_unref0 (_tmp44_);
_g_free0 (src);
}
_g_object_unref0 (_src_list);
}
_tmp45_ = unity_video_lens_remote_video_scope_REFRESH_INTERVAL;
interval = (guint) _tmp45_;
__g_slist_free__g_free0_0 (to_remove);
_g_object_unref0 (sources_array);
}
goto __finally5;
__catch5_g_error:
{
GError* e = NULL;
e = _inner_error_;
_inner_error_ = NULL;
g_warning ("remote-scope.vala:281: Got invalid json from the server");
_g_error_free0 (e);
}
__finally5:
if (_inner_error_ != NULL) {
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return;
}
}
_tmp46_ = interval;
g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, _tmp46_, ___lambda9__gsource_func, g_object_ref (self), g_object_unref);
}
static void unity_video_lens_remote_video_scope_real_activate_result_data_free (gpointer _data) {
UnityVideoLensRemoteVideoScopeActivateResultData* _data_;
_data_ = _data;
unity_scope_result_destroy (&_data_->_result_);
_g_object_unref0 (_data_->result);
_g_object_unref0 (_data_->self);
g_slice_free (UnityVideoLensRemoteVideoScopeActivateResultData, _data_);
}
static void unity_video_lens_remote_video_scope_real_activate_result (UnityDeprecatedScope* base, UnityScopeResult* _result_, GAsyncReadyCallback _callback_, gpointer _user_data_) {
UnityVideoLensRemoteVideoScope * self;
UnityVideoLensRemoteVideoScopeActivateResultData* _data_;
UnityVideoLensRemoteVideoScope* _tmp0_;
UnityScopeResult _tmp1_;
UnityScopeResult _tmp2_ = {0};
self = (UnityVideoLensRemoteVideoScope*) base;
_data_ = g_slice_new0 (UnityVideoLensRemoteVideoScopeActivateResultData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_video_lens_remote_video_scope_real_activate_result);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_video_lens_remote_video_scope_real_activate_result_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
_tmp1_ = *_result_;
unity_scope_result_copy (&_tmp1_, &_tmp2_);
unity_scope_result_destroy (&_data_->_result_);
_data_->_result_ = _tmp2_;
unity_video_lens_remote_video_scope_real_activate_result_co (_data_);
}
static UnityActivationResponse* unity_video_lens_remote_video_scope_real_activate_result_finish (UnityDeprecatedScope* base, GAsyncResult* _res_) {
UnityActivationResponse* result;
UnityVideoLensRemoteVideoScopeActivateResultData* _data_;
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
result = _data_->result;
_data_->result = NULL;
return result;
}
static gpointer _g_variant_ref0 (gpointer self) {
return self ? g_variant_ref (self) : NULL;
}
static void unity_video_lens_remote_video_scope_activate_result_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
UnityVideoLensRemoteVideoScopeActivateResultData* _data_;
_data_ = _user_data_;
_data_->_source_object_ = source_object;
_data_->_res_ = _res_;
unity_video_lens_remote_video_scope_real_activate_result_co (_data_);
}
static gboolean unity_video_lens_remote_video_scope_real_activate_result_co (UnityVideoLensRemoteVideoScopeActivateResultData* _data_) {
switch (_data_->_state_) {
case 0:
goto _state_0;
case 1:
goto _state_1;
default:
g_assert_not_reached ();
}
_state_0:
_data_->_tmp0_ = _data_->_result_;
_data_->_tmp1_ = _data_->_tmp0_.metadata;
_data_->_tmp2_ = unity_video_lens_remote_video_scope_PREVIEW_ON_LMB;
_data_->_tmp3_ = NULL;
_data_->_tmp3_ = g_hash_table_lookup (_data_->_tmp1_, _data_->_tmp2_);
_data_->_tmp4_ = _g_variant_ref0 ((GVariant*) _data_->_tmp3_);
_data_->realcat = _data_->_tmp4_;
_data_->_tmp6_ = _data_->realcat;
if (_data_->_tmp6_ != NULL) {
_data_->_tmp7_ = _data_->realcat;
_data_->_tmp8_ = FALSE;
_data_->_tmp8_ = g_variant_get_boolean (_data_->_tmp7_);
_data_->_tmp5_ = _data_->_tmp8_;
} else {
_data_->_tmp5_ = FALSE;
}
_data_->_tmp9_ = _data_->_tmp5_;
if (_data_->_tmp9_) {
_data_->_tmp10_ = _data_->_result_;
_data_->_state_ = 1;
unity_deprecated_scope_preview_result ((UnityDeprecatedScope*) _data_->self, &_data_->_tmp10_, unity_video_lens_remote_video_scope_activate_result_ready, _data_);
return FALSE;
_state_1:
_data_->_tmp11_ = NULL;
_data_->_tmp11_ = unity_deprecated_scope_preview_result_finish ((UnityDeprecatedScope*) _data_->self, _data_->_res_);
_data_->preview = _data_->_tmp11_;
_data_->_tmp12_ = _data_->preview;
_data_->_tmp13_ = unity_activation_response_new_with_preview (_data_->_tmp12_);
_data_->result = _data_->_tmp13_;
_g_object_unref0 (_data_->preview);
_g_variant_unref0 (_data_->realcat);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_data_->_tmp14_ = _data_->_result_;
_data_->_tmp15_ = _data_->_tmp14_.uri;
_data_->_tmp16_ = NULL;
_data_->_tmp16_ = unity_video_lens_remote_video_scope_on_activate_uri (_data_->self, _data_->_tmp15_);
_data_->result = _data_->_tmp16_;
_g_variant_unref0 (_data_->realcat);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
_g_variant_unref0 (_data_->realcat);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
static UnityActivationResponse* unity_video_lens_remote_video_scope_on_activate_uri (UnityVideoLensRemoteVideoScope* self, const gchar* rawuri) {
UnityActivationResponse* result = NULL;
const gchar* _tmp0_;
UnityVideoLensRemoteUri* _tmp1_ = NULL;
UnityVideoLensRemoteUri* fakeuri;
UnityVideoLensRemoteUri* _tmp2_;
UnityActivationResponse* _tmp23_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (rawuri != NULL, NULL);
_tmp0_ = rawuri;
_tmp1_ = unity_video_lens_remote_uri_from_rawuri (_tmp0_);
fakeuri = _tmp1_;
_tmp2_ = fakeuri;
if (_tmp2_ != NULL) {
gboolean _tmp3_;
_tmp3_ = self->priv->use_zeitgeist;
if (_tmp3_) {
UnityVideoLensRemoteUri* _tmp4_;
const gchar* _tmp5_;
const gchar* _tmp6_;
UnityVideoLensRemoteUri* _tmp7_;
const gchar* _tmp8_;
const gchar* _tmp9_;
UnityVideoLensRemoteUri* _tmp10_;
const gchar* _tmp11_;
const gchar* _tmp12_;
_tmp4_ = fakeuri;
_tmp5_ = unity_video_lens_remote_uri_get_uri (_tmp4_);
_tmp6_ = _tmp5_;
_tmp7_ = fakeuri;
_tmp8_ = unity_video_lens_remote_uri_get_title (_tmp7_);
_tmp9_ = _tmp8_;
_tmp10_ = fakeuri;
_tmp11_ = unity_video_lens_remote_uri_get_icon (_tmp10_);
_tmp12_ = _tmp11_;
unity_video_lens_remote_video_scope_zeitgeist_insert_event (self, _tmp6_, _tmp9_, _tmp12_);
}
{
UnityVideoLensRemoteUri* _tmp13_;
const gchar* _tmp14_;
const gchar* _tmp15_;
UnityActivationResponse* _tmp16_;
_tmp13_ = fakeuri;
_tmp14_ = unity_video_lens_remote_uri_get_uri (_tmp13_);
_tmp15_ = _tmp14_;
g_app_info_launch_default_for_uri (_tmp15_, NULL, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch6_g_error;
}
_tmp16_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
result = _tmp16_;
_unity_video_lens_remote_uri_unref0 (fakeuri);
return result;
}
goto __finally6;
__catch6_g_error:
{
GError* e = NULL;
UnityVideoLensRemoteUri* _tmp17_;
const gchar* _tmp18_;
const gchar* _tmp19_;
GError* _tmp20_;
const gchar* _tmp21_;
e = _inner_error_;
_inner_error_ = NULL;
_tmp17_ = fakeuri;
_tmp18_ = unity_video_lens_remote_uri_get_uri (_tmp17_);
_tmp19_ = _tmp18_;
_tmp20_ = e;
_tmp21_ = _tmp20_->message;
g_warning ("remote-scope.vala:317: Failed to launch default application for '%s': " \
"%s", _tmp19_, _tmp21_);
_g_error_free0 (e);
}
__finally6:
if (_inner_error_ != NULL) {
_unity_video_lens_remote_uri_unref0 (fakeuri);
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return NULL;
}
} else {
const gchar* _tmp22_;
_tmp22_ = rawuri;
g_warning ("remote-scope.vala:322: Invalid raw uri: '%s'", _tmp22_);
}
_tmp23_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
result = _tmp23_;
_unity_video_lens_remote_uri_unref0 (fakeuri);
return result;
}
static UnityActivationResponse* unity_video_lens_remote_video_scope_on_play_video (UnityVideoLensRemoteVideoScope* self, const gchar* rawuri) {
UnityActivationResponse* result = NULL;
const gchar* _tmp0_;
UnityActivationResponse* _tmp1_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (rawuri != NULL, NULL);
_tmp0_ = rawuri;
_tmp1_ = unity_video_lens_remote_video_scope_on_activate_uri (self, _tmp0_);
result = _tmp1_;
return result;
}
static glong string_strnlen (gchar* str, glong maxlen) {
glong result = 0L;
gchar* _tmp0_;
glong _tmp1_;
gchar* _tmp2_ = NULL;
gchar* end;
gchar* _tmp3_;
_tmp0_ = str;
_tmp1_ = maxlen;
_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
end = _tmp2_;
_tmp3_ = end;
if (_tmp3_ == NULL) {
glong _tmp4_;
_tmp4_ = maxlen;
result = _tmp4_;
return result;
} else {
gchar* _tmp5_;
gchar* _tmp6_;
_tmp5_ = end;
_tmp6_ = str;
result = (glong) (_tmp5_ - _tmp6_);
return result;
}
}
static gchar* string_substring (const gchar* self, glong offset, glong len) {
gchar* result = NULL;
glong string_length = 0L;
gboolean _tmp0_ = FALSE;
glong _tmp1_;
gboolean _tmp3_;
glong _tmp9_;
glong _tmp15_;
glong _tmp18_;
glong _tmp19_;
glong _tmp20_;
glong _tmp21_;
glong _tmp22_;
gchar* _tmp23_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
_tmp1_ = offset;
if (_tmp1_ >= ((glong) 0)) {
glong _tmp2_;
_tmp2_ = len;
_tmp0_ = _tmp2_ >= ((glong) 0);
} else {
_tmp0_ = FALSE;
}
_tmp3_ = _tmp0_;
if (_tmp3_) {
glong _tmp4_;
glong _tmp5_;
glong _tmp6_ = 0L;
_tmp4_ = offset;
_tmp5_ = len;
_tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_);
string_length = _tmp6_;
} else {
gint _tmp7_;
gint _tmp8_;
_tmp7_ = strlen (self);
_tmp8_ = _tmp7_;
string_length = (glong) _tmp8_;
}
_tmp9_ = offset;
if (_tmp9_ < ((glong) 0)) {
glong _tmp10_;
glong _tmp11_;
glong _tmp12_;
_tmp10_ = string_length;
_tmp11_ = offset;
offset = _tmp10_ + _tmp11_;
_tmp12_ = offset;
g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL);
} else {
glong _tmp13_;
glong _tmp14_;
_tmp13_ = offset;
_tmp14_ = string_length;
g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL);
}
_tmp15_ = len;
if (_tmp15_ < ((glong) 0)) {
glong _tmp16_;
glong _tmp17_;
_tmp16_ = string_length;
_tmp17_ = offset;
len = _tmp16_ - _tmp17_;
}
_tmp18_ = offset;
_tmp19_ = len;
_tmp20_ = string_length;
g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL);
_tmp21_ = offset;
_tmp22_ = len;
_tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_);
result = _tmp23_;
return result;
}
static UnityActivationResponse* _unity_video_lens_remote_video_scope_on_play_video_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self) {
UnityActivationResponse* result;
result = unity_video_lens_remote_video_scope_on_play_video (self, uri);
return result;
}
static UnityPreview* unity_video_lens_remote_video_scope_build_preview (UnityVideoLensRemoteVideoScope* self, UnityVideoLensRemoteUri* uri, UnityVideoLensRemoteVideoDetails* details) {
UnityPreview* result = NULL;
UnityVideoLensRemoteUri* _tmp0_;
const gchar* _tmp1_;
const gchar* _tmp2_;
gchar* _tmp3_;
gchar* title;
gchar* _tmp4_;
gchar* subtitle;
gchar* _tmp5_;
gchar* description;
GFile* song_file = NULL;
guint8* song_data = NULL;
gint song_data_length1 = 0;
gint _song_data_size_ = 0;
gchar* etag_out = NULL;
gchar* _tmp6_;
gchar* content;
UnityVideoLensRemoteUri* _tmp7_;
const gchar* _tmp8_;
const gchar* _tmp9_;
GFile* _tmp10_ = NULL;
guint8* _tmp11_ = NULL;
gsize _tmp12_;
gchar* _tmp13_ = NULL;
gboolean _tmp14_ = FALSE;
gboolean _tmp15_;
const gchar* _tmp17_;
gint _tmp18_ = 0;
gint iIndex;
const gchar* _tmp19_;
gint _tmp20_;
gchar* _tmp21_ = NULL;
gchar* _tmp22_;
gint _tmp23_ = 0;
gint _tmp24_;
gint iEnd;
const gchar* _tmp25_;
gint _tmp26_;
gint _tmp27_;
gchar* _tmp28_ = NULL;
const gchar* _tmp29_;
gchar* _tmp30_;
UnityVideoLensRemoteVideoDetails* _tmp31_;
const gchar* _tmp63_ = NULL;
UnityVideoLensRemoteVideoDetails* _tmp64_;
const gchar* _tmp70_;
GFile* _tmp71_ = NULL;
GFile* _tmp72_;
GFileIcon* _tmp73_;
GIcon* _tmp74_;
GIcon* thumbnail;
const gchar* _tmp75_;
const gchar* _tmp76_;
const gchar* _tmp77_;
GIcon* _tmp78_;
UnityMoviePreview* _tmp79_;
UnityMoviePreview* real_preview;
const gchar* _tmp80_ = NULL;
UnityPreviewAction* _tmp81_;
UnityPreviewAction* play_video;
UnityPreviewAction* _tmp82_;
UnityMoviePreview* _tmp83_;
UnityPreviewAction* _tmp84_;
UnityMoviePreview* _tmp85_;
UnityVideoLensRemoteVideoDetails* _tmp86_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (uri != NULL, NULL);
_tmp0_ = uri;
_tmp1_ = unity_video_lens_remote_uri_get_title (_tmp0_);
_tmp2_ = _tmp1_;
_tmp3_ = g_strdup (_tmp2_);
title = _tmp3_;
_tmp4_ = g_strdup ("");
subtitle = _tmp4_;
_tmp5_ = g_strdup ("");
description = _tmp5_;
_tmp6_ = g_strdup ("");
content = _tmp6_;
_tmp7_ = uri;
_tmp8_ = unity_video_lens_remote_uri_get_uri (_tmp7_);
_tmp9_ = _tmp8_;
_tmp10_ = g_file_new_for_uri (_tmp9_);
_g_object_unref0 (song_file);
song_file = _tmp10_;
_tmp14_ = g_file_load_contents (song_file, NULL, &_tmp11_, &_tmp12_, &_tmp13_, &_inner_error_);
song_data = (g_free (song_data), NULL);
song_data = _tmp11_;
song_data_length1 = _tmp12_;
_song_data_size_ = song_data_length1;
_g_free0 (etag_out);
etag_out = _tmp13_;
_tmp15_ = _tmp14_;
if (_inner_error_ != NULL) {
_g_free0 (content);
_g_free0 (etag_out);
song_data = (g_free (song_data), NULL);
_g_object_unref0 (song_file);
_g_free0 (description);
_g_free0 (subtitle);
_g_free0 (title);
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
g_clear_error (&_inner_error_);
return NULL;
}
if (_tmp15_) {
gchar* _tmp16_;
_tmp16_ = g_strdup ((const gchar*) song_data);
_g_free0 (content);
content = _tmp16_;
}
_tmp17_ = content;
_tmp18_ = string_index_of (_tmp17_, "", 0);
_tmp24_ = _tmp23_;
_g_free0 (_tmp22_);
iEnd = _tmp24_;
_tmp25_ = content;
_tmp26_ = iIndex;
_tmp27_ = iEnd;
_tmp28_ = string_substring (_tmp25_, (glong) (_tmp26_ + 34), (glong) (_tmp27_ - 37));
_g_free0 (content);
content = _tmp28_;
_tmp29_ = content;
_tmp30_ = g_strdup (_tmp29_);
_g_free0 (description);
description = _tmp30_;
_tmp31_ = details;
if (_tmp31_ != NULL) {
UnityVideoLensRemoteVideoDetails* _tmp32_;
const gchar* _tmp33_;
gchar* _tmp34_;
UnityVideoLensRemoteVideoDetails* _tmp35_;
const gchar* _tmp36_;
gchar* _tmp37_;
gboolean _tmp38_ = FALSE;
UnityVideoLensRemoteVideoDetails* _tmp39_;
const gchar* _tmp40_;
gboolean _tmp43_;
UnityVideoLensRemoteVideoDetails* _tmp47_;
gint _tmp48_;
_tmp32_ = details;
_tmp33_ = (*_tmp32_).title;
_tmp34_ = g_strdup (_tmp33_);
_g_free0 (title);
title = _tmp34_;
_tmp35_ = details;
_tmp36_ = (*_tmp35_).description;
_tmp37_ = g_strdup (_tmp36_);
_g_free0 (description);
description = _tmp37_;
_tmp39_ = details;
_tmp40_ = (*_tmp39_).release_date;
if (_tmp40_ != NULL) {
UnityVideoLensRemoteVideoDetails* _tmp41_;
const gchar* _tmp42_;
_tmp41_ = details;
_tmp42_ = (*_tmp41_).release_date;
_tmp38_ = g_strcmp0 (_tmp42_, "") != 0;
} else {
_tmp38_ = FALSE;
}
_tmp43_ = _tmp38_;
if (_tmp43_) {
UnityVideoLensRemoteVideoDetails* _tmp44_;
const gchar* _tmp45_;
gchar* _tmp46_;
_tmp44_ = details;
_tmp45_ = (*_tmp44_).release_date;
_tmp46_ = g_strdup (_tmp45_);
_g_free0 (subtitle);
subtitle = _tmp46_;
}
_tmp47_ = details;
_tmp48_ = (*_tmp47_).duration;
if (_tmp48_ > 0) {
UnityVideoLensRemoteVideoDetails* _tmp49_;
gint _tmp50_;
const gchar* _tmp51_ = NULL;
UnityVideoLensRemoteVideoDetails* _tmp52_;
gint _tmp53_;
gchar* _tmp54_ = NULL;
gchar* duration;
const gchar* _tmp55_;
_tmp49_ = details;
_tmp50_ = (*_tmp49_).duration;
_tmp51_ = ngettext ("%d min", "%d mins", (gulong) _tmp50_);
_tmp52_ = details;
_tmp53_ = (*_tmp52_).duration;
_tmp54_ = g_strdup_printf (_tmp51_, _tmp53_);
duration = _tmp54_;
_tmp55_ = subtitle;
if (g_strcmp0 (_tmp55_, "") != 0) {
const gchar* _tmp56_;
const gchar* _tmp57_;
gchar* _tmp58_;
gchar* _tmp59_;
gchar* _tmp60_;
_tmp56_ = subtitle;
_tmp57_ = duration;
_tmp58_ = g_strconcat (", ", _tmp57_, NULL);
_tmp59_ = _tmp58_;
_tmp60_ = g_strconcat (_tmp56_, _tmp59_, NULL);
_g_free0 (subtitle);
subtitle = _tmp60_;
_g_free0 (_tmp59_);
} else {
const gchar* _tmp61_;
gchar* _tmp62_;
_tmp61_ = duration;
_tmp62_ = g_strdup (_tmp61_);
_g_free0 (subtitle);
subtitle = _tmp62_;
}
_g_free0 (duration);
}
}
_tmp64_ = details;
if (_tmp64_ != NULL) {
UnityVideoLensRemoteVideoDetails* _tmp65_;
const gchar* _tmp66_;
_tmp65_ = details;
_tmp66_ = (*_tmp65_).image;
_tmp63_ = _tmp66_;
} else {
UnityVideoLensRemoteUri* _tmp67_;
const gchar* _tmp68_;
const gchar* _tmp69_;
_tmp67_ = uri;
_tmp68_ = unity_video_lens_remote_uri_get_icon (_tmp67_);
_tmp69_ = _tmp68_;
_tmp63_ = _tmp69_;
}
_tmp70_ = _tmp63_;
_tmp71_ = g_file_new_for_uri (_tmp70_);
_tmp72_ = _tmp71_;
_tmp73_ = (GFileIcon*) g_file_icon_new (_tmp72_);
_tmp74_ = (GIcon*) _tmp73_;
_g_object_unref0 (_tmp72_);
thumbnail = _tmp74_;
_tmp75_ = title;
_tmp76_ = subtitle;
_tmp77_ = description;
_tmp78_ = thumbnail;
_tmp79_ = unity_movie_preview_new (_tmp75_, _tmp76_, _tmp77_, _tmp78_);
real_preview = _tmp79_;
_tmp80_ = _ ("Play");
_tmp81_ = unity_preview_action_new ("play", _tmp80_, NULL);
play_video = _tmp81_;
_tmp82_ = play_video;
g_signal_connect_object (_tmp82_, "activated", (GCallback) _unity_video_lens_remote_video_scope_on_play_video_unity_preview_action_activated, self, 0);
_tmp83_ = real_preview;
_tmp84_ = play_video;
unity_preview_add_action ((UnityPreview*) _tmp83_, _tmp84_);
_tmp85_ = real_preview;
unity_movie_preview_set_rating (_tmp85_, (gfloat) (-1), (guint) 0);
_tmp86_ = details;
if (_tmp86_ != NULL) {
UnityVideoLensRemoteVideoDetails* _tmp87_;
gchar** _tmp88_;
gint _tmp88__length1;
gboolean _tmp99_ = FALSE;
UnityVideoLensRemoteVideoDetails* _tmp100_;
const gchar* _tmp101_;
gboolean _tmp104_;
gboolean _tmp111_ = FALSE;
UnityVideoLensRemoteVideoDetails* _tmp112_;
gchar** _tmp113_;
gint _tmp113__length1;
gboolean _tmp116_;
gboolean _tmp127_ = FALSE;
UnityVideoLensRemoteVideoDetails* _tmp128_;
const gchar* _tmp129_;
gboolean _tmp132_;
gboolean _tmp139_ = FALSE;
UnityVideoLensRemoteVideoDetails* _tmp140_;
const gchar* _tmp141_;
gboolean _tmp144_;
_tmp87_ = details;
_tmp88_ = (*_tmp87_).directors;
_tmp88__length1 = (*_tmp87_).directors_length1;
if (_tmp88__length1 > 0) {
UnityMoviePreview* _tmp89_;
UnityVideoLensRemoteVideoDetails* _tmp90_;
gchar** _tmp91_;
gint _tmp91__length1;
const gchar* _tmp92_ = NULL;
UnityVideoLensRemoteVideoDetails* _tmp93_;
gchar** _tmp94_;
gint _tmp94__length1;
gchar* _tmp95_ = NULL;
gchar* _tmp96_;
UnityInfoHint* _tmp97_;
UnityInfoHint* _tmp98_;
_tmp89_ = real_preview;
_tmp90_ = details;
_tmp91_ = (*_tmp90_).directors;
_tmp91__length1 = (*_tmp90_).directors_length1;
_tmp92_ = ngettext ("Director", "Directors", (gulong) _tmp91__length1);
_tmp93_ = details;
_tmp94_ = (*_tmp93_).directors;
_tmp94__length1 = (*_tmp93_).directors_length1;
_tmp95_ = g_strjoinv (", ", _tmp94_);
_tmp96_ = _tmp95_;
_tmp97_ = unity_info_hint_new ("directors", _tmp92_, NULL, _tmp96_);
g_object_ref_sink (_tmp97_);
_tmp98_ = _tmp97_;
unity_preview_add_info ((UnityPreview*) _tmp89_, _tmp98_);
_g_object_unref0 (_tmp98_);
_g_free0 (_tmp96_);
}
_tmp100_ = details;
_tmp101_ = (*_tmp100_).starring;
if (_tmp101_ != NULL) {
UnityVideoLensRemoteVideoDetails* _tmp102_;
const gchar* _tmp103_;
_tmp102_ = details;
_tmp103_ = (*_tmp102_).starring;
_tmp99_ = g_strcmp0 (_tmp103_, "") != 0;
} else {
_tmp99_ = FALSE;
}
_tmp104_ = _tmp99_;
if (_tmp104_) {
UnityMoviePreview* _tmp105_;
const gchar* _tmp106_ = NULL;
UnityVideoLensRemoteVideoDetails* _tmp107_;
const gchar* _tmp108_;
UnityInfoHint* _tmp109_;
UnityInfoHint* _tmp110_;
_tmp105_ = real_preview;
_tmp106_ = _ ("Cast");
_tmp107_ = details;
_tmp108_ = (*_tmp107_).starring;
_tmp109_ = unity_info_hint_new ("cast", _tmp106_, NULL, _tmp108_);
g_object_ref_sink (_tmp109_);
_tmp110_ = _tmp109_;
unity_preview_add_info ((UnityPreview*) _tmp105_, _tmp110_);
_g_object_unref0 (_tmp110_);
}
_tmp112_ = details;
_tmp113_ = (*_tmp112_).genres;
_tmp113__length1 = (*_tmp112_).genres_length1;
if (_tmp113_ != NULL) {
UnityVideoLensRemoteVideoDetails* _tmp114_;
gchar** _tmp115_;
gint _tmp115__length1;
_tmp114_ = details;
_tmp115_ = (*_tmp114_).genres;
_tmp115__length1 = (*_tmp114_).genres_length1;
_tmp111_ = _tmp115__length1 > 0;
} else {
_tmp111_ = FALSE;
}
_tmp116_ = _tmp111_;
if (_tmp116_) {
UnityMoviePreview* _tmp117_;
UnityVideoLensRemoteVideoDetails* _tmp118_;
gchar** _tmp119_;
gint _tmp119__length1;
const gchar* _tmp120_ = NULL;
UnityVideoLensRemoteVideoDetails* _tmp121_;
gchar** _tmp122_;
gint _tmp122__length1;
gchar* _tmp123_ = NULL;
gchar* _tmp124_;
UnityInfoHint* _tmp125_;
UnityInfoHint* _tmp126_;
_tmp117_ = real_preview;
_tmp118_ = details;
_tmp119_ = (*_tmp118_).genres;
_tmp119__length1 = (*_tmp118_).genres_length1;
_tmp120_ = ngettext ("Genre", "Genres", (gulong) _tmp119__length1);
_tmp121_ = details;
_tmp122_ = (*_tmp121_).genres;
_tmp122__length1 = (*_tmp121_).genres_length1;
_tmp123_ = g_strjoinv (", ", _tmp122_);
_tmp124_ = _tmp123_;
_tmp125_ = unity_info_hint_new ("genres", _tmp120_, NULL, _tmp124_);
g_object_ref_sink (_tmp125_);
_tmp126_ = _tmp125_;
unity_preview_add_info ((UnityPreview*) _tmp117_, _tmp126_);
_g_object_unref0 (_tmp126_);
_g_free0 (_tmp124_);
}
_tmp128_ = details;
_tmp129_ = (*_tmp128_).uploaded_by;
if (_tmp129_ != NULL) {
UnityVideoLensRemoteVideoDetails* _tmp130_;
const gchar* _tmp131_;
_tmp130_ = details;
_tmp131_ = (*_tmp130_).uploaded_by;
_tmp127_ = g_strcmp0 (_tmp131_, "") != 0;
} else {
_tmp127_ = FALSE;
}
_tmp132_ = _tmp127_;
if (_tmp132_) {
UnityMoviePreview* _tmp133_;
const gchar* _tmp134_ = NULL;
UnityVideoLensRemoteVideoDetails* _tmp135_;
const gchar* _tmp136_;
UnityInfoHint* _tmp137_;
UnityInfoHint* _tmp138_;
_tmp133_ = real_preview;
_tmp134_ = _ ("Uploaded by");
_tmp135_ = details;
_tmp136_ = (*_tmp135_).uploaded_by;
_tmp137_ = unity_info_hint_new ("uploaded-by", _tmp134_, NULL, _tmp136_);
g_object_ref_sink (_tmp137_);
_tmp138_ = _tmp137_;
unity_preview_add_info ((UnityPreview*) _tmp133_, _tmp138_);
_g_object_unref0 (_tmp138_);
}
_tmp140_ = details;
_tmp141_ = (*_tmp140_).date_uploaded;
if (_tmp141_ != NULL) {
UnityVideoLensRemoteVideoDetails* _tmp142_;
const gchar* _tmp143_;
_tmp142_ = details;
_tmp143_ = (*_tmp142_).date_uploaded;
_tmp139_ = g_strcmp0 (_tmp143_, "") != 0;
} else {
_tmp139_ = FALSE;
}
_tmp144_ = _tmp139_;
if (_tmp144_) {
UnityMoviePreview* _tmp145_;
const gchar* _tmp146_ = NULL;
UnityVideoLensRemoteVideoDetails* _tmp147_;
const gchar* _tmp148_;
UnityInfoHint* _tmp149_;
UnityInfoHint* _tmp150_;
_tmp145_ = real_preview;
_tmp146_ = _ ("Uploaded on");
_tmp147_ = details;
_tmp148_ = (*_tmp147_).date_uploaded;
_tmp149_ = unity_info_hint_new ("uploaded-on", _tmp146_, NULL, _tmp148_);
g_object_ref_sink (_tmp149_);
_tmp150_ = _tmp149_;
unity_preview_add_info ((UnityPreview*) _tmp145_, _tmp150_);
_g_object_unref0 (_tmp150_);
}
}
result = (UnityPreview*) real_preview;
_g_object_unref0 (play_video);
_g_object_unref0 (thumbnail);
_g_free0 (content);
_g_free0 (etag_out);
song_data = (g_free (song_data), NULL);
_g_object_unref0 (song_file);
_g_free0 (description);
_g_free0 (subtitle);
_g_free0 (title);
return result;
}
static void unity_video_lens_remote_video_scope_real_preview_result_data_free (gpointer _data) {
UnityVideoLensRemoteVideoScopePreviewResultData* _data_;
_data_ = _data;
unity_scope_result_destroy (&_data_->_result_);
_g_object_unref0 (_data_->result);
_g_object_unref0 (_data_->self);
g_slice_free (UnityVideoLensRemoteVideoScopePreviewResultData, _data_);
}
static void unity_video_lens_remote_video_scope_real_preview_result (UnityDeprecatedScope* base, UnityScopeResult* _result_, GAsyncReadyCallback _callback_, gpointer _user_data_) {
UnityVideoLensRemoteVideoScope * self;
UnityVideoLensRemoteVideoScopePreviewResultData* _data_;
UnityVideoLensRemoteVideoScope* _tmp0_;
UnityScopeResult _tmp1_;
UnityScopeResult _tmp2_ = {0};
self = (UnityVideoLensRemoteVideoScope*) base;
_data_ = g_slice_new0 (UnityVideoLensRemoteVideoScopePreviewResultData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_video_lens_remote_video_scope_real_preview_result);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_video_lens_remote_video_scope_real_preview_result_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
_tmp1_ = *_result_;
unity_scope_result_copy (&_tmp1_, &_tmp2_);
unity_scope_result_destroy (&_data_->_result_);
_data_->_result_ = _tmp2_;
unity_video_lens_remote_video_scope_real_preview_result_co (_data_);
}
static UnityPreview* unity_video_lens_remote_video_scope_real_preview_result_finish (UnityDeprecatedScope* base, GAsyncResult* _res_) {
UnityPreview* result;
UnityVideoLensRemoteVideoScopePreviewResultData* _data_;
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
result = _data_->result;
_data_->result = NULL;
return result;
}
static void unity_video_lens_remote_video_scope_preview_result_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
UnityVideoLensRemoteVideoScopePreviewResultData* _data_;
_data_ = _user_data_;
_data_->_source_object_ = source_object;
_data_->_res_ = _res_;
unity_video_lens_remote_video_scope_real_preview_result_co (_data_);
}
static gboolean unity_video_lens_remote_video_scope_real_preview_result_co (UnityVideoLensRemoteVideoScopePreviewResultData* _data_) {
switch (_data_->_state_) {
case 0:
goto _state_0;
case 1:
goto _state_1;
default:
g_assert_not_reached ();
}
_state_0:
_data_->_tmp0_ = _data_->_result_;
_data_->_tmp1_ = _data_->_tmp0_.uri;
_data_->_tmp2_ = NULL;
_data_->_tmp2_ = unity_video_lens_remote_uri_from_rawuri (_data_->_tmp1_);
_data_->fakeuri = _data_->_tmp2_;
_data_->_tmp3_ = _data_->fakeuri;
if (_data_->_tmp3_ != NULL) {
_data_->details = NULL;
_data_->_tmp5_ = _data_->fakeuri;
_data_->_tmp6_ = unity_video_lens_remote_uri_get_details_uri (_data_->_tmp5_);
_data_->_tmp7_ = _data_->_tmp6_;
if (_data_->_tmp7_ != NULL) {
_data_->_tmp8_ = _data_->fakeuri;
_data_->_tmp9_ = unity_video_lens_remote_uri_get_details_uri (_data_->_tmp8_);
_data_->_tmp10_ = _data_->_tmp9_;
_data_->_tmp4_ = g_strcmp0 (_data_->_tmp10_, "") != 0;
} else {
_data_->_tmp4_ = FALSE;
}
_data_->_tmp11_ = _data_->_tmp4_;
if (_data_->_tmp11_) {
{
_data_->_tmp12_ = _data_->fakeuri;
_data_->_tmp13_ = unity_video_lens_remote_uri_get_uri (_data_->_tmp12_);
_data_->_tmp14_ = _data_->_tmp13_;
_data_->_state_ = 1;
unity_video_lens_remote_video_scope_get_details (_data_->self, _data_->_tmp14_, unity_video_lens_remote_video_scope_preview_result_ready, _data_);
return FALSE;
_state_1:
_data_->_tmp15_ = NULL;
_data_->_tmp15_ = unity_video_lens_remote_video_scope_get_details_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
_data_->_tmp16_ = _data_->_tmp15_;
if (_data_->_inner_error_ != NULL) {
goto __catch7_g_error;
}
_unity_video_lens_remote_video_details_free0 (_data_->details);
_data_->details = _data_->_tmp16_;
}
goto __finally7;
__catch7_g_error:
{
_data_->e = _data_->_inner_error_;
_data_->_inner_error_ = NULL;
_data_->_tmp17_ = _data_->e;
_data_->_tmp18_ = _data_->_tmp17_->message;
g_warning ("remote-scope.vala:420: Failed to fetch video details: %s", _data_->_tmp18_);
_g_error_free0 (_data_->e);
}
__finally7:
if (_data_->_inner_error_ != NULL) {
_unity_video_lens_remote_video_details_free0 (_data_->details);
_unity_video_lens_remote_uri_unref0 (_data_->fakeuri);
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
g_clear_error (&_data_->_inner_error_);
return FALSE;
}
}
_data_->_tmp19_ = _data_->fakeuri;
_data_->_tmp20_ = _data_->details;
_data_->_tmp21_ = NULL;
_data_->_tmp21_ = unity_video_lens_remote_video_scope_build_preview (_data_->self, _data_->_tmp19_, _data_->_tmp20_);
_data_->result = _data_->_tmp21_;
_unity_video_lens_remote_video_details_free0 (_data_->details);
_unity_video_lens_remote_uri_unref0 (_data_->fakeuri);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
} else {
_data_->_tmp22_ = _data_->_result_;
_data_->_tmp23_ = _data_->_tmp22_.uri;
g_warning ("remote-scope.vala:428: Invalid raw uri: '%s'", _data_->_tmp23_);
}
_data_->result = NULL;
_unity_video_lens_remote_uri_unref0 (_data_->fakeuri);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
_unity_video_lens_remote_uri_unref0 (_data_->fakeuri);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
static void unity_video_lens_remote_video_scope_get_details_data_free (gpointer _data) {
UnityVideoLensRemoteVideoScopeGetDetailsData* _data_;
_data_ = _data;
_g_free0 (_data_->url);
_unity_video_lens_remote_video_details_free0 (_data_->result);
_g_object_unref0 (_data_->self);
g_slice_free (UnityVideoLensRemoteVideoScopeGetDetailsData, _data_);
}
static void unity_video_lens_remote_video_scope_get_details (UnityVideoLensRemoteVideoScope* self, const gchar* url, GAsyncReadyCallback _callback_, gpointer _user_data_) {
UnityVideoLensRemoteVideoScopeGetDetailsData* _data_;
UnityVideoLensRemoteVideoScope* _tmp0_;
const gchar* _tmp1_;
gchar* _tmp2_;
_data_ = g_slice_new0 (UnityVideoLensRemoteVideoScopeGetDetailsData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_video_lens_remote_video_scope_get_details);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_video_lens_remote_video_scope_get_details_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
_tmp1_ = url;
_tmp2_ = g_strdup (_tmp1_);
_g_free0 (_data_->url);
_data_->url = _tmp2_;
unity_video_lens_remote_video_scope_get_details_co (_data_);
}
static UnityVideoLensRemoteVideoDetails* unity_video_lens_remote_video_scope_get_details_finish (UnityVideoLensRemoteVideoScope* self, GAsyncResult* _res_, GError** error) {
UnityVideoLensRemoteVideoDetails* result;
UnityVideoLensRemoteVideoScopeGetDetailsData* _data_;
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
return NULL;
}
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
result = _data_->result;
_data_->result = NULL;
return result;
}
static Block1Data* block1_data_ref (Block1Data* _data1_) {
g_atomic_int_inc (&_data1_->_ref_count_);
return _data1_;
}
static void block1_data_unref (void * _userdata_) {
Block1Data* _data1_;
_data1_ = (Block1Data*) _userdata_;
if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
UnityVideoLensRemoteVideoScope * self;
self = _data1_->self;
_g_object_unref0 (_data1_->msg);
_g_object_unref0 (self);
g_slice_free (Block1Data, _data1_);
}
}
static void __lambda11_ (Block1Data* _data1_, SoupSession* session_, SoupMessage* msg_) {
UnityVideoLensRemoteVideoScope * self;
SoupMessage* _tmp0_;
SoupMessage* _tmp1_;
self = _data1_->self;
g_return_if_fail (session_ != NULL);
g_return_if_fail (msg_ != NULL);
_tmp0_ = msg_;
_tmp1_ = _g_object_ref0 (_tmp0_);
_g_object_unref0 (_data1_->msg);
_data1_->msg = _tmp1_;
unity_video_lens_remote_video_scope_get_details_co (_data1_->_async_data_);
}
static void ___lambda11__soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self) {
__lambda11_ (self, session, msg);
}
static gpointer _unity_video_lens_remote_video_details_dup0 (gpointer self) {
return self ? unity_video_lens_remote_video_details_dup (self) : NULL;
}
static gboolean unity_video_lens_remote_video_scope_get_details_co (UnityVideoLensRemoteVideoScopeGetDetailsData* _data_) {
switch (_data_->_state_) {
case 0:
goto _state_0;
case 1:
goto _state_1;
default:
g_assert_not_reached ();
}
_state_0:
_data_->_data1_ = g_slice_new0 (Block1Data);
_data_->_data1_->_ref_count_ = 1;
_data_->_data1_->self = g_object_ref (_data_->self);
_data_->_data1_->_async_data_ = _data_;
_data_->_tmp0_ = _data_->url;
_data_->_tmp1_ = soup_message_new ("GET", _data_->_tmp0_);
_data_->_data1_->msg = _data_->_tmp1_;
_data_->_tmp2_ = _data_->self->priv->session;
_data_->_tmp3_ = _data_->_data1_->msg;
_data_->_tmp4_ = _g_object_ref0 (_data_->_tmp3_);
soup_session_queue_message (_data_->_tmp2_, _data_->_tmp4_, ___lambda11__soup_session_callback, _data_->_data1_);
_data_->_state_ = 1;
return FALSE;
_state_1:
;
_data_->_tmp5_ = _data_->_data1_->msg;
_data_->_tmp6_ = 0U;
g_object_get (_data_->_tmp5_, "status-code", &_data_->_tmp6_, NULL);
_data_->_tmp7_ = _data_->_tmp6_;
if (_data_->_tmp7_ != ((guint) 200)) {
_data_->_tmp8_ = _data_->_data1_->msg;
_data_->_tmp9_ = 0U;
g_object_get (_data_->_tmp8_, "status-code", &_data_->_tmp9_, NULL);
_data_->_tmp10_ = _data_->_tmp9_;
_data_->_tmp11_ = _data_->_data1_->msg;
_data_->_tmp12_ = NULL;
g_object_get (_data_->_tmp11_, "reason-phrase", &_data_->_tmp12_, NULL);
_data_->_tmp13_ = _data_->_tmp12_;
_data_->_tmp14_ = _data_->_tmp13_;
g_warning ("remote-scope.vala:446: Unable to get details from the server: %u, %s", _data_->_tmp10_, _data_->_tmp14_);
_g_free0 (_data_->_tmp14_);
_data_->result = NULL;
block1_data_unref (_data_->_data1_);
_data_->_data1_ = NULL;
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
} else {
_data_->_tmp15_ = _data_->_data1_->msg;
_data_->_tmp16_ = _data_->_tmp15_->response_body;
_data_->_tmp17_ = _data_->_tmp16_->data;
_data_->_tmp17__length1 = (gint) _data_->_tmp16_->length;
memset (&_data_->_tmp18_, 0, sizeof (UnityVideoLensRemoteVideoDetails));
unity_video_lens_ubuntu_video_search_process_details_results ((const gchar*) _data_->_tmp17_, &_data_->_tmp18_, &_data_->_inner_error_);
_data_->details = _data_->_tmp18_;
if (_data_->_inner_error_ != NULL) {
g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
g_error_free (_data_->_inner_error_);
block1_data_unref (_data_->_data1_);
_data_->_data1_ = NULL;
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_data_->_tmp19_ = _data_->details;
_data_->_tmp20_ = _unity_video_lens_remote_video_details_dup0 (&_data_->_tmp19_);
_data_->_tmp21_ = _data_->_tmp20_;
unity_video_lens_remote_video_details_destroy (&_data_->_tmp19_);
_data_->result = _data_->_tmp21_;
block1_data_unref (_data_->_data1_);
_data_->_data1_ = NULL;
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
block1_data_unref (_data_->_data1_);
_data_->_data1_ = NULL;
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
static void unity_video_lens_remote_video_scope_update_search_async_data_free (gpointer _data) {
UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData* _data_;
_data_ = _data;
_g_object_unref0 (_data_->search);
_g_object_unref0 (_data_->cancellable);
_g_object_unref0 (_data_->self);
g_slice_free (UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData, _data_);
}
static void unity_video_lens_remote_video_scope_update_search_async (UnityVideoLensRemoteVideoScope* self, UnityDeprecatedScopeSearch* search, UnitySearchType search_type, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData* _data_;
UnityVideoLensRemoteVideoScope* _tmp0_;
UnityDeprecatedScopeSearch* _tmp1_;
UnityDeprecatedScopeSearch* _tmp2_;
UnitySearchType _tmp3_;
GCancellable* _tmp4_;
GCancellable* _tmp5_;
_data_ = g_slice_new0 (UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_video_lens_remote_video_scope_update_search_async);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_video_lens_remote_video_scope_update_search_async_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
_tmp1_ = search;
_tmp2_ = _g_object_ref0 (_tmp1_);
_g_object_unref0 (_data_->search);
_data_->search = _tmp2_;
_tmp3_ = search_type;
_data_->search_type = _tmp3_;
_tmp4_ = cancellable;
_tmp5_ = _g_object_ref0 (_tmp4_);
_g_object_unref0 (_data_->cancellable);
_data_->cancellable = _tmp5_;
unity_video_lens_remote_video_scope_update_search_async_co (_data_);
}
static void unity_video_lens_remote_video_scope_update_search_finish (UnityVideoLensRemoteVideoScope* self, GAsyncResult* _res_) {
UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData* _data_;
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}
static void unity_video_lens_remote_video_scope_update_search_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData* _data_;
_data_ = _user_data_;
_data_->_source_object_ = source_object;
_data_->_res_ = _res_;
unity_video_lens_remote_video_scope_update_search_async_co (_data_);
}
static gboolean unity_video_lens_remote_video_scope_update_search_async_co (UnityVideoLensRemoteVideoScopeUpdateSearchAsyncData* _data_) {
switch (_data_->_state_) {
case 0:
goto _state_0;
case 1:
goto _state_1;
default:
g_assert_not_reached ();
}
_state_0:
_data_->_tmp0_ = _data_->cancellable;
_data_->_tmp1_ = FALSE;
_data_->_tmp1_ = unity_video_lens_remote_video_scope_is_in_China (_data_->self, _data_->_tmp0_);
if (!_data_->_tmp1_) {
g_warning ("remote-scope.vala:461: Error can not search video from Youku !");
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
{
_data_->_tmp2_ = _data_->search;
_data_->_tmp3_ = unity_deprecated_scope_search_get_search_string (_data_->_tmp2_);
_data_->_tmp4_ = _data_->_tmp3_;
_data_->_tmp5_ = NULL;
_data_->_tmp5_ = string_strip (_data_->_tmp4_);
_data_->search_string = _data_->_tmp5_;
_data_->_tmp6_ = _data_->search_string;
g_debug ("remote-scope.vala:467: Remote search string changed to: %s", _data_->_tmp6_);
_data_->_tmp7_ = _data_->search;
_data_->_tmp8_ = unity_deprecated_scope_search_get_results_model (_data_->_tmp7_);
_data_->_tmp9_ = _data_->_tmp8_;
_data_->_tmp10_ = _g_object_ref0 (_data_->_tmp9_);
_data_->model = _data_->_tmp10_;
_data_->_tmp11_ = _data_->model;
dee_model_clear ((DeeModel*) _data_->_tmp11_);
_data_->_tmp12_ = _data_->self->priv->preferences;
_data_->_tmp13_ = unity_preferences_manager_get_remote_content_search (_data_->_tmp12_);
_data_->_tmp14_ = _data_->_tmp13_;
if (_data_->_tmp14_ != UNITY_PREFERENCES_MANAGER_REMOTE_CONTENT_ALL) {
_data_->_tmp15_ = _data_->search;
g_signal_emit_by_name (_data_->_tmp15_, "finished");
_g_object_unref0 (_data_->model);
_g_free0 (_data_->search_string);
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_data_->_tmp16_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
_data_->active_sources = _data_->_tmp16_;
_data_->_tmp17_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) _data_->self);
_data_->_tmp18_ = _data_->_tmp17_;
_data_->_tmp19_ = _data_->_tmp18_->options;
{
_data_->opt_collection = _data_->_tmp19_;
for (_data_->opt_it = _data_->opt_collection; _data_->opt_it != NULL; _data_->opt_it = _data_->opt_it->next) {
_data_->_tmp20_ = _g_object_ref0 ((UnityFilterOption*) _data_->opt_it->data);
_data_->opt = _data_->_tmp20_;
{
_data_->_tmp21_ = _data_->opt;
_data_->_tmp22_ = unity_filter_option_get_id (_data_->_tmp21_);
_data_->_tmp23_ = _data_->_tmp22_;
_data_->_tmp24_ = FALSE;
_data_->_tmp24_ = unity_video_lens_remote_video_scope_source_activated (_data_->self, _data_->_tmp23_);
if (_data_->_tmp24_) {
_data_->_tmp25_ = _data_->active_sources;
_data_->_tmp26_ = _data_->opt;
_data_->_tmp27_ = unity_filter_option_get_id (_data_->_tmp26_);
_data_->_tmp28_ = _data_->_tmp27_;
gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp25_, _data_->_tmp28_);
}
_g_object_unref0 (_data_->opt);
}
}
}
_data_->_tmp29_ = _data_->active_sources;
_data_->_tmp30_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp29_);
_data_->_tmp31_ = _data_->_tmp30_;
_data_->_tmp32_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) _data_->self);
_data_->_tmp33_ = _data_->_tmp32_;
_data_->_tmp34_ = _data_->_tmp33_->options;
_data_->_tmp35_ = 0U;
_data_->_tmp35_ = g_list_length (_data_->_tmp34_);
if (((guint) _data_->_tmp31_) == _data_->_tmp35_) {
_data_->_tmp36_ = _data_->active_sources;
gee_abstract_collection_clear ((GeeAbstractCollection*) _data_->_tmp36_);
}
_data_->_tmp37_ = _data_->search_type;
if (_data_->_tmp37_ == UNITY_SEARCH_TYPE_DEFAULT) {
_data_->_tmp38_ = _data_->active_sources;
_data_->_tmp39_ = FALSE;
_data_->_tmp39_ = unity_video_lens_remote_video_scope_at_least_one_source_is_on (_data_->self, _data_->_tmp38_);
if (_data_->_tmp39_) {
{
_data_->_tmp40_ = _data_->search_string;
_data_->_tmp41_ = _data_->search;
_data_->_tmp42_ = _data_->active_sources;
_data_->_tmp43_ = _data_->cancellable;
_data_->_state_ = 1;
unity_video_lens_remote_video_scope_perform_search (_data_->self, _data_->_tmp40_, _data_->_tmp41_, _data_->_tmp42_, _data_->_tmp43_, unity_video_lens_remote_video_scope_update_search_async_ready, _data_);
return FALSE;
_state_1:
unity_video_lens_remote_video_scope_perform_search_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
if (_data_->_inner_error_ != NULL) {
goto __catch9_g_error;
}
}
goto __finally9;
__catch9_g_error:
{
_data_->e = _data_->_inner_error_;
_data_->_inner_error_ = NULL;
_data_->_tmp44_ = _data_->e;
_data_->_tmp45_ = _data_->_tmp44_->message;
g_warning ("remote-scope.vala:505: Search interrupted: %s", _data_->_tmp45_);
_g_error_free0 (_data_->e);
}
__finally9:
if (_data_->_inner_error_ != NULL) {
_g_object_unref0 (_data_->active_sources);
_g_object_unref0 (_data_->model);
_g_free0 (_data_->search_string);
goto __catch8_g_error;
}
}
}
_data_->_tmp46_ = _data_->search;
g_signal_emit_by_name (_data_->_tmp46_, "finished");
_g_object_unref0 (_data_->active_sources);
_g_object_unref0 (_data_->model);
_g_free0 (_data_->search_string);
}
goto __finally8;
__catch8_g_error:
{
_data_->_vala1_e = _data_->_inner_error_;
_data_->_inner_error_ = NULL;
_data_->_tmp47_ = _data_->_vala1_e;
_data_->_tmp48_ = _data_->_tmp47_->message;
g_warning ("remote-scope.vala:515: Error getting result from youku: %s(Failed to S" \
"earch video from Youku)!", _data_->_tmp48_);
_g_error_free0 (_data_->_vala1_e);
}
__finally8:
if (_data_->_inner_error_ != NULL) {
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
g_clear_error (&_data_->_inner_error_);
return FALSE;
}
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
static gboolean unity_video_lens_remote_video_scope_source_activated (UnityVideoLensRemoteVideoScope* self, const gchar* id) {
gboolean result = FALSE;
UnityOptionsFilter* _tmp0_;
UnityOptionsFilter* _tmp1_;
const gchar* _tmp2_;
UnityFilterOption* _tmp3_ = NULL;
UnityFilterOption* _tmp4_;
gboolean _tmp5_;
gboolean _tmp6_;
gboolean _tmp7_;
gboolean active;
UnityOptionsFilter* _tmp8_;
UnityOptionsFilter* _tmp9_;
gboolean _tmp10_;
gboolean _tmp11_;
gboolean filtering;
gboolean _tmp12_ = FALSE;
gboolean _tmp13_ = FALSE;
gboolean _tmp14_;
gboolean _tmp16_;
gboolean _tmp21_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (id != NULL, FALSE);
_tmp0_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) self);
_tmp1_ = _tmp0_;
_tmp2_ = id;
_tmp3_ = unity_options_filter_get_option (_tmp1_, _tmp2_);
_tmp4_ = _tmp3_;
_tmp5_ = unity_filter_option_get_active (_tmp4_);
_tmp6_ = _tmp5_;
_tmp7_ = _tmp6_;
_g_object_unref0 (_tmp4_);
active = _tmp7_;
_tmp8_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) self);
_tmp9_ = _tmp8_;
_tmp10_ = unity_filter_get_filtering ((UnityFilter*) _tmp9_);
_tmp11_ = _tmp10_;
filtering = _tmp11_;
_tmp14_ = active;
if (_tmp14_) {
gboolean _tmp15_;
_tmp15_ = filtering;
_tmp13_ = _tmp15_;
} else {
_tmp13_ = FALSE;
}
_tmp16_ = _tmp13_;
if (_tmp16_) {
_tmp12_ = TRUE;
} else {
gboolean _tmp17_ = FALSE;
gboolean _tmp18_;
gboolean _tmp20_;
_tmp18_ = active;
if (!_tmp18_) {
gboolean _tmp19_;
_tmp19_ = filtering;
_tmp17_ = !_tmp19_;
} else {
_tmp17_ = FALSE;
}
_tmp20_ = _tmp17_;
_tmp12_ = _tmp20_;
}
_tmp21_ = _tmp12_;
if (_tmp21_) {
result = TRUE;
return result;
}
result = FALSE;
return result;
}
static gboolean unity_video_lens_remote_video_scope_at_least_one_source_is_on (UnityVideoLensRemoteVideoScope* self, GeeArrayList* active_sources) {
gboolean result = FALSE;
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
UnityOptionsFilter* _tmp2_;
UnityOptionsFilter* _tmp3_;
gboolean _tmp4_;
gboolean _tmp5_;
gboolean _tmp9_;
gboolean _tmp14_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (active_sources != NULL, FALSE);
_tmp2_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) self);
_tmp3_ = _tmp2_;
_tmp4_ = unity_filter_get_filtering ((UnityFilter*) _tmp3_);
_tmp5_ = _tmp4_;
if (_tmp5_) {
GeeArrayList* _tmp6_;
gint _tmp7_;
gint _tmp8_;
_tmp6_ = active_sources;
_tmp7_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp6_);
_tmp8_ = _tmp7_;
_tmp1_ = _tmp8_ > 0;
} else {
_tmp1_ = FALSE;
}
_tmp9_ = _tmp1_;
if (_tmp9_) {
_tmp0_ = TRUE;
} else {
UnityOptionsFilter* _tmp10_;
UnityOptionsFilter* _tmp11_;
gboolean _tmp12_;
gboolean _tmp13_;
_tmp10_ = unity_deprecated_scope_base_get_sources ((UnityDeprecatedScopeBase*) self);
_tmp11_ = _tmp10_;
_tmp12_ = unity_filter_get_filtering ((UnityFilter*) _tmp11_);
_tmp13_ = _tmp12_;
_tmp0_ = !_tmp13_;
}
_tmp14_ = _tmp0_;
result = _tmp14_;
return result;
}
static void unity_video_lens_remote_video_scope_perform_search_data_free (gpointer _data) {
UnityVideoLensRemoteVideoScopePerformSearchData* _data_;
_data_ = _data;
_g_free0 (_data_->search_string);
_g_object_unref0 (_data_->search);
_g_object_unref0 (_data_->active_sources);
_g_object_unref0 (_data_->cancellable);
_g_object_unref0 (_data_->self);
g_slice_free (UnityVideoLensRemoteVideoScopePerformSearchData, _data_);
}
static void unity_video_lens_remote_video_scope_perform_search (UnityVideoLensRemoteVideoScope* self, const gchar* search_string, UnityDeprecatedScopeSearch* search, GeeArrayList* active_sources, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
UnityVideoLensRemoteVideoScopePerformSearchData* _data_;
UnityVideoLensRemoteVideoScope* _tmp0_;
const gchar* _tmp1_;
gchar* _tmp2_;
UnityDeprecatedScopeSearch* _tmp3_;
UnityDeprecatedScopeSearch* _tmp4_;
GeeArrayList* _tmp5_;
GeeArrayList* _tmp6_;
GCancellable* _tmp7_;
GCancellable* _tmp8_;
_data_ = g_slice_new0 (UnityVideoLensRemoteVideoScopePerformSearchData);
_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_video_lens_remote_video_scope_perform_search);
g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_video_lens_remote_video_scope_perform_search_data_free);
_tmp0_ = _g_object_ref0 (self);
_data_->self = _tmp0_;
_tmp1_ = search_string;
_tmp2_ = g_strdup (_tmp1_);
_g_free0 (_data_->search_string);
_data_->search_string = _tmp2_;
_tmp3_ = search;
_tmp4_ = _g_object_ref0 (_tmp3_);
_g_object_unref0 (_data_->search);
_data_->search = _tmp4_;
_tmp5_ = active_sources;
_tmp6_ = _g_object_ref0 (_tmp5_);
_g_object_unref0 (_data_->active_sources);
_data_->active_sources = _tmp6_;
_tmp7_ = cancellable;
_tmp8_ = _g_object_ref0 (_tmp7_);
_g_object_unref0 (_data_->cancellable);
_data_->cancellable = _tmp8_;
unity_video_lens_remote_video_scope_perform_search_co (_data_);
}
static void unity_video_lens_remote_video_scope_perform_search_finish (UnityVideoLensRemoteVideoScope* self, GAsyncResult* _res_, GError** error) {
UnityVideoLensRemoteVideoScopePerformSearchData* _data_;
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
return;
}
_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}
static Block2Data* block2_data_ref (Block2Data* _data2_) {
g_atomic_int_inc (&_data2_->_ref_count_);
return _data2_;
}
static void block2_data_unref (void * _userdata_) {
Block2Data* _data2_;
_data2_ = (Block2Data*) _userdata_;
if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
UnityVideoLensRemoteVideoScope * self;
self = _data2_->self;
_g_object_unref0 (_data2_->msg);
_g_object_unref0 (self);
g_slice_free (Block2Data, _data2_);
}
}
static void __lambda4_ (Block2Data* _data2_, SoupSession* session_, SoupMessage* msg_) {
UnityVideoLensRemoteVideoScope * self;
SoupMessage* _tmp0_;
SoupMessage* _tmp1_;
self = _data2_->self;
g_return_if_fail (session_ != NULL);
g_return_if_fail (msg_ != NULL);
_tmp0_ = msg_;
_tmp1_ = _g_object_ref0 (_tmp0_);
_g_object_unref0 (_data2_->msg);
_data2_->msg = _tmp1_;
unity_video_lens_remote_video_scope_perform_search_co (_data2_->_async_data_);
}
static void ___lambda4__soup_session_callback (SoupSession* session, SoupMessage* msg, gpointer self) {
__lambda4_ (self, session, msg);
}
static void ___lambda5_ (Block2Data* _data2_) {
UnityVideoLensRemoteVideoScope * self;
SoupSession* _tmp0_;
SoupMessage* _tmp1_;
self = _data2_->self;
_data2_->cancelled = TRUE;
_tmp0_ = self->priv->session;
_tmp1_ = _data2_->msg;
soup_session_cancel_message (_tmp0_, _tmp1_, (guint) SOUP_STATUS_CANCELLED);
}
static void ____lambda5__gfunc (gconstpointer data, gpointer self) {
___lambda5_ (self);
}
static gboolean _unity_video_lens_remote_video_scope_perform_search_co_gsource_func (gpointer self) {
gboolean result;
result = unity_video_lens_remote_video_scope_perform_search_co (self);
return result;
}
static gboolean unity_video_lens_remote_video_scope_perform_search_co (UnityVideoLensRemoteVideoScopePerformSearchData* _data_) {
switch (_data_->_state_) {
case 0:
goto _state_0;
case 1:
goto _state_1;
case 2:
goto _state_2;
default:
g_assert_not_reached ();
}
_state_0:
_data_->_data2_ = g_slice_new0 (Block2Data);
_data_->_data2_->_ref_count_ = 1;
_data_->_data2_->self = g_object_ref (_data_->self);
_data_->_data2_->_async_data_ = _data_;
_data_->_tmp0_ = _data_->search;
_data_->_tmp1_ = unity_deprecated_scope_search_get_results_model (_data_->_tmp0_);
_data_->_tmp2_ = _data_->_tmp1_;
dee_model_clear ((DeeModel*) _data_->_tmp2_);
_data_->_tmp6_ = _data_->search_string;
if (_data_->_tmp6_ == NULL) {
_data_->_tmp5_ = TRUE;
} else {
_data_->_tmp7_ = _data_->search_string;
_data_->_tmp5_ = g_strcmp0 (_data_->_tmp7_, "") == 0;
}
_data_->_tmp8_ = _data_->_tmp5_;
if (_data_->_tmp8_) {
_data_->_tmp9_ = _data_->active_sources;
_data_->_tmp10_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp9_);
_data_->_tmp11_ = _data_->_tmp10_;
_data_->_tmp4_ = _data_->_tmp11_ == 0;
} else {
_data_->_tmp4_ = FALSE;
}
_data_->_tmp12_ = _data_->_tmp4_;
if (_data_->_tmp12_) {
_data_->_tmp13_ = _data_->self->priv->recommendations;
_data_->_tmp14_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp13_);
_data_->_tmp15_ = _data_->_tmp14_;
_data_->_tmp3_ = _data_->_tmp15_ > 0;
} else {
_data_->_tmp3_ = FALSE;
}
_data_->_tmp16_ = _data_->_tmp3_;
if (_data_->_tmp16_) {
_data_->_tmp17_ = g_date_time_new_now_utc ();
_data_->time = _data_->_tmp17_;
_data_->_tmp18_ = _data_->time;
_data_->_tmp19_ = 0LL;
_data_->_tmp19_ = g_date_time_to_unix (_data_->_tmp18_);
_data_->_tmp20_ = _data_->self->priv->recommendations_last_update;
_data_->_tmp21_ = unity_video_lens_remote_video_scope_REFRESH_INTERVAL;
if ((_data_->_tmp19_ - _data_->_tmp20_) < ((gint64) _data_->_tmp21_)) {
g_debug ("remote-scope.vala:550: Updating search results with recommendations");
_data_->_tmp22_ = _data_->search;
_data_->_tmp23_ = unity_deprecated_scope_search_get_results_model (_data_->_tmp22_);
_data_->_tmp24_ = _data_->_tmp23_;
_data_->_tmp25_ = _data_->self->priv->recommendations;
unity_video_lens_remote_video_scope_update_results_model (_data_->self, (DeeModel*) _data_->_tmp24_, _data_->_tmp25_);
_g_date_time_unref0 (_data_->time);
block2_data_unref (_data_->_data2_);
_data_->_data2_ = NULL;
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_g_date_time_unref0 (_data_->time);
}
_data_->_tmp26_ = _data_->search_string;
_data_->_tmp27_ = _data_->active_sources;
_data_->_tmp28_ = NULL;
_data_->_tmp28_ = unity_video_lens_ubuntu_video_search_build_search_uri (_data_->_tmp26_, _data_->_tmp27_);
_data_->url = _data_->_tmp28_;
_data_->_tmp29_ = _data_->url;
g_debug ("remote-scope.vala:557: Querying the server: %s", _data_->_tmp29_);
_data_->_tmp32_ = _data_->search_string;
if (_data_->_tmp32_ == NULL) {
_data_->_tmp31_ = TRUE;
} else {
_data_->_tmp33_ = _data_->search_string;
_data_->_tmp31_ = g_strcmp0 (_data_->_tmp33_, "") == 0;
}
_data_->_tmp34_ = _data_->_tmp31_;
if (_data_->_tmp34_) {
_data_->_tmp30_ = TRUE;
} else {
_data_->_tmp35_ = _data_->active_sources;
_data_->_tmp36_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp35_);
_data_->_tmp37_ = _data_->_tmp36_;
_data_->_tmp30_ = _data_->_tmp37_ == 0;
}
_data_->_tmp38_ = _data_->_tmp30_;
_data_->is_treat_yourself = _data_->_tmp38_;
_data_->_tmp39_ = _data_->url;
_data_->_tmp40_ = soup_message_new ("GET", _data_->_tmp39_);
_data_->_data2_->msg = _data_->_tmp40_;
_data_->_tmp41_ = _data_->self->priv->session;
_data_->_tmp42_ = _data_->_data2_->msg;
_data_->_tmp43_ = _g_object_ref0 (_data_->_tmp42_);
soup_session_queue_message (_data_->_tmp41_, _data_->_tmp43_, ___lambda4__soup_session_callback, _data_->_data2_);
_data_->_data2_->cancelled = FALSE;
_data_->cancel_id = (gulong) 0;
_data_->_tmp44_ = _data_->cancellable;
if (_data_->_tmp44_ != NULL) {
_data_->_tmp45_ = _data_->cancellable;
_data_->_tmp46_ = 0UL;
_data_->_tmp46_ = g_cancellable_connect (_data_->_tmp45_, (GCallback) ____lambda5__gfunc, block2_data_ref (_data_->_data2_), block2_data_unref);
_data_->cancel_id = _data_->_tmp46_;
}
_data_->_state_ = 1;
return FALSE;
_state_1:
;
_data_->_tmp47_ = _data_->_data2_->cancelled;
if (_data_->_tmp47_) {
g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _unity_video_lens_remote_video_scope_perform_search_co_gsource_func, _data_, NULL);
_data_->_state_ = 2;
return FALSE;
_state_2:
;
_data_->_tmp48_ = _data_->cancellable;
_data_->_tmp49_ = _data_->cancel_id;
g_cancellable_disconnect (_data_->_tmp48_, _data_->_tmp49_);
_data_->_tmp50_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Cancelled");
_data_->_inner_error_ = _data_->_tmp50_;
g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
g_error_free (_data_->_inner_error_);
_g_free0 (_data_->url);
block2_data_unref (_data_->_data2_);
_data_->_data2_ = NULL;
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
_data_->_tmp51_ = _data_->cancellable;
if (_data_->_tmp51_ != NULL) {
_data_->_tmp52_ = _data_->cancellable;
_data_->_tmp53_ = _data_->cancel_id;
g_cancellable_disconnect (_data_->_tmp52_, _data_->_tmp53_);
}
_data_->_tmp54_ = _data_->_data2_->msg;
_data_->_tmp55_ = _data_->is_treat_yourself;
_data_->_tmp56_ = NULL;
_data_->_tmp56_ = unity_video_lens_remote_video_scope_handle_search_response (_data_->self, _data_->_tmp54_, _data_->_tmp55_);
_data_->results = _data_->_tmp56_;
_data_->_tmp57_ = _data_->results;
if (_data_->_tmp57_ != NULL) {
_data_->_tmp59_ = _data_->search_string;
if (_data_->_tmp59_ == NULL) {
_data_->_tmp58_ = TRUE;
} else {
_data_->_tmp61_ = _data_->search_string;
_data_->_tmp62_ = NULL;
_data_->_tmp62_ = string_strip (_data_->_tmp61_);
_data_->_tmp63_ = _data_->_tmp62_;
_data_->_tmp64_ = g_strcmp0 (_data_->_tmp63_, "") == 0;
_g_free0 (_data_->_tmp63_);
if (_data_->_tmp64_) {
_data_->_tmp65_ = _data_->active_sources;
_data_->_tmp66_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp65_);
_data_->_tmp67_ = _data_->_tmp66_;
_data_->_tmp60_ = _data_->_tmp67_ == 0;
} else {
_data_->_tmp60_ = FALSE;
}
_data_->_tmp68_ = _data_->_tmp60_;
_data_->_tmp58_ = _data_->_tmp68_;
}
_data_->_tmp69_ = _data_->_tmp58_;
if (_data_->_tmp69_) {
g_debug ("remote-scope.vala:603: Empty search, updating recommendations");
_data_->_tmp70_ = g_date_time_new_now_utc ();
_data_->_vala1_time = _data_->_tmp70_;
_data_->_tmp71_ = _data_->results;
_data_->_tmp72_ = _g_object_ref0 (_data_->_tmp71_);
_g_object_unref0 (_data_->self->priv->recommendations);
_data_->self->priv->recommendations = _data_->_tmp72_;
_data_->_tmp73_ = _data_->_vala1_time;
_data_->_tmp74_ = 0LL;
_data_->_tmp74_ = g_date_time_to_unix (_data_->_tmp73_);
_data_->self->priv->recommendations_last_update = _data_->_tmp74_;
_g_date_time_unref0 (_data_->_vala1_time);
}
_data_->_tmp75_ = _data_->search;
_data_->_tmp76_ = unity_deprecated_scope_search_get_results_model (_data_->_tmp75_);
_data_->_tmp77_ = _data_->_tmp76_;
_data_->_tmp78_ = _data_->results;
unity_video_lens_remote_video_scope_update_results_model (_data_->self, (DeeModel*) _data_->_tmp77_, _data_->_tmp78_);
}
_g_object_unref0 (_data_->results);
_g_free0 (_data_->url);
block2_data_unref (_data_->_data2_);
_data_->_data2_ = NULL;
if (_data_->_state_ == 0) {
g_simple_async_result_complete_in_idle (_data_->_async_result);
} else {
g_simple_async_result_complete (_data_->_async_result);
}
g_object_unref (_data_->_async_result);
return FALSE;
}
static GVariant* _variant_new1 (const gchar* value) {
return g_variant_ref_sink (g_variant_new_string (value));
}
static GVariant* _variant_new2 (gboolean value) {
return g_variant_ref_sink (g_variant_new_boolean (value));
}
static void unity_video_lens_remote_video_scope_update_results_model (UnityVideoLensRemoteVideoScope* self, DeeModel* model, GeeArrayList* results) {
g_return_if_fail (self != NULL);
g_return_if_fail (model != NULL);
g_return_if_fail (results != NULL);
{
GeeArrayList* _tmp0_;
GeeArrayList* _tmp1_;
GeeArrayList* _video_list;
GeeArrayList* _tmp2_;
gint _tmp3_;
gint _tmp4_;
gint _video_size;
gint _video_index;
_tmp0_ = results;
_tmp1_ = _g_object_ref0 (_tmp0_);
_video_list = _tmp1_;
_tmp2_ = _video_list;
_tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
_tmp4_ = _tmp3_;
_video_size = _tmp4_;
_video_index = -1;
while (TRUE) {
gint _tmp5_;
gint _tmp6_;
gint _tmp7_;
GeeArrayList* _tmp8_;
gint _tmp9_;
gpointer _tmp10_ = NULL;
UnityVideoLensRemoteVideoFile* video;
UnityVideoLensRemoteVideoFile* _tmp11_;
const gchar* _tmp12_;
gboolean _tmp13_ = FALSE;
_tmp5_ = _video_index;
_video_index = _tmp5_ + 1;
_tmp6_ = _video_index;
_tmp7_ = _video_size;
if (!(_tmp6_ < _tmp7_)) {
break;
}
_tmp8_ = _video_list;
_tmp9_ = _video_index;
_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
video = (UnityVideoLensRemoteVideoFile*) _tmp10_;
_tmp11_ = video;
_tmp12_ = (*_tmp11_).uri;
_tmp13_ = g_str_has_prefix (_tmp12_, "http");
if (_tmp13_) {
UnityVideoLensRemoteVideoFile* _tmp14_;
const gchar* _tmp15_;
UnityVideoLensRemoteVideoFile* _tmp16_;
const gchar* _tmp17_;
UnityVideoLensRemoteVideoFile* _tmp18_;
const gchar* _tmp19_;
UnityVideoLensRemoteUri* _tmp20_;
UnityVideoLensRemoteUri* fake_uri;
UnityVideoLensRemoteUri* _tmp21_;
UnityVideoLensRemoteVideoFile* _tmp22_;
const gchar* _tmp23_;
gchar* _tmp24_;
gchar* result_icon;
gboolean _tmp25_ = FALSE;
gboolean _tmp26_ = FALSE;
UnityVideoLensRemoteVideoFile* _tmp27_;
gint _tmp28_;
gint _tmp29_;
gboolean _tmp32_;
gboolean _tmp35_;
const gchar* _tmp49_;
GVariant* _tmp50_;
UnityVideoLensRemoteVideoFile* _tmp51_;
gint _tmp52_;
gint _tmp53_;
GVariant* _tmp54_;
GVariant* _tmp55_;
GVariant* _tmp56_;
GVariant* _tmp57_;
GVariant* _tmp58_;
GVariant* realcat;
const GVariantType* _tmp59_;
const GVariantType* _tmp60_ = NULL;
GVariant* _tmp61_;
GVariant* _tmp62_;
GVariant** _tmp63_ = NULL;
GVariant** _tmp64_;
gint _tmp64__length1;
GVariant* _tmp65_;
GVariant* _tmp66_;
GVariant* metadata;
DeeModel* _tmp67_;
UnityVideoLensRemoteUri* _tmp68_;
gchar* _tmp69_ = NULL;
gchar* _tmp70_;
const gchar* _tmp71_;
UnityVideoLensRemoteVideoFile* _tmp72_;
gint _tmp73_;
UnityVideoLensRemoteVideoFile* _tmp74_;
const gchar* _tmp75_;
UnityVideoLensRemoteVideoFile* _tmp76_;
const gchar* _tmp77_;
UnityVideoLensRemoteVideoFile* _tmp78_;
const gchar* _tmp79_;
GVariant* _tmp80_;
_tmp14_ = video;
_tmp15_ = (*_tmp14_).uri;
_tmp16_ = video;
_tmp17_ = (*_tmp16_).title;
_tmp18_ = video;
_tmp19_ = (*_tmp18_).icon;
_tmp20_ = unity_video_lens_remote_uri_new (_tmp15_, _tmp17_, _tmp19_, "video.details_uri");
fake_uri = _tmp20_;
_tmp21_ = fake_uri;
if (_tmp21_ == NULL) {
g_warning ("remote-scope.vala:623: fake_uri is null");
}
_tmp22_ = video;
_tmp23_ = (*_tmp22_).icon;
_tmp24_ = g_strdup (_tmp23_);
result_icon = _tmp24_;
_tmp27_ = video;
_tmp28_ = (*_tmp27_).category;
_tmp29_ = unity_video_lens_CAT_INDEX_MORE;
if (_tmp28_ == _tmp29_) {
UnityVideoLensRemoteVideoFile* _tmp30_;
const gchar* _tmp31_;
_tmp30_ = video;
_tmp31_ = (*_tmp30_).price;
_tmp26_ = _tmp31_ != NULL;
} else {
_tmp26_ = FALSE;
}
_tmp32_ = _tmp26_;
if (_tmp32_) {
UnityVideoLensRemoteVideoFile* _tmp33_;
const gchar* _tmp34_;
_tmp33_ = video;
_tmp34_ = (*_tmp33_).price;
_tmp25_ = g_strcmp0 (_tmp34_, "") != 0;
} else {
_tmp25_ = FALSE;
}
_tmp35_ = _tmp25_;
if (_tmp35_) {
const gchar* _tmp36_;
GFile* _tmp37_ = NULL;
GFile* _tmp38_;
GFileIcon* _tmp39_;
GFileIcon* _tmp40_;
UnityAnnotatedIcon* _tmp41_;
UnityAnnotatedIcon* _tmp42_;
UnityAnnotatedIcon* anno_icon;
UnityAnnotatedIcon* _tmp43_;
UnityAnnotatedIcon* _tmp44_;
UnityVideoLensRemoteVideoFile* _tmp45_;
const gchar* _tmp46_;
UnityAnnotatedIcon* _tmp47_;
gchar* _tmp48_ = NULL;
_tmp36_ = result_icon;
_tmp37_ = g_file_new_for_uri (_tmp36_);
_tmp38_ = _tmp37_;
_tmp39_ = (GFileIcon*) g_file_icon_new (_tmp38_);
_tmp40_ = _tmp39_;
_tmp41_ = unity_annotated_icon_new ((GIcon*) _tmp40_);
_tmp42_ = _tmp41_;
_g_object_unref0 (_tmp40_);
_g_object_unref0 (_tmp38_);
anno_icon = _tmp42_;
_tmp43_ = anno_icon;
unity_annotated_icon_set_category (_tmp43_, UNITY_CATEGORY_TYPE_MOVIE);
_tmp44_ = anno_icon;
_tmp45_ = video;
_tmp46_ = (*_tmp45_).price;
unity_annotated_icon_set_ribbon (_tmp44_, _tmp46_);
_tmp47_ = anno_icon;
_tmp48_ = unity_annotated_icon_to_string (_tmp47_);
_g_free0 (result_icon);
result_icon = _tmp48_;
_g_object_unref0 (anno_icon);
}
_tmp49_ = unity_video_lens_remote_video_scope_PREVIEW_ON_LMB;
_tmp50_ = _variant_new1 (_tmp49_);
_tmp51_ = video;
_tmp52_ = (*_tmp51_).category;
_tmp53_ = unity_video_lens_CAT_INDEX_MORE;
_tmp54_ = _variant_new2 (_tmp52_ == _tmp53_);
_tmp55_ = g_variant_new_variant (_tmp54_);
g_variant_ref_sink (_tmp55_);
_tmp56_ = _tmp55_;
_tmp57_ = g_variant_new_dict_entry (_tmp50_, _tmp56_);
g_variant_ref_sink (_tmp57_);
_tmp58_ = _tmp57_;
_g_variant_unref0 (_tmp56_);
realcat = _tmp58_;
_tmp59_ = G_VARIANT_TYPE_VARDICT;
_tmp60_ = g_variant_type_element (_tmp59_);
_tmp61_ = realcat;
_tmp62_ = _g_variant_ref0 (_tmp61_);
_tmp63_ = g_new0 (GVariant*, 1 + 1);
_tmp63_[0] = _tmp62_;
_tmp64_ = _tmp63_;
_tmp64__length1 = 1;
_tmp65_ = g_variant_new_array (_tmp60_, _tmp64_, 1);
g_variant_ref_sink (_tmp65_);
_tmp66_ = _tmp65_;
_tmp64_ = (_vala_array_free (_tmp64_, _tmp64__length1, (GDestroyNotify) g_variant_unref), NULL);
metadata = _tmp66_;
_tmp67_ = model;
_tmp68_ = fake_uri;
_tmp69_ = unity_video_lens_remote_uri_to_rawuri (_tmp68_);
_tmp70_ = _tmp69_;
_tmp71_ = result_icon;
_tmp72_ = video;
_tmp73_ = (*_tmp72_).category;
_tmp74_ = video;
_tmp75_ = (*_tmp74_).title;
_tmp76_ = video;
_tmp77_ = (*_tmp76_).comment;
_tmp78_ = video;
_tmp79_ = (*_tmp78_).uri;
_tmp80_ = metadata;
dee_model_append (_tmp67_, _tmp70_, _tmp71_, _tmp73_, UNITY_RESULT_TYPE_DEFAULT, "text/html", _tmp75_, _tmp77_, _tmp79_, _tmp80_, NULL);
_g_free0 (_tmp70_);
_g_variant_unref0 (metadata);
_g_variant_unref0 (realcat);
_g_free0 (result_icon);
_unity_video_lens_remote_uri_unref0 (fake_uri);
}
_unity_video_lens_remote_video_file_free0 (video);
}
_g_object_unref0 (_video_list);
}
}
static gpointer _g_ptr_array_ref0 (gpointer self) {
return self ? g_ptr_array_ref (self) : NULL;
}
static void unity_video_lens_remote_video_scope_zeitgeist_init (UnityVideoLensRemoteVideoScope* self, GError** error) {
ZeitgeistDataSourceRegistry* _tmp0_;
GPtrArray* _tmp1_;
GPtrArray* templates;
ZeitgeistEvent* _tmp2_;
ZeitgeistEvent* ev;
GObject* _tmp3_ = NULL;
GPtrArray* _tmp4_;
ZeitgeistDataSource* _tmp5_;
ZeitgeistDataSource* data_source;
ZeitgeistDataSourceRegistry* _tmp6_;
ZeitgeistDataSource* _tmp7_;
g_return_if_fail (self != NULL);
_tmp0_ = zeitgeist_data_source_registry_new ();
_g_object_unref0 (self->priv->zg_sources);
self->priv->zg_sources = _tmp0_;
_tmp1_ = g_ptr_array_sized_new ((guint) 1);
templates = _tmp1_;
_tmp2_ = zeitgeist_event_new_full (ZEITGEIST_ZG_ACCESS_EVENT, ZEITGEIST_ZG_USER_ACTIVITY, "lens://unity-lens-video", NULL);
g_object_ref_sink (_tmp2_);
ev = _tmp2_;
_tmp3_ = g_object_ref (G_TYPE_CHECK_INSTANCE_TYPE (ev, G_TYPE_OBJECT) ? ((GObject*) ev) : NULL);
g_ptr_array_add (templates, _tmp3_);
_tmp4_ = _g_ptr_array_ref0 (templates);
_tmp5_ = zeitgeist_data_source_new_full ("98898", "Unity Video Lens", "", _tmp4_);
g_object_ref_sink (_tmp5_);
data_source = _tmp5_;
_tmp6_ = self->priv->zg_sources;
_tmp7_ = _g_object_ref0 (data_source);
zeitgeist_data_source_registry_register_data_source (_tmp6_, _tmp7_, NULL, NULL, NULL);
_g_object_unref0 (data_source);
_g_object_unref0 (ev);
_g_ptr_array_unref0 (templates);
}
static void unity_video_lens_remote_video_scope_zeitgeist_insert_event (UnityVideoLensRemoteVideoScope* self, const gchar* uri, const gchar* title, const gchar* icon) {
const gchar* _tmp0_;
const gchar* _tmp1_;
const gchar* _tmp2_;
const gchar* _tmp3_;
ZeitgeistSubject* _tmp4_;
ZeitgeistSubject* subject;
ZeitgeistEvent* _tmp5_;
ZeitgeistEvent* event;
GPtrArray* _tmp6_;
GPtrArray* ev_array;
GObject* _tmp7_ = NULL;
ZeitgeistLog* _tmp8_ = NULL;
GPtrArray* _tmp9_;
g_return_if_fail (self != NULL);
g_return_if_fail (uri != NULL);
g_return_if_fail (title != NULL);
g_return_if_fail (icon != NULL);
_tmp0_ = uri;
_tmp1_ = uri;
_tmp2_ = title;
_tmp3_ = icon;
_tmp4_ = zeitgeist_subject_new_full (_tmp0_, ZEITGEIST_NFO_VIDEO, ZEITGEIST_NFO_REMOTE_DATA_OBJECT, "", _tmp1_, _tmp2_, _tmp3_);
g_object_ref_sink (_tmp4_);
subject = _tmp4_;
_tmp5_ = zeitgeist_event_new_full (ZEITGEIST_ZG_ACCESS_EVENT, ZEITGEIST_ZG_USER_ACTIVITY, "lens://unity-lens-video", NULL);
g_object_ref_sink (_tmp5_);
event = _tmp5_;
zeitgeist_event_add_subject (event, subject);
_tmp6_ = g_ptr_array_sized_new ((guint) 1);
ev_array = _tmp6_;
_tmp7_ = g_object_ref (G_TYPE_CHECK_INSTANCE_TYPE (event, G_TYPE_OBJECT) ? ((GObject*) event) : NULL);
g_ptr_array_add (ev_array, _tmp7_);
_tmp8_ = zeitgeist_log_get_default ();
_tmp9_ = _g_ptr_array_ref0 (ev_array);
zeitgeist_log_insert_events_from_ptrarray (_tmp8_, _tmp9_, NULL, NULL, NULL);
_g_ptr_array_unref0 (ev_array);
_g_object_unref0 (event);
_g_object_unref0 (subject);
}
static void unity_video_lens_remote_video_scope_class_init (UnityVideoLensRemoteVideoScopeClass * klass) {
gchar* _tmp0_;
gchar* _tmp1_;
unity_video_lens_remote_video_scope_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (UnityVideoLensRemoteVideoScopePrivate));
G_OBJECT_CLASS (klass)->constructed = unity_video_lens_remote_video_scope_real_constructed;
UNITY_DEPRECATED_SCOPE_CLASS (klass)->activate_result = unity_video_lens_remote_video_scope_real_activate_result;
UNITY_DEPRECATED_SCOPE_CLASS (klass)->activate_result_finish = unity_video_lens_remote_video_scope_real_activate_result_finish;
UNITY_DEPRECATED_SCOPE_CLASS (klass)->preview_result = unity_video_lens_remote_video_scope_real_preview_result;
UNITY_DEPRECATED_SCOPE_CLASS (klass)->preview_result_finish = unity_video_lens_remote_video_scope_real_preview_result_finish;
G_OBJECT_CLASS (klass)->finalize = unity_video_lens_remote_video_scope_finalize;
_tmp0_ = g_strdup ("Unknown");
unity_video_lens_remote_video_scope_IS_IN_CHINA = _tmp0_;
_tmp1_ = g_strdup ("lmb-preview");
unity_video_lens_remote_video_scope_PREVIEW_ON_LMB = _tmp1_;
}
static void unity_video_lens_remote_video_scope_instance_init (UnityVideoLensRemoteVideoScope * self) {
UnityPreferencesManager* _tmp0_ = NULL;
self->priv = UNITY_VIDEO_LENS_REMOTE_VIDEO_SCOPE_GET_PRIVATE (self);
_tmp0_ = unity_preferences_manager_get_default ();
self->priv->preferences = _tmp0_;
self->priv->recommendations_last_update = (gint64) 0;
}
static void unity_video_lens_remote_video_scope_finalize (GObject* obj) {
UnityVideoLensRemoteVideoScope * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_SCOPE, UnityVideoLensRemoteVideoScope);
_g_object_unref0 (self->priv->session);
_g_object_unref0 (self->priv->preferences);
_g_object_unref0 (self->priv->recommendations);
_g_object_unref0 (self->priv->zg_sources);
G_OBJECT_CLASS (unity_video_lens_remote_video_scope_parent_class)->finalize (obj);
}
GType unity_video_lens_remote_video_scope_get_type (void) {
static volatile gsize unity_video_lens_remote_video_scope_type_id__volatile = 0;
if (g_once_init_enter (&unity_video_lens_remote_video_scope_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (UnityVideoLensRemoteVideoScopeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_video_lens_remote_video_scope_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityVideoLensRemoteVideoScope), 0, (GInstanceInitFunc) unity_video_lens_remote_video_scope_instance_init, NULL };
GType unity_video_lens_remote_video_scope_type_id;
unity_video_lens_remote_video_scope_type_id = g_type_register_static (UNITY_TYPE_DEPRECATED_SCOPE, "UnityVideoLensRemoteVideoScope", &g_define_type_info, 0);
g_once_init_leave (&unity_video_lens_remote_video_scope_type_id__volatile, unity_video_lens_remote_video_scope_type_id);
}
return unity_video_lens_remote_video_scope_type_id__volatile;
}
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
if ((array != NULL) && (destroy_func != NULL)) {
int i;
for (i = 0; i < array_length; i = i + 1) {
if (((gpointer*) array)[i] != NULL) {
destroy_func (((gpointer*) array)[i]);
}
}
}
}
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
_vala_array_destroy (array, array_length, destroy_func);
g_free (array);
}
unity-china-video-scope/tests/unit/thumbnailer-mock.vala 000664 001750 001750 00000001516 12607616420 024277 0 ustar 00kylin kylin 000000 000000 /*
* Copyright (C) 2012 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by Pawel Stolowski
*
*/
namespace Unity.VideoLens
{
public class Thumbnailer
{
public string get_icon (string video_file)
{
return "mock-icon";
}
}
} unity-china-video-scope/.bzr/repository/pack-names 000664 001750 001750 00000000216 12607616420 023100 0 ustar 00kylin kylin 000000 000000 B+Tree Graph Index 2
node_ref_lists=0
key_elements=1
len=1
row_lengths=1
x 0j?gCa0g*i}{>9wE:aLK!)8H unity-china-video-scope/.bzr/repository/packs/ 000775 001750 001750 00000000000 12607616420 022240 5 ustar 00kylin kylin 000000 000000 unity-china-video-scope/MANIFEST.in 000664 001750 001750 00000000305 12607616420 017601 0 ustar 00kylin kylin 000000 000000 include unity-china-video-scope.service
include video.lens.in
include src/unity-china-video-scope
include unity-china-video-scope.desktop
include unity-lens-video1.png
include po/*
include COPYING
unity-china-video-scope/Makefile.decl 000664 001750 001750 00000005407 12607616420 020421 0 ustar 00kylin kylin 000000 000000 # GLIB - Library of useful C routines
#
# This file is copied almost verbatim from the GLib-2.0 distribution
#
GTESTER = gtester
GTESTER_REPORT = gtester-report
# initialize variables for unconditional += appending
EXTRA_DIST =
TEST_PROGS =
### testing rules
# test: run all tests in cwd and subdirs
test: test-nonrecursive
@ for subdir in $(SUBDIRS) . ; do \
test "$$subdir" = "." -o "$$subdir" = "po" || \
( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
done
# test-nonrecursive: run tests only in cwd
test-nonrecursive: ${TEST_PROGS}
@test -z "${TEST_PROGS}" || G_DEBUG=gc-friendly MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS}
# test-report: run tests in subdirs and generate report
# perf-report: run tests in subdirs with -m perf and generate report
# full-report: like test-report: with -m perf and -m slow
test-report perf-report full-report: ${TEST_PROGS}
@test -z "${TEST_PROGS}" || { \
case $@ in \
test-report) test_options="-k";; \
perf-report) test_options="-k -m=perf";; \
full-report) test_options="-k -m=perf -m=slow";; \
esac ; \
if test -z "$$GTESTER_LOGDIR" ; then \
${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
elif test -n "${TEST_PROGS}" ; then \
${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
fi ; \
}
@ ignore_logdir=true ; \
if test -z "$$GTESTER_LOGDIR" ; then \
GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
ignore_logdir=false ; \
fi ; \
REVISION=$(VERSION) ; \
for subdir in $(SUBDIRS) . ; do \
test "$$subdir" = "." -o "$$subdir" = "po" || \
( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
done ; \
$$ignore_logdir || { \
echo '' > $@.xml ; \
echo '' >> $@.xml ; \
echo '' >> $@.xml ; \
echo ' $(PACKAGE)' >> $@.xml ; \
echo ' $(VERSION)' >> $@.xml ; \
echo " $$REVISION" >> $@.xml ; \
echo '' >> $@.xml ; \
for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
sed '1,1s/^?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
done ; \
echo >> $@.xml ; \
echo '' >> $@.xml ; \
rm -rf "$$GTESTER_LOGDIR"/ ; \
${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
}
.PHONY: test test-report perf-report full-report test-nonrecursive
# run tests in cwd as part of make check
if ENABLE_HEADLESS_TESTS
check-local: test-headless
else
check-local: test-nonrecursive
endif
unity-china-video-scope/po/.intltool-merge-cache 000664 001750 001750 00000001143 12607616420 022465 0 ustar 00kylin kylin 000000 000000 zh_CNOnline在线zh_CNYouku videos优酷视频zh_CNUploaded on上传zh_CNMore suggestions更多建议zh_CNUploaded by更新zh_CNPlay播放zh_CNCast演员表zh_CNThis is an Ubuntu search plugin that enables information from various video providers to be searched and displayed in the Dash underneath the Video header. If you do not wish to search these content sources, you can disable this search plugin.这是一个Ubuntu搜索插件,可以从视频提供者获得各种视频信息显示在dash中。如果你不希望搜索这些内容的来源,您可以禁用这个搜索插件。 unity-china-video-scope/vapi/libsoup-gnome-2.4.vapi 000664 001750 001750 00000000647 12607616420 022755 0 ustar 00kylin kylin 000000 000000 [CCode (cprefix = "Soup", gir_namespace = "SoupGNOME", gir_version = "2.4", lower_case_cprefix = "soup_")]
namespace SoupGNOME {
[CCode (cheader_filename = "libsoup/soup-gnome.h", type_id = "soup_proxy_resolver_gnome_get_type ()")]
public class ProxyResolverGNOME : Soup.ProxyResolverDefault, Soup.ProxyURIResolver, Soup.SessionFeature {
[CCode (has_construct_function = false)]
protected ProxyResolverGNOME ();
}
}
unity-china-video-scope/src/remote-uri.c 000664 001750 001750 00000042371 12607616420 021077 0 ustar 00kylin kylin 000000 000000 /* remote-uri.c generated by valac 0.20.1, the Vala compiler
* generated from remote-uri.vala, do not modify */
/*
* Copyright (C) 2012 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by Pawel Stolowski
*/
#include
#include
#include
#include
#include
#define UNITY_VIDEO_LENS_TYPE_REMOTE_URI (unity_video_lens_remote_uri_get_type ())
#define UNITY_VIDEO_LENS_REMOTE_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_URI, UnityVideoLensRemoteUri))
#define UNITY_VIDEO_LENS_REMOTE_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_VIDEO_LENS_TYPE_REMOTE_URI, UnityVideoLensRemoteUriClass))
#define UNITY_VIDEO_LENS_IS_REMOTE_URI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_URI))
#define UNITY_VIDEO_LENS_IS_REMOTE_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_VIDEO_LENS_TYPE_REMOTE_URI))
#define UNITY_VIDEO_LENS_REMOTE_URI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_VIDEO_LENS_TYPE_REMOTE_URI, UnityVideoLensRemoteUriClass))
typedef struct _UnityVideoLensRemoteUri UnityVideoLensRemoteUri;
typedef struct _UnityVideoLensRemoteUriClass UnityVideoLensRemoteUriClass;
typedef struct _UnityVideoLensRemoteUriPrivate UnityVideoLensRemoteUriPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _unity_video_lens_remote_uri_unref0(var) ((var == NULL) ? NULL : (var = (unity_video_lens_remote_uri_unref (var), NULL)))
typedef struct _UnityVideoLensParamSpecRemoteUri UnityVideoLensParamSpecRemoteUri;
struct _UnityVideoLensRemoteUri {
GTypeInstance parent_instance;
volatile int ref_count;
UnityVideoLensRemoteUriPrivate * priv;
};
struct _UnityVideoLensRemoteUriClass {
GTypeClass parent_class;
void (*finalize) (UnityVideoLensRemoteUri *self);
};
struct _UnityVideoLensRemoteUriPrivate {
gchar* _uri;
gchar* _title;
gchar* _icon;
gchar* _details_uri;
};
struct _UnityVideoLensParamSpecRemoteUri {
GParamSpec parent_instance;
};
static gpointer unity_video_lens_remote_uri_parent_class = NULL;
gpointer unity_video_lens_remote_uri_ref (gpointer instance);
void unity_video_lens_remote_uri_unref (gpointer instance);
GParamSpec* unity_video_lens_param_spec_remote_uri (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void unity_video_lens_value_set_remote_uri (GValue* value, gpointer v_object);
void unity_video_lens_value_take_remote_uri (GValue* value, gpointer v_object);
gpointer unity_video_lens_value_get_remote_uri (const GValue* value);
GType unity_video_lens_remote_uri_get_type (void) G_GNUC_CONST;
#define UNITY_VIDEO_LENS_REMOTE_URI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_VIDEO_LENS_TYPE_REMOTE_URI, UnityVideoLensRemoteUriPrivate))
enum {
UNITY_VIDEO_LENS_REMOTE_URI_DUMMY_PROPERTY
};
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_new (const gchar* uri, const gchar* title, const gchar* icon, const gchar* details_uri);
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_construct (GType object_type, const gchar* uri, const gchar* title, const gchar* icon, const gchar* details_uri);
void unity_video_lens_remote_uri_set_uri (UnityVideoLensRemoteUri* self, const gchar* value);
void unity_video_lens_remote_uri_set_title (UnityVideoLensRemoteUri* self, const gchar* value);
void unity_video_lens_remote_uri_set_icon (UnityVideoLensRemoteUri* self, const gchar* value);
void unity_video_lens_remote_uri_set_details_uri (UnityVideoLensRemoteUri* self, const gchar* value);
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_from_rawuri (const gchar* raw_uri);
gchar* unity_video_lens_remote_uri_to_rawuri (UnityVideoLensRemoteUri* self);
const gchar* unity_video_lens_remote_uri_get_uri (UnityVideoLensRemoteUri* self);
const gchar* unity_video_lens_remote_uri_get_title (UnityVideoLensRemoteUri* self);
const gchar* unity_video_lens_remote_uri_get_icon (UnityVideoLensRemoteUri* self);
const gchar* unity_video_lens_remote_uri_get_details_uri (UnityVideoLensRemoteUri* self);
static void unity_video_lens_remote_uri_finalize (UnityVideoLensRemoteUri* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_construct (GType object_type, const gchar* uri, const gchar* title, const gchar* icon, const gchar* details_uri) {
UnityVideoLensRemoteUri* self = NULL;
const gchar* _tmp0_;
const gchar* _tmp1_;
const gchar* _tmp2_;
const gchar* _tmp3_;
g_return_val_if_fail (uri != NULL, NULL);
g_return_val_if_fail (title != NULL, NULL);
g_return_val_if_fail (icon != NULL, NULL);
g_return_val_if_fail (details_uri != NULL, NULL);
self = (UnityVideoLensRemoteUri*) g_type_create_instance (object_type);
_tmp0_ = uri;
unity_video_lens_remote_uri_set_uri (self, _tmp0_);
_tmp1_ = title;
unity_video_lens_remote_uri_set_title (self, _tmp1_);
_tmp2_ = icon;
unity_video_lens_remote_uri_set_icon (self, _tmp2_);
_tmp3_ = details_uri;
unity_video_lens_remote_uri_set_details_uri (self, _tmp3_);
return self;
}
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_new (const gchar* uri, const gchar* title, const gchar* icon, const gchar* details_uri) {
return unity_video_lens_remote_uri_construct (UNITY_VIDEO_LENS_TYPE_REMOTE_URI, uri, title, icon, details_uri);
}
UnityVideoLensRemoteUri* unity_video_lens_remote_uri_from_rawuri (const gchar* raw_uri) {
UnityVideoLensRemoteUri* result = NULL;
UnityVideoLensRemoteUri* uri;
const gchar* _tmp0_;
gchar** _tmp1_;
gchar** _tmp2_ = NULL;
gchar** args;
gint args_length1;
gint _args_size_;
gchar** _tmp3_;
gint _tmp3__length1;
g_return_val_if_fail (raw_uri != NULL, NULL);
uri = NULL;
_tmp0_ = raw_uri;
_tmp2_ = _tmp1_ = g_strsplit (_tmp0_, "lens-meta://", 4);
args = _tmp2_;
args_length1 = _vala_array_length (_tmp1_);
_args_size_ = args_length1;
_tmp3_ = args;
_tmp3__length1 = args_length1;
if (_tmp3__length1 == 4) {
gchar** _tmp4_;
gint _tmp4__length1;
const gchar* _tmp5_;
gchar** _tmp6_;
gint _tmp6__length1;
const gchar* _tmp7_;
gchar** _tmp8_;
gint _tmp8__length1;
const gchar* _tmp9_;
gchar** _tmp10_;
gint _tmp10__length1;
const gchar* _tmp11_;
UnityVideoLensRemoteUri* _tmp12_;
_tmp4_ = args;
_tmp4__length1 = args_length1;
_tmp5_ = _tmp4_[0];
_tmp6_ = args;
_tmp6__length1 = args_length1;
_tmp7_ = _tmp6_[1];
_tmp8_ = args;
_tmp8__length1 = args_length1;
_tmp9_ = _tmp8_[2];
_tmp10_ = args;
_tmp10__length1 = args_length1;
_tmp11_ = _tmp10_[3];
_tmp12_ = unity_video_lens_remote_uri_new (_tmp5_, _tmp7_, _tmp9_, _tmp11_);
_unity_video_lens_remote_uri_unref0 (uri);
uri = _tmp12_;
}
result = uri;
args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
return result;
}
gchar* unity_video_lens_remote_uri_to_rawuri (UnityVideoLensRemoteUri* self) {
gchar* result = NULL;
const gchar* _tmp0_;
const gchar* _tmp1_;
const gchar* _tmp2_;
const gchar* _tmp3_;
gchar* _tmp4_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->_uri;
_tmp1_ = self->priv->_title;
_tmp2_ = self->priv->_icon;
_tmp3_ = self->priv->_details_uri;
_tmp4_ = g_strjoin ("lens-meta://", _tmp0_, _tmp1_, _tmp2_, _tmp3_, NULL);
result = _tmp4_;
return result;
}
const gchar* unity_video_lens_remote_uri_get_uri (UnityVideoLensRemoteUri* self) {
const gchar* result;
const gchar* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->_uri;
result = _tmp0_;
return result;
}
void unity_video_lens_remote_uri_set_uri (UnityVideoLensRemoteUri* self, const gchar* value) {
const gchar* _tmp0_;
gchar* _tmp1_;
g_return_if_fail (self != NULL);
_tmp0_ = value;
_tmp1_ = g_strdup (_tmp0_);
_g_free0 (self->priv->_uri);
self->priv->_uri = _tmp1_;
}
const gchar* unity_video_lens_remote_uri_get_title (UnityVideoLensRemoteUri* self) {
const gchar* result;
const gchar* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->_title;
result = _tmp0_;
return result;
}
void unity_video_lens_remote_uri_set_title (UnityVideoLensRemoteUri* self, const gchar* value) {
const gchar* _tmp0_;
gchar* _tmp1_;
g_return_if_fail (self != NULL);
_tmp0_ = value;
_tmp1_ = g_strdup (_tmp0_);
_g_free0 (self->priv->_title);
self->priv->_title = _tmp1_;
}
const gchar* unity_video_lens_remote_uri_get_icon (UnityVideoLensRemoteUri* self) {
const gchar* result;
const gchar* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->_icon;
result = _tmp0_;
return result;
}
void unity_video_lens_remote_uri_set_icon (UnityVideoLensRemoteUri* self, const gchar* value) {
const gchar* _tmp0_;
gchar* _tmp1_;
g_return_if_fail (self != NULL);
_tmp0_ = value;
_tmp1_ = g_strdup (_tmp0_);
_g_free0 (self->priv->_icon);
self->priv->_icon = _tmp1_;
}
const gchar* unity_video_lens_remote_uri_get_details_uri (UnityVideoLensRemoteUri* self) {
const gchar* result;
const gchar* _tmp0_;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = self->priv->_details_uri;
result = _tmp0_;
return result;
}
void unity_video_lens_remote_uri_set_details_uri (UnityVideoLensRemoteUri* self, const gchar* value) {
const gchar* _tmp0_;
gchar* _tmp1_;
g_return_if_fail (self != NULL);
_tmp0_ = value;
_tmp1_ = g_strdup (_tmp0_);
_g_free0 (self->priv->_details_uri);
self->priv->_details_uri = _tmp1_;
}
static void unity_video_lens_value_remote_uri_init (GValue* value) {
value->data[0].v_pointer = NULL;
}
static void unity_video_lens_value_remote_uri_free_value (GValue* value) {
if (value->data[0].v_pointer) {
unity_video_lens_remote_uri_unref (value->data[0].v_pointer);
}
}
static void unity_video_lens_value_remote_uri_copy_value (const GValue* src_value, GValue* dest_value) {
if (src_value->data[0].v_pointer) {
dest_value->data[0].v_pointer = unity_video_lens_remote_uri_ref (src_value->data[0].v_pointer);
} else {
dest_value->data[0].v_pointer = NULL;
}
}
static gpointer unity_video_lens_value_remote_uri_peek_pointer (const GValue* value) {
return value->data[0].v_pointer;
}
static gchar* unity_video_lens_value_remote_uri_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
if (collect_values[0].v_pointer) {
UnityVideoLensRemoteUri* object;
object = collect_values[0].v_pointer;
if (object->parent_instance.g_class == NULL) {
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
}
value->data[0].v_pointer = unity_video_lens_remote_uri_ref (object);
} else {
value->data[0].v_pointer = NULL;
}
return NULL;
}
static gchar* unity_video_lens_value_remote_uri_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
UnityVideoLensRemoteUri** object_p;
object_p = collect_values[0].v_pointer;
if (!object_p) {
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
}
if (!value->data[0].v_pointer) {
*object_p = NULL;
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
*object_p = value->data[0].v_pointer;
} else {
*object_p = unity_video_lens_remote_uri_ref (value->data[0].v_pointer);
}
return NULL;
}
GParamSpec* unity_video_lens_param_spec_remote_uri (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
UnityVideoLensParamSpecRemoteUri* spec;
g_return_val_if_fail (g_type_is_a (object_type, UNITY_VIDEO_LENS_TYPE_REMOTE_URI), NULL);
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
G_PARAM_SPEC (spec)->value_type = object_type;
return G_PARAM_SPEC (spec);
}
gpointer unity_video_lens_value_get_remote_uri (const GValue* value) {
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_VIDEO_LENS_TYPE_REMOTE_URI), NULL);
return value->data[0].v_pointer;
}
void unity_video_lens_value_set_remote_uri (GValue* value, gpointer v_object) {
UnityVideoLensRemoteUri* old;
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_VIDEO_LENS_TYPE_REMOTE_URI));
old = value->data[0].v_pointer;
if (v_object) {
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_VIDEO_LENS_TYPE_REMOTE_URI));
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
value->data[0].v_pointer = v_object;
unity_video_lens_remote_uri_ref (value->data[0].v_pointer);
} else {
value->data[0].v_pointer = NULL;
}
if (old) {
unity_video_lens_remote_uri_unref (old);
}
}
void unity_video_lens_value_take_remote_uri (GValue* value, gpointer v_object) {
UnityVideoLensRemoteUri* old;
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, UNITY_VIDEO_LENS_TYPE_REMOTE_URI));
old = value->data[0].v_pointer;
if (v_object) {
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, UNITY_VIDEO_LENS_TYPE_REMOTE_URI));
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
value->data[0].v_pointer = v_object;
} else {
value->data[0].v_pointer = NULL;
}
if (old) {
unity_video_lens_remote_uri_unref (old);
}
}
static void unity_video_lens_remote_uri_class_init (UnityVideoLensRemoteUriClass * klass) {
unity_video_lens_remote_uri_parent_class = g_type_class_peek_parent (klass);
UNITY_VIDEO_LENS_REMOTE_URI_CLASS (klass)->finalize = unity_video_lens_remote_uri_finalize;
g_type_class_add_private (klass, sizeof (UnityVideoLensRemoteUriPrivate));
}
static void unity_video_lens_remote_uri_instance_init (UnityVideoLensRemoteUri * self) {
self->priv = UNITY_VIDEO_LENS_REMOTE_URI_GET_PRIVATE (self);
self->ref_count = 1;
}
static void unity_video_lens_remote_uri_finalize (UnityVideoLensRemoteUri* obj) {
UnityVideoLensRemoteUri * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, UNITY_VIDEO_LENS_TYPE_REMOTE_URI, UnityVideoLensRemoteUri);
_g_free0 (self->priv->_uri);
_g_free0 (self->priv->_title);
_g_free0 (self->priv->_icon);
_g_free0 (self->priv->_details_uri);
}
GType unity_video_lens_remote_uri_get_type (void) {
static volatile gsize unity_video_lens_remote_uri_type_id__volatile = 0;
if (g_once_init_enter (&unity_video_lens_remote_uri_type_id__volatile)) {
static const GTypeValueTable g_define_type_value_table = { unity_video_lens_value_remote_uri_init, unity_video_lens_value_remote_uri_free_value, unity_video_lens_value_remote_uri_copy_value, unity_video_lens_value_remote_uri_peek_pointer, "p", unity_video_lens_value_remote_uri_collect_value, "p", unity_video_lens_value_remote_uri_lcopy_value };
static const GTypeInfo g_define_type_info = { sizeof (UnityVideoLensRemoteUriClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_video_lens_remote_uri_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityVideoLensRemoteUri), 0, (GInstanceInitFunc) unity_video_lens_remote_uri_instance_init, &g_define_type_value_table };
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
GType unity_video_lens_remote_uri_type_id;
unity_video_lens_remote_uri_type_id = g_type_register_fundamental (g_type_fundamental_next (), "UnityVideoLensRemoteUri", &g_define_type_info, &g_define_type_fundamental_info, 0);
g_once_init_leave (&unity_video_lens_remote_uri_type_id__volatile, unity_video_lens_remote_uri_type_id);
}
return unity_video_lens_remote_uri_type_id__volatile;
}
gpointer unity_video_lens_remote_uri_ref (gpointer instance) {
UnityVideoLensRemoteUri* self;
self = instance;
g_atomic_int_inc (&self->ref_count);
return instance;
}
void unity_video_lens_remote_uri_unref (gpointer instance) {
UnityVideoLensRemoteUri* self;
self = instance;
if (g_atomic_int_dec_and_test (&self->ref_count)) {
UNITY_VIDEO_LENS_REMOTE_URI_GET_CLASS (self)->finalize (self);
g_type_free_instance ((GTypeInstance *) self);
}
}
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
if ((array != NULL) && (destroy_func != NULL)) {
int i;
for (i = 0; i < array_length; i = i + 1) {
if (((gpointer*) array)[i] != NULL) {
destroy_func (((gpointer*) array)[i]);
}
}
}
}
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
_vala_array_destroy (array, array_length, destroy_func);
g_free (array);
}
static gint _vala_array_length (gpointer array) {
int length;
length = 0;
if (array) {
while (((gpointer*) array)[length]) {
length++;
}
}
return length;
}
unity-china-video-scope/.bzr/repository/indices/2422833eb61cb6fc21677a014bae1b9f.cix 000664 001750 001750 00000000616 12607616417 027633 0 ustar 00kylin kylin 000000 000000 B+Tree Graph Index 2
node_ref_lists=0
key_elements=1
len=9
row_lengths=1
x]=n1a> 9IH"@#7fճ|??wA6Zf#)*blV&A/Bq*(R5,v%L@< ,Pz&S
uX<