unity-china-video-scope/.bzr/repository/upload/000775 001750 001750 00000000000 12607616420 022423 5ustar00kylinkylin000000 000000 unity-china-video-scope/src/youku-video-search.vala000664 001750 001750 00000017514 12607616420 023234 0ustar00kylinkylin000000 000000 /* * 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_search_uri function , building search condition. * 2. Reimplement the process_search_results function, get the information of 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 * */ namespace Unity.VideoLens.UbuntuVideoSearch { private static const string SERVER = "http://www.soku.com/search_video/"; public static string sources_uri () { return SERVER; } public static string recommendations_uri () { return SERVER + "/search?q=&sources=Amazon"; } public static string build_search_uri (string query, Gee.ArrayList? sources) { var uri = new StringBuilder (); uri.append (SERVER); uri.append ("q_"); uri.append (Uri.escape_string (query, "", false)); if (sources != null && sources.size>0) { uri.append ("&sources="); uri.append (sources[0]); for (int i=1; i? process_search_results (string json_data, bool is_treat_yourself) throws Error { var videos = new Gee.ArrayList (); var video = RemoteVideoFile (); string content = json_data; var iIndex = content.index_of("
lilist = new List (); var liIndex = content.index_of("
{ 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 5ustar00kylinkylin000000 000000 unity-china-video-scope/README000664 001750 001750 00000000202 12607616420 016717 0ustar00kylinkylin000000 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.log000664 001750 001750 00000000000 12607616420 017545 0ustar00kylinkylin000000 000000 unity-china-video-scope/src/video-file.c000664 001750 001750 00000033112 12607616420 021023 0ustar00kylinkylin000000 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.pot000664 001750 001750 00000003231 12607616420 023651 0ustar00kylinkylin000000 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.coverage000664 001750 001750 00000002505 12607616420 021675 0ustar00kylinkylin000000 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 5ustar00kylinkylin000000 000000 unity-china-video-scope/tests/unit/data/video3.mpg000664 001750 001750 00000000000 12607616420 022763 0ustar00kylinkylin000000 000000 unity-china-video-scope/po/zh_CN.po000664 001750 001750 00000004113 12607616420 020023 0ustar00kylinkylin000000 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_series000664 001750 001750 00000000007 12607616420 021233 0ustar00kylinkylin000000 000000 series unity-china-video-scope/tests/000775 001750 001750 00000000000 12607616420 017207 5ustar00kylinkylin000000 000000 unity-china-video-scope/tests/unit/data/000775 001750 001750 00000000000 12607616420 021077 5ustar00kylinkylin000000 000000 unity-china-video-scope/src/Makefile.am000664 001750 001750 00000003250 12607616420 020670 0ustar00kylinkylin000000 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.am000664 001750 001750 00000001056 12607616420 021014 0ustar00kylinkylin000000 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/LINGUAS000664 001750 001750 00000000006 12607616420 017504 0ustar00kylinkylin000000 000000 zh_CN unity-china-video-scope/000775 001750 001750 00000000000 12607616700 016046 5ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/repository/000775 001750 001750 00000000000 12607616420 021137 5ustar00kylinkylin000000 000000 unity-china-video-scope/tests/manual/000775 001750 001750 00000000000 12607616420 020464 5ustar00kylinkylin000000 000000 unity-china-video-scope/src/remote-scope.c000664 001750 001750 00000375063 12607616420 021420 0ustar00kylinkylin000000 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.vala000664 001750 001750 00000001516 12607616420 024277 0ustar00kylinkylin000000 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-names000664 001750 001750 00000000216 12607616420 023100 0ustar00kylinkylin000000 000000 B+Tree Graph Index 2 node_ref_lists=0 key_elements=1 len=1 row_lengths=1 x 0j?gCa0g*i}{>9wE:aLK!)8Hunity-china-video-scope/.bzr/repository/packs/000775 001750 001750 00000000000 12607616420 022240 5ustar00kylinkylin000000 000000 unity-china-video-scope/MANIFEST.in000664 001750 001750 00000000305 12607616420 017601 0ustar00kylinkylin000000 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.decl000664 001750 001750 00000005407 12607616420 020421 0ustar00kylinkylin000000 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-cache000664 001750 001750 00000001143 12607616420 022465 0ustar00kylinkylin000000 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.vapi000664 001750 001750 00000000647 12607616420 022755 0ustar00kylinkylin000000 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.c000664 001750 001750 00000042371 12607616420 021077 0ustar00kylinkylin000000 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.cix000664 001750 001750 00000000616 12607616417 027633 0ustar00kylinkylin000000 000000 B+Tree Graph Index 2 node_ref_lists=0 key_elements=1 len=9 row_lengths=1 x]=n1 a>9 IH"@#7fճ|??wA6Zf#)*blV&A/Bq*(R5,v%L@< ,Pz&S uX<. * * Authored by Pawel Stolowski * */ namespace Unity.VideoLens { public static int main (string[] args) { /* Sort up locale to get translations but also sorting and * punctuation right */ GLib.Intl.textdomain (Config.PACKAGE); GLib.Intl.bindtextdomain (Config.PACKAGE, Config.LOCALEDIR); GLib.Intl.bind_textdomain_codeset (Config.PACKAGE, "UTF-8"); GLib.Intl.setlocale(GLib.LocaleCategory.ALL, ""); Test.init (ref args); Test.add_data_func ("/UbuntuVideoSearch/ProcessSourcesResults", test_process_sources_results); Test.add_data_func ("/UbuntuVideoSearch/ProcessInvalidSourcesResults", test_process_invalid_sources_results); Test.add_data_func ("/UbuntuVideoSearch/BuildSearchUri", test_build_search_uri); Test.add_data_func ("/UbuntuVideoSearch/ProcessInvalidSearchResultsJson", test_invalid_search_results_json); Test.add_data_func ("/UbuntuVideoSearch/ProcessSearchResults", test_process_search_results); Test.add_data_func ("/UbuntuVideoSearch/ProcessSearchResultsTreatYourself", test_process_search_no_split_ty_category); Test.add_data_func ("/UbuntuVideoSearch/ProcessSearchResultsOnline", test_process_search_no_split_online_category); Test.add_data_func ("/UbuntuVideoSearch/JoinArray", test_join_array); Test.add_data_func ("/UbuntuVideoSearch/ProcessInvalidDetailsResults", test_process_invalid_details_results); Test.add_data_func ("/UbuntuVideoSearch/ProcessDetailsResults", test_process_details_results); Test.run (); return 0; } internal static void test_process_sources_results () { assert (UbuntuVideoSearch.process_sources_results ("[]").size == 0); var sources = UbuntuVideoSearch.process_sources_results ("[\"Foo\", \"Bar\"]"); assert (sources.size == 2); assert (sources[0] == "Foo"); assert (sources[1] == "Bar"); } internal static void test_process_invalid_sources_results () { bool got_excp = false; try { UbuntuVideoSearch.process_sources_results (";"); } catch (Error e) { got_excp = true; } assert (got_excp == true); } internal static void test_build_search_uri () { // test null sources assert (UbuntuVideoSearch.build_search_uri ("foo", null) == "http://videosearch.ubuntu.com/v0/search?q=foo&split=true"); // test empty sources list var sources = new Gee.ArrayList (null); assert (UbuntuVideoSearch.build_search_uri ("foo", sources) == "http://videosearch.ubuntu.com/v0/search?q=foo&split=true"); // test non-empty sources and uri escaping sources.add ("Amazon"); sources.add ("BBC"); assert (UbuntuVideoSearch.build_search_uri ("foo!", sources) == "http://videosearch.ubuntu.com/v0/search?q=foo%21&split=true&sources=Amazon,BBC"); } internal static void test_invalid_search_results_json () { // ignore warnings Test.log_set_fatal_handler (() => { return false; }); bool got_excp = false; try { UbuntuVideoSearch.process_search_results (",", false); } catch (Error e) { got_excp = true; } assert (got_excp == true); } /** * Test search results of search query with 'split=true' flag, resulting in search results * being placed in CAT_INDEX_MORE (if from 'treats' results group) and CAT_INDEX_ONLINE category (if from 'other' group). */ internal static void test_process_search_results () { string datadir = Config.TESTDATADIR; uint8[] contents; assert (File.new_for_path (@"$datadir/videosearch_input1.txt").load_contents (null, out contents, null) == true); var results = UbuntuVideoSearch.process_search_results ((string)contents, false); assert (results.size == 5); bool got_video[5] = {false, false, false, false, false}; // verify that all expected records are there foreach (var res in results) { if (res.title == "title0") { got_video[0] = true; assert (res.comment == "source0"); assert (res.uri == "http://url0"); assert (res.icon == "http://image0"); assert (res.details_uri == ""); assert (res.price == null); assert (res.category == CAT_INDEX_ONLINE); } else if (res.title == "title1") { got_video[1] = true; assert (res.comment == "source1"); assert (res.uri == "http://url1"); assert (res.icon == "http://image1"); assert (res.details_uri == "http://details1"); assert (res.price == null); assert (res.category == CAT_INDEX_ONLINE); } else if (res.title == "title2") { got_video[2] = true; assert (res.comment == "source2"); assert (res.uri == "http://url2"); assert (res.icon == "http://image2"); assert (res.details_uri == "http://details2"); assert (res.price == "1 USD"); assert (res.category == CAT_INDEX_MORE); } else if (res.title == "title3") { got_video[3] = true; assert (res.comment == "source3"); assert (res.uri == "http://url3"); assert (res.icon == "http://image3"); assert (res.details_uri == "http://details3"); assert (res.price == _("Free")); assert (res.category == CAT_INDEX_MORE); } else if (res.title == "title4") { got_video[4] = true; assert (res.comment == "source4"); assert (res.uri == "http://url4"); assert (res.icon == "http://image4"); assert (res.details_uri == "http://details4"); assert (res.price == _("Free")); // null price of video4 turned into 'free' for 'Treat yourself category' assert (res.category == CAT_INDEX_MORE); } else { assert (1 == 0); // this shouldn't happen } } assert (got_video[0] == true); assert (got_video[1] == true); assert (got_video[2] == true); assert (got_video[3] == true); assert (got_video[4] == true); } /** * Test search results of search query with no 'split' option and is_treat_yourself=true, resulting in all search results * being placed in CAT_INDEX_MORE category. */ internal static void test_process_search_no_split_ty_category () { string datadir = Config.TESTDATADIR; uint8[] contents; assert (File.new_for_path (@"$datadir/videosearch_input2.txt").load_contents (null, out contents, null) == true); var results = UbuntuVideoSearch.process_search_results ((string)contents, /* is_treat_yourself */ true); assert (results.size == 2); bool got_video[2] = {false, false}; // verify that all expected records are there foreach (var res in results) { if (res.title == "title0") { got_video[0] = true; assert (res.comment == "source0"); assert (res.uri == "http://url0"); assert (res.icon == "http://image0"); assert (res.details_uri == ""); assert (res.price == _("Free")); assert (res.category == CAT_INDEX_MORE); } else if (res.title == "title1") { got_video[1] = true; assert (res.comment == "source1"); assert (res.uri == "http://url1"); assert (res.icon == "http://image1"); assert (res.details_uri == "http://details1"); assert (res.price == "1 USD"); assert (res.category == CAT_INDEX_MORE); } else { assert (1 == 0); // this shouldn't happen } } assert (got_video[0] == true); assert (got_video[1] == true); } /** * Test search results of search query with no 'split' option and is_treat_yourself=false, resulting in all search results * being placed in CAT_INDEX_ONLINE */ internal static void test_process_search_no_split_online_category () { string datadir = Config.TESTDATADIR; uint8[] contents; assert (File.new_for_path (@"$datadir/videosearch_input2.txt").load_contents (null, out contents, null) == true); var results = UbuntuVideoSearch.process_search_results ((string)contents, /* is_treat_yourself */ false); assert (results.size == 2); bool got_video[2] = {false, false}; // verify that all expected records are there foreach (var res in results) { if (res.title == "title0") { got_video[0] = true; assert (res.comment == "source0"); assert (res.uri == "http://url0"); assert (res.icon == "http://image0"); assert (res.details_uri == ""); assert (res.price == null); assert (res.category == CAT_INDEX_ONLINE); } else if (res.title == "title1") { got_video[1] = true; assert (res.comment == "source1"); assert (res.uri == "http://url1"); assert (res.icon == "http://image1"); assert (res.details_uri == "http://details1"); assert (res.price == null); assert (res.category == CAT_INDEX_ONLINE); } else { assert (1 == 0); // this shouldn't happen } } assert (got_video[0] == true); assert (got_video[1] == true); } internal static void test_join_array () { var array = new Json.Array (); array.add_string_element ("abc"); array.add_string_element ("def"); assert (UbuntuVideoSearch.join_array (array, ", ") == "abc, def"); } internal static void test_process_invalid_details_results () { bool got_excp = false; try { UbuntuVideoSearch.process_details_results (","); } catch (Error e) { got_excp = true; } assert (got_excp == true); } internal static void test_process_details_results () { string datadir = Config.TESTDATADIR; uint8[] contents; assert (File.new_for_path (@"$datadir/videosearch_details1.txt").load_contents (null, out contents, null) == true); var video = UbuntuVideoSearch.process_details_results ((string)contents); assert (video.title == "title1"); assert (video.description == "a movie"); assert (video.image == "http://image1"); assert (video.directors.length == 2); assert (video.directors[0] == "director1"); assert (video.directors[1] == "director2"); assert (video.duration == 91); assert (video.genres.length == 2); assert (video.genres[0] == "genre1"); assert (video.genres[1] == "genre2"); assert (video.starring == "star1, star2"); assert (video.source == "source1"); assert (video.release_date == "2010"); assert (video.uploaded_by == "uploader1"); assert (video.price == "$1"); assert (video.date_uploaded == "2012-06-06T21:55:12.000Z"); } } unity-china-video-scope/src/remote-video-main.vala000664 001750 001750 00000003315 12607616420 023024 0ustar00kylinkylin000000 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 . */ using GLib; using Config; namespace Unity.VideoLens { static const string BUS_NAME = "net.launchpad.scope.YoukuVideos"; Unity.DeprecatedScope scope; static Application? app = null; public static int main (string[] args) { GLib.Environment.set_prgname ("unity-remote-video-scope"); /* Sort up locale to get translations but also sorting and * punctuation right */ GLib.Intl.textdomain (Config.PACKAGE); GLib.Intl.bindtextdomain (Config.PACKAGE, Config.LOCALEDIR); GLib.Intl.bind_textdomain_codeset (Config.PACKAGE, "UTF-8"); GLib.Intl.setlocale(GLib.LocaleCategory.ALL, ""); try { app = Extras.dbus_own_name (BUS_NAME, () => { scope = new RemoteVideoScope (); scope.export (); }); } catch (Error e) { warning ("Failed to start video lens daemon: %s\n", e.message); return 1; } if (app == null) { warning ("Another instance of the Unity Videos Lens " + "already appears to be running.\nBailing out.\n"); return 2; } return app.run (); } } /* namespace */ unity-china-video-scope/.pc/.version000664 001750 001750 00000000002 12607616420 020203 0ustar00kylinkylin000000 000000 2 unity-china-video-scope/tests/unit/data/video2.mpg000664 001750 001750 00000000000 12607616420 022762 0ustar00kylinkylin000000 000000 unity-china-video-scope/.pc/.quilt_patches000664 001750 001750 00000000017 12607616420 021371 0ustar00kylinkylin000000 000000 debian/patches unity-china-video-scope/src/video-file.vala000664 001750 001750 00000002514 12607616420 021526 0ustar00kylinkylin000000 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 struct VideoFile { string title; string lc_title; string comment; string uri; string icon; int category; } public struct RemoteVideoFile { string title; string comment; string uri; string icon; string details_uri; string price; int category; } public struct RemoteVideoDetails { string title; string description; string uri; string image; string source; string release_date; int duration; string[] directors; string starring; string[] genres; string uploaded_by; string date_uploaded; string price; } }unity-china-video-scope/src/youku-video-search.c000664 001750 001750 00000106174 12607616420 022534 0ustar00kylinkylin000000 000000 /* youku-video-search.c generated by valac 0.20.1, the Vala compiler * generated from youku-video-search.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_search_uri function , building search condition. * 2. Reimplement the process_search_results function, get the information of 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 * */ #include #include #include #include #include #include #include #define _g_free0(var) (var = (g_free (var), NULL)) #define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL))) #define UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_FILE (unity_video_lens_remote_video_file_get_type ()) typedef struct _UnityVideoLensRemoteVideoFile UnityVideoLensRemoteVideoFile; #define __g_list_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_free0_ (var), NULL))) #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) typedef struct _Block3Data Block3Data; typedef struct _Block4Data Block4Data; #define UNITY_VIDEO_LENS_TYPE_REMOTE_VIDEO_DETAILS (unity_video_lens_remote_video_details_get_type ()) typedef struct _UnityVideoLensRemoteVideoDetails UnityVideoLensRemoteVideoDetails; #define __vala_JsonArray_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonArray_free (var), NULL))) #define __vala_JsonObject_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonObject_free (var), NULL))) typedef struct _Block5Data Block5Data; struct _UnityVideoLensRemoteVideoFile { gchar* title; gchar* comment; gchar* uri; gchar* icon; gchar* details_uri; gchar* price; gint category; }; struct _Block3Data { int _ref_count_; GString* res; guint len; gchar* separator; }; struct _Block4Data { int _ref_count_; gchar** res; gint res_length1; gint _res_size_; }; 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 _Block5Data { int _ref_count_; GeeArrayList* results; }; #define UNITY_VIDEO_LENS_UBUNTU_VIDEO_SEARCH_SERVER "http://www.soku.com/search_video/" gchar* unity_video_lens_ubuntu_video_search_sources_uri (void); gchar* unity_video_lens_ubuntu_video_search_recommendations_uri (void); gchar* unity_video_lens_ubuntu_video_search_build_search_uri (const gchar* query, GeeArrayList* sources); 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); GeeArrayList* unity_video_lens_ubuntu_video_search_process_search_results (const gchar* json_data, gboolean is_treat_yourself, GError** error); static void _g_free0_ (gpointer var); static void _g_list_free__g_free0_ (GList* self); gchar* unity_video_lens_ubuntu_video_search_join_array (JsonArray* array, const gchar* separator); static Block3Data* block3_data_ref (Block3Data* _data3_); static void block3_data_unref (void * _userdata_); static void __lambda13_ (Block3Data* _data3_, JsonArray* a, guint index, JsonNode* node); static void ___lambda13__json_array_foreach (JsonArray* array, guint index_, JsonNode* element_node, gpointer self); gchar** unity_video_lens_ubuntu_video_search_json_array_to_str_array (JsonArray* array, int* result_length1); static Block4Data* block4_data_ref (Block4Data* _data4_); static void block4_data_unref (void * _userdata_); static void __lambda12_ (Block4Data* _data4_, JsonArray* a, guint index, JsonNode* node); static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value); static void ___lambda12__json_array_foreach (JsonArray* array, guint index_, JsonNode* element_node, gpointer self); static gchar** _vala_array_dup1 (gchar** self, int length); 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); void unity_video_lens_ubuntu_video_search_process_details_results (const gchar* json_data, UnityVideoLensRemoteVideoDetails* result, GError** error); static JsonObject* _vala_JsonObject_copy (JsonObject* self); static JsonArray* _vala_JsonArray_copy (JsonArray* self); static void _vala_JsonArray_free (JsonArray* self); static void _vala_JsonObject_free (JsonObject* self); GeeArrayList* unity_video_lens_ubuntu_video_search_process_sources_results (const gchar* json_data, GError** error); static Block5Data* block5_data_ref (Block5Data* _data5_); static void block5_data_unref (void * _userdata_); static void __lambda8_ (Block5Data* _data5_, JsonArray* array, guint index, JsonNode* node); static void ___lambda8__json_array_foreach (JsonArray* array, guint index_, JsonNode* element_node, gpointer self); 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); gchar* unity_video_lens_ubuntu_video_search_sources_uri (void) { gchar* result = NULL; gchar* _tmp0_; _tmp0_ = g_strdup (UNITY_VIDEO_LENS_UBUNTU_VIDEO_SEARCH_SERVER); result = _tmp0_; return result; } gchar* unity_video_lens_ubuntu_video_search_recommendations_uri (void) { gchar* result = NULL; gchar* _tmp0_; _tmp0_ = g_strdup (UNITY_VIDEO_LENS_UBUNTU_VIDEO_SEARCH_SERVER "/search?q=&sources=Amazon"); result = _tmp0_; return result; } gchar* unity_video_lens_ubuntu_video_search_build_search_uri (const gchar* query, GeeArrayList* sources) { gchar* result = NULL; GString* _tmp0_; GString* uri; GString* _tmp1_; GString* _tmp2_; GString* _tmp3_; const gchar* _tmp4_; gchar* _tmp5_ = NULL; gchar* _tmp6_; gboolean _tmp7_ = FALSE; GeeArrayList* _tmp8_; gboolean _tmp12_; GString* _tmp31_; const gchar* _tmp32_; gchar* _tmp33_; g_return_val_if_fail (query != NULL, NULL); _tmp0_ = g_string_new (""); uri = _tmp0_; _tmp1_ = uri; g_string_append (_tmp1_, UNITY_VIDEO_LENS_UBUNTU_VIDEO_SEARCH_SERVER); _tmp2_ = uri; g_string_append (_tmp2_, "q_"); _tmp3_ = uri; _tmp4_ = query; _tmp5_ = g_uri_escape_string (_tmp4_, "", FALSE); _tmp6_ = _tmp5_; g_string_append (_tmp3_, _tmp6_); _g_free0 (_tmp6_); _tmp8_ = sources; if (_tmp8_ != NULL) { GeeArrayList* _tmp9_; gint _tmp10_; gint _tmp11_; _tmp9_ = sources; _tmp10_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp9_); _tmp11_ = _tmp10_; _tmp7_ = _tmp11_ > 0; } else { _tmp7_ = FALSE; } _tmp12_ = _tmp7_; if (_tmp12_) { GString* _tmp13_; GString* _tmp14_; GeeArrayList* _tmp15_; gpointer _tmp16_ = NULL; gchar* _tmp17_; _tmp13_ = uri; g_string_append (_tmp13_, "&sources="); _tmp14_ = uri; _tmp15_ = sources; _tmp16_ = gee_abstract_list_get ((GeeAbstractList*) _tmp15_, 0); _tmp17_ = (gchar*) _tmp16_; g_string_append (_tmp14_, _tmp17_); _g_free0 (_tmp17_); { gint i; i = 1; { gboolean _tmp18_; _tmp18_ = TRUE; while (TRUE) { gboolean _tmp19_; gint _tmp21_; GeeArrayList* _tmp22_; gint _tmp23_; gint _tmp24_; GString* _tmp25_; GString* _tmp26_; GeeArrayList* _tmp27_; gint _tmp28_; gpointer _tmp29_ = NULL; gchar* _tmp30_; _tmp19_ = _tmp18_; if (!_tmp19_) { gint _tmp20_; _tmp20_ = i; i = _tmp20_ + 1; } _tmp18_ = FALSE; _tmp21_ = i; _tmp22_ = sources; _tmp23_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp22_); _tmp24_ = _tmp23_; if (!(_tmp21_ < _tmp24_)) { break; } _tmp25_ = uri; g_string_append (_tmp25_, ","); _tmp26_ = uri; _tmp27_ = sources; _tmp28_ = i; _tmp29_ = gee_abstract_list_get ((GeeAbstractList*) _tmp27_, _tmp28_); _tmp30_ = (gchar*) _tmp29_; g_string_append (_tmp26_, _tmp30_); _g_free0 (_tmp30_); } } } } _tmp31_ = uri; _tmp32_ = _tmp31_->str; _tmp33_ = g_strdup (_tmp32_); result = _tmp33_; _g_string_free0 (uri); return result; } /** * Parses JSON data returned by search requests, returns list of videos. */ 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 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 void _g_free0_ (gpointer var) { var = (g_free (var), NULL); } static void _g_list_free__g_free0_ (GList* self) { g_list_foreach (self, (GFunc) _g_free0_, NULL); g_list_free (self); } GeeArrayList* unity_video_lens_ubuntu_video_search_process_search_results (const gchar* json_data, gboolean is_treat_yourself, GError** error) { GeeArrayList* result = NULL; GeeArrayList* _tmp0_; GeeArrayList* videos; UnityVideoLensRemoteVideoFile video = {0}; const gchar* _tmp1_; gchar* _tmp2_; gchar* content; const gchar* _tmp3_; gint _tmp4_ = 0; gint iIndex; const gchar* _tmp5_; gint _tmp6_ = 0; gint iEnd; const gchar* _tmp7_; gint _tmp8_; gint _tmp9_; gint _tmp10_; gchar* _tmp11_ = NULL; GList* lilist; const gchar* _tmp12_; gint _tmp13_ = 0; gint liIndex; GList* _tmp23_; g_return_val_if_fail (json_data != NULL, NULL); _tmp0_ = 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); videos = _tmp0_; memset (&video, 0, sizeof (UnityVideoLensRemoteVideoFile)); _tmp1_ = json_data; _tmp2_ = g_strdup (_tmp1_); content = _tmp2_; _tmp3_ = content; _tmp4_ = string_index_of (_tmp3_, "
next) { gchar* _tmp24_; gchar* li = NULL; _tmp24_ = g_strdup ((const gchar*) li_it->data); li = _tmp24_; { const gchar* _tmp25_; gint _tmp26_ = 0; const gchar* _tmp27_; gint _tmp28_; gchar* _tmp29_ = NULL; gchar* _tmp30_; gint _tmp31_ = 0; const gchar* _tmp32_; gint _tmp33_; gint _tmp34_; gchar* _tmp35_ = NULL; const gchar* _tmp36_; gint _tmp37_ = 0; const gchar* _tmp38_; gint _tmp39_; gchar* _tmp40_ = NULL; gchar* _tmp41_; gint _tmp42_ = 0; const gchar* _tmp43_; gint _tmp44_; gint _tmp45_; gchar* _tmp46_ = NULL; const gchar* _tmp47_; gint _tmp48_ = 0; const gchar* _tmp49_; gint _tmp50_; gchar* _tmp51_ = NULL; const gchar* _tmp52_; gint _tmp53_ = 0; const gchar* _tmp54_; gint _tmp55_; gchar* _tmp56_ = NULL; gchar* _tmp57_; gint _tmp58_ = 0; const gchar* _tmp59_; gint _tmp60_; gint _tmp61_; gchar* _tmp62_ = NULL; const gchar* _tmp63_; gint _tmp64_ = 0; const gchar* _tmp65_; gint _tmp66_; gchar* _tmp67_ = NULL; gchar* _tmp68_; gint _tmp69_ = 0; const gchar* _tmp70_; gint _tmp71_; gint _tmp72_; gchar* _tmp73_ = NULL; GeeArrayList* _tmp74_; UnityVideoLensRemoteVideoFile _tmp75_; _tmp25_ = li; _tmp26_ = string_index_of (_tmp25_, "href=\"http://v.youku.com/v_show/id_", 0); iIndex = _tmp26_; _tmp27_ = li; _tmp28_ = iIndex; _tmp29_ = string_substring (_tmp27_, (glong) _tmp28_, (glong) (-1)); _tmp30_ = _tmp29_; _tmp31_ = string_index_of (_tmp30_, "\" ", 0); iEnd = _tmp31_; _g_free0 (_tmp30_); _tmp32_ = li; _tmp33_ = iIndex; _tmp34_ = iEnd; _tmp35_ = string_substring (_tmp32_, (glong) (_tmp33_ + 6), (glong) (_tmp34_ - 6)); _g_free0 (video.uri); video.uri = _tmp35_; _tmp36_ = li; _tmp37_ = string_index_of (_tmp36_, "_ref_count_); return _data3_; } static void block3_data_unref (void * _userdata_) { Block3Data* _data3_; _data3_ = (Block3Data*) _userdata_; if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) { _g_string_free0 (_data3_->res); _g_free0 (_data3_->separator); g_slice_free (Block3Data, _data3_); } } static void __lambda13_ (Block3Data* _data3_, JsonArray* a, guint index, JsonNode* node) { JsonNode* _tmp0_; const gchar* _tmp1_ = NULL; guint _tmp2_; g_return_if_fail (a != NULL); g_return_if_fail (node != NULL); _tmp0_ = node; _tmp1_ = json_node_get_string (_tmp0_); g_string_append (_data3_->res, _tmp1_); _tmp2_ = index; if (_tmp2_ < (_data3_->len - 1)) { const gchar* _tmp3_; _tmp3_ = _data3_->separator; g_string_append (_data3_->res, _tmp3_); } } static void ___lambda13__json_array_foreach (JsonArray* array, guint index_, JsonNode* element_node, gpointer self) { __lambda13_ (self, array, index_, element_node); } gchar* unity_video_lens_ubuntu_video_search_join_array (JsonArray* array, const gchar* separator) { gchar* result = NULL; Block3Data* _data3_; const gchar* _tmp0_; gchar* _tmp1_; GString* _tmp2_; JsonArray* _tmp3_; guint _tmp4_ = 0U; JsonArray* _tmp5_; const gchar* _tmp6_; gchar* _tmp7_; g_return_val_if_fail (array != NULL, NULL); g_return_val_if_fail (separator != NULL, NULL); _data3_ = g_slice_new0 (Block3Data); _data3_->_ref_count_ = 1; _tmp0_ = separator; _tmp1_ = g_strdup (_tmp0_); _g_free0 (_data3_->separator); _data3_->separator = _tmp1_; _tmp2_ = g_string_new (""); _data3_->res = _tmp2_; _tmp3_ = array; _tmp4_ = json_array_get_length (_tmp3_); _data3_->len = _tmp4_; _tmp5_ = array; json_array_foreach_element (_tmp5_, ___lambda13__json_array_foreach, _data3_); _tmp6_ = _data3_->res->str; _tmp7_ = g_strdup (_tmp6_); result = _tmp7_; block3_data_unref (_data3_); _data3_ = NULL; return result; } static Block4Data* block4_data_ref (Block4Data* _data4_) { g_atomic_int_inc (&_data4_->_ref_count_); return _data4_; } static void block4_data_unref (void * _userdata_) { Block4Data* _data4_; _data4_ = (Block4Data*) _userdata_; if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) { _data4_->res = (_vala_array_free (_data4_->res, _data4_->res_length1, (GDestroyNotify) g_free), NULL); g_slice_free (Block4Data, _data4_); } } static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) { if ((*length) == (*size)) { *size = (*size) ? (2 * (*size)) : 4; *array = g_renew (gchar*, *array, (*size) + 1); } (*array)[(*length)++] = value; (*array)[*length] = NULL; } static void __lambda12_ (Block4Data* _data4_, JsonArray* a, guint index, JsonNode* node) { JsonNode* _tmp0_; const gchar* _tmp1_ = NULL; gchar* _tmp2_; g_return_if_fail (a != NULL); g_return_if_fail (node != NULL); _tmp0_ = node; _tmp1_ = json_node_get_string (_tmp0_); _tmp2_ = g_strdup (_tmp1_); _vala_array_add1 (&_data4_->res, &_data4_->res_length1, &_data4_->_res_size_, _tmp2_); } static void ___lambda12__json_array_foreach (JsonArray* array, guint index_, JsonNode* element_node, gpointer self) { __lambda12_ (self, array, index_, element_node); } static gchar** _vala_array_dup1 (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; } gchar** unity_video_lens_ubuntu_video_search_json_array_to_str_array (JsonArray* array, int* result_length1) { gchar** result = NULL; Block4Data* _data4_; gchar** _tmp0_ = NULL; JsonArray* _tmp1_; gchar** _tmp2_; gint _tmp2__length1; gchar** _tmp3_; gint _tmp3__length1; g_return_val_if_fail (array != NULL, NULL); _data4_ = g_slice_new0 (Block4Data); _data4_->_ref_count_ = 1; _tmp0_ = g_new0 (gchar*, 0 + 1); _data4_->res = _tmp0_; _data4_->res_length1 = 0; _data4_->_res_size_ = _data4_->res_length1; _tmp1_ = array; json_array_foreach_element (_tmp1_, ___lambda12__json_array_foreach, _data4_); _tmp2_ = (_data4_->res != NULL) ? _vala_array_dup1 (_data4_->res, _data4_->res_length1) : ((gpointer) _data4_->res); _tmp2__length1 = _data4_->res_length1; _tmp3_ = _tmp2_; _tmp3__length1 = _tmp2__length1; if (result_length1) { *result_length1 = _tmp3__length1; } result = _tmp3_; block4_data_unref (_data4_); _data4_ = NULL; return result; } static JsonObject* _vala_JsonObject_copy (JsonObject* self) { return g_boxed_copy (json_object_get_type (), self); } static gpointer __vala_JsonObject_copy0 (gpointer self) { return self ? _vala_JsonObject_copy (self) : NULL; } static gchar* g_time_format (struct tm *self, const gchar* format) { gchar* result = NULL; gchar* _tmp0_ = NULL; gchar* buffer; gint buffer_length1; gint _buffer_size_; gchar* _tmp1_; gint _tmp1__length1; const gchar* _tmp2_; gchar* _tmp3_; gint _tmp3__length1; gchar* _tmp4_; g_return_val_if_fail (format != NULL, NULL); _tmp0_ = g_new0 (gchar, 64); buffer = _tmp0_; buffer_length1 = 64; _buffer_size_ = buffer_length1; _tmp1_ = buffer; _tmp1__length1 = buffer_length1; _tmp2_ = format; strftime (_tmp1_, _tmp1__length1, _tmp2_, &(*self)); _tmp3_ = buffer; _tmp3__length1 = buffer_length1; _tmp4_ = g_strdup ((const gchar*) _tmp3_); result = _tmp4_; buffer = (g_free (buffer), NULL); return result; } static JsonArray* _vala_JsonArray_copy (JsonArray* self) { return g_boxed_copy (json_array_get_type (), self); } static gpointer __vala_JsonArray_copy0 (gpointer self) { return self ? _vala_JsonArray_copy (self) : NULL; } static void _vala_JsonArray_free (JsonArray* self) { g_boxed_free (json_array_get_type (), self); } static void _vala_JsonObject_free (JsonObject* self) { g_boxed_free (json_object_get_type (), self); } void unity_video_lens_ubuntu_video_search_process_details_results (const gchar* json_data, UnityVideoLensRemoteVideoDetails* result, GError** error) { JsonParser* _tmp0_; JsonParser* parser; const gchar* _tmp1_; JsonNode* _tmp2_ = NULL; JsonObject* _tmp3_ = NULL; JsonObject* _tmp4_; JsonObject* details; UnityVideoLensRemoteVideoDetails video = {0}; JsonObject* _tmp5_; const gchar* _tmp6_ = NULL; gchar* _tmp7_; JsonObject* _tmp8_; const gchar* _tmp9_ = NULL; gchar* _tmp10_; JsonObject* _tmp11_; const gchar* _tmp12_ = NULL; gchar* _tmp13_; JsonObject* _tmp14_; const gchar* _tmp15_ = NULL; gchar* _tmp16_; JsonObject* _tmp17_; gboolean _tmp18_ = FALSE; const gchar* _tmp25_ = NULL; JsonObject* _tmp26_; gboolean _tmp27_ = FALSE; const gchar* _tmp30_; gchar* _tmp31_; JsonObject* _tmp32_; gboolean _tmp33_ = FALSE; gchar** _tmp37_ = NULL; JsonObject* _tmp38_; gboolean _tmp39_ = FALSE; JsonObject* _tmp46_; gboolean _tmp47_ = FALSE; gchar** _tmp53_ = NULL; JsonObject* _tmp54_; gboolean _tmp55_ = FALSE; JsonObject* _tmp62_; gboolean _tmp63_ = FALSE; JsonObject* _tmp67_; gboolean _tmp68_ = FALSE; GError * _inner_error_ = NULL; g_return_if_fail (json_data != NULL); _tmp0_ = json_parser_new (); parser = _tmp0_; _tmp1_ = json_data; json_parser_load_from_data (parser, _tmp1_, (gssize) (-1), &_inner_error_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); _g_object_unref0 (parser); return; } _tmp2_ = json_parser_get_root (parser); _tmp3_ = json_node_get_object (_tmp2_); _tmp4_ = __vala_JsonObject_copy0 (_tmp3_); details = _tmp4_; memset (&video, 0, sizeof (UnityVideoLensRemoteVideoDetails)); _tmp5_ = details; _tmp6_ = json_object_get_string_member (_tmp5_, "title"); _tmp7_ = g_strdup (_tmp6_); _g_free0 (video.title); video.title = _tmp7_; _tmp8_ = details; _tmp9_ = json_object_get_string_member (_tmp8_, "image"); _tmp10_ = g_strdup (_tmp9_); _g_free0 (video.image); video.image = _tmp10_; _tmp11_ = details; _tmp12_ = json_object_get_string_member (_tmp11_, "description"); _tmp13_ = g_strdup (_tmp12_); _g_free0 (video.description); video.description = _tmp13_; _tmp14_ = details; _tmp15_ = json_object_get_string_member (_tmp14_, "source"); _tmp16_ = g_strdup (_tmp15_); _g_free0 (video.source); video.source = _tmp16_; _tmp17_ = details; _tmp18_ = json_object_has_member (_tmp17_, "release_date"); if (_tmp18_) { struct tm release_date = {0}; JsonObject* _tmp19_; const gchar* _tmp20_ = NULL; const gchar* _tmp21_ = NULL; memset (&release_date, 0, sizeof (struct tm)); _tmp19_ = details; _tmp20_ = json_object_get_string_member (_tmp19_, "release_date"); _tmp21_ = strptime (_tmp20_, "%Y-%m-%d", &release_date); if (_tmp21_ != NULL) { gchar* _tmp22_ = NULL; _tmp22_ = g_time_format (&release_date, "%Y"); _g_free0 (video.release_date); video.release_date = _tmp22_; } else { JsonObject* _tmp23_; const gchar* _tmp24_ = NULL; _tmp23_ = details; _tmp24_ = json_object_get_string_member (_tmp23_, "release_date"); g_warning ("youku-video-search.vala:176: Failed to parse release_date: '%s'", _tmp24_); } } _tmp26_ = details; _tmp27_ = json_object_has_member (_tmp26_, "formatted_price"); if (_tmp27_) { JsonObject* _tmp28_; const gchar* _tmp29_ = NULL; _tmp28_ = details; _tmp29_ = json_object_get_string_member (_tmp28_, "formatted_price"); _tmp25_ = _tmp29_; } else { _tmp25_ = ""; } _tmp30_ = _tmp25_; _tmp31_ = g_strdup (_tmp30_); _g_free0 (video.price); video.price = _tmp31_; video.duration = 0; _tmp32_ = details; _tmp33_ = json_object_has_member (_tmp32_, "duration"); if (_tmp33_) { JsonObject* _tmp34_; const gchar* _tmp35_ = NULL; gint _tmp36_ = 0; _tmp34_ = details; _tmp35_ = json_object_get_string_member (_tmp34_, "duration"); _tmp36_ = atoi (_tmp35_); video.duration = _tmp36_ / 60; } _tmp37_ = g_new0 (gchar*, 0 + 1); video.directors = (_vala_array_free (video.directors, video.directors_length1, (GDestroyNotify) g_free), NULL); video.directors = _tmp37_; video.directors_length1 = 0; _tmp38_ = details; _tmp39_ = json_object_has_member (_tmp38_, "directors"); if (_tmp39_) { JsonObject* _tmp40_; JsonArray* _tmp41_ = NULL; JsonArray* _tmp42_; JsonArray* directors; JsonArray* _tmp43_; gint _tmp44_ = 0; gchar** _tmp45_ = NULL; _tmp40_ = details; _tmp41_ = json_object_get_array_member (_tmp40_, "directors"); _tmp42_ = __vala_JsonArray_copy0 (_tmp41_); directors = _tmp42_; _tmp43_ = directors; _tmp45_ = unity_video_lens_ubuntu_video_search_json_array_to_str_array (_tmp43_, &_tmp44_); video.directors = (_vala_array_free (video.directors, video.directors_length1, (GDestroyNotify) g_free), NULL); video.directors = _tmp45_; video.directors_length1 = _tmp44_; __vala_JsonArray_free0 (directors); } _tmp46_ = details; _tmp47_ = json_object_has_member (_tmp46_, "starring"); if (_tmp47_) { JsonObject* _tmp48_; JsonArray* _tmp49_ = NULL; JsonArray* _tmp50_; JsonArray* starring; JsonArray* _tmp51_; gchar* _tmp52_ = NULL; _tmp48_ = details; _tmp49_ = json_object_get_array_member (_tmp48_, "starring"); _tmp50_ = __vala_JsonArray_copy0 (_tmp49_); starring = _tmp50_; _tmp51_ = starring; _tmp52_ = unity_video_lens_ubuntu_video_search_join_array (_tmp51_, ", "); _g_free0 (video.starring); video.starring = _tmp52_; __vala_JsonArray_free0 (starring); } _tmp53_ = g_new0 (gchar*, 0 + 1); video.genres = (_vala_array_free (video.genres, video.genres_length1, (GDestroyNotify) g_free), NULL); video.genres = _tmp53_; video.genres_length1 = 0; _tmp54_ = details; _tmp55_ = json_object_has_member (_tmp54_, "genres"); if (_tmp55_) { JsonObject* _tmp56_; JsonArray* _tmp57_ = NULL; JsonArray* _tmp58_; JsonArray* genres; JsonArray* _tmp59_; gint _tmp60_ = 0; gchar** _tmp61_ = NULL; _tmp56_ = details; _tmp57_ = json_object_get_array_member (_tmp56_, "genres"); _tmp58_ = __vala_JsonArray_copy0 (_tmp57_); genres = _tmp58_; _tmp59_ = genres; _tmp61_ = unity_video_lens_ubuntu_video_search_json_array_to_str_array (_tmp59_, &_tmp60_); video.genres = (_vala_array_free (video.genres, video.genres_length1, (GDestroyNotify) g_free), NULL); video.genres = _tmp61_; video.genres_length1 = _tmp60_; __vala_JsonArray_free0 (genres); } _tmp62_ = details; _tmp63_ = json_object_has_member (_tmp62_, "uploaded_by"); if (_tmp63_) { JsonObject* _tmp64_; const gchar* _tmp65_ = NULL; gchar* _tmp66_; _tmp64_ = details; _tmp65_ = json_object_get_string_member (_tmp64_, "uploaded_by"); _tmp66_ = g_strdup (_tmp65_); _g_free0 (video.uploaded_by); video.uploaded_by = _tmp66_; } _tmp67_ = details; _tmp68_ = json_object_has_member (_tmp67_, "date_uploaded"); if (_tmp68_) { JsonObject* _tmp69_; const gchar* _tmp70_ = NULL; gchar* _tmp71_; _tmp69_ = details; _tmp70_ = json_object_get_string_member (_tmp69_, "date_uploaded"); _tmp71_ = g_strdup (_tmp70_); _g_free0 (video.date_uploaded); video.date_uploaded = _tmp71_; } *result = video; __vala_JsonObject_free0 (details); _g_object_unref0 (parser); return; } /** * Parses JSON data returned by 'sources' query, returns list of sources (e.g. "Amazon", "Youtube" etc.) */ static Block5Data* block5_data_ref (Block5Data* _data5_) { g_atomic_int_inc (&_data5_->_ref_count_); return _data5_; } static void block5_data_unref (void * _userdata_) { Block5Data* _data5_; _data5_ = (Block5Data*) _userdata_; if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) { _g_object_unref0 (_data5_->results); g_slice_free (Block5Data, _data5_); } } static void __lambda8_ (Block5Data* _data5_, JsonArray* array, guint index, JsonNode* node) { GeeArrayList* _tmp0_; JsonNode* _tmp1_; const gchar* _tmp2_ = NULL; g_return_if_fail (array != NULL); g_return_if_fail (node != NULL); _tmp0_ = _data5_->results; _tmp1_ = node; _tmp2_ = json_node_get_string (_tmp1_); gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, _tmp2_); } static void ___lambda8__json_array_foreach (JsonArray* array, guint index_, JsonNode* element_node, gpointer self) { __lambda8_ (self, array, index_, element_node); } static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } GeeArrayList* unity_video_lens_ubuntu_video_search_process_sources_results (const gchar* json_data, GError** error) { GeeArrayList* result = NULL; Block5Data* _data5_; JsonParser* _tmp0_; JsonParser* parser; const gchar* _tmp1_; JsonNode* _tmp2_ = NULL; JsonArray* _tmp3_ = NULL; JsonArray* _tmp4_; JsonArray* sources_array; GeeArrayList* _tmp5_; JsonArray* _tmp6_; GeeArrayList* _tmp7_; GeeArrayList* _tmp8_; GError * _inner_error_ = NULL; g_return_val_if_fail (json_data != NULL, NULL); _data5_ = g_slice_new0 (Block5Data); _data5_->_ref_count_ = 1; _tmp0_ = json_parser_new (); parser = _tmp0_; _tmp1_ = json_data; json_parser_load_from_data (parser, _tmp1_, (gssize) (-1), &_inner_error_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); _g_object_unref0 (parser); block5_data_unref (_data5_); _data5_ = NULL; return NULL; } _tmp2_ = json_parser_get_root (parser); _tmp3_ = json_node_get_array (_tmp2_); _tmp4_ = __vala_JsonArray_copy0 (_tmp3_); sources_array = _tmp4_; _tmp5_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); _data5_->results = _tmp5_; _tmp6_ = sources_array; json_array_foreach_element (_tmp6_, ___lambda8__json_array_foreach, _data5_); _tmp7_ = _data5_->results; _tmp8_ = _g_object_ref0 (_tmp7_); result = _tmp8_; __vala_JsonArray_free0 (sources_array); _g_object_unref0 (parser); block5_data_unref (_data5_); _data5_ = NULL; return result; } 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/src/utils.c000664 001750 001750 00000015132 12607616420 020142 0ustar00kylinkylin000000 000000 /* utils.c generated by valac 0.20.1, the Vala compiler * generated from utils.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 * based on python code by David Calle */ #include #include #include #include #include #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _g_free0(var) (var = (g_free (var), NULL)) gboolean unity_utils_is_regular_file (const gchar* path); gboolean unity_utils_is_video (const gchar* path, GError** error); gboolean unity_utils_is_hidden (const gchar* path, GError** error); gchar* unity_utils_get_name (const gchar* path, GError** error); guint unity_utils_gcd (guint a, guint b); gboolean unity_utils_is_regular_file (const gchar* path) { gboolean result = FALSE; const gchar* _tmp0_; GFile* _tmp1_ = NULL; GFile* file; GFile* _tmp2_; gboolean _tmp3_ = FALSE; g_return_val_if_fail (path != NULL, FALSE); _tmp0_ = path; _tmp1_ = g_file_new_for_path (_tmp0_); file = _tmp1_; _tmp2_ = file; _tmp3_ = g_file_query_exists (_tmp2_, NULL); if (_tmp3_) { GFile* _tmp4_; GFileType _tmp5_ = 0; _tmp4_ = file; _tmp5_ = g_file_query_file_type (_tmp4_, G_FILE_QUERY_INFO_NONE, NULL); result = _tmp5_ == G_FILE_TYPE_REGULAR; _g_object_unref0 (file); return result; } result = FALSE; _g_object_unref0 (file); return result; } static gboolean string_contains (const gchar* self, const gchar* needle) { gboolean result = FALSE; const gchar* _tmp0_; gchar* _tmp1_ = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (needle != NULL, FALSE); _tmp0_ = needle; _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_); result = _tmp1_ != NULL; return result; } gboolean unity_utils_is_video (const gchar* path, GError** error) { gboolean result = FALSE; const gchar* _tmp0_; GFile* _tmp1_ = NULL; GFile* file; GFile* _tmp2_; gboolean _tmp3_ = FALSE; GError * _inner_error_ = NULL; g_return_val_if_fail (path != NULL, FALSE); _tmp0_ = path; _tmp1_ = g_file_new_for_path (_tmp0_); file = _tmp1_; _tmp2_ = file; _tmp3_ = g_file_query_exists (_tmp2_, NULL); if (_tmp3_) { GFile* _tmp4_; GFileType _tmp5_ = 0; _tmp4_ = file; _tmp5_ = g_file_query_file_type (_tmp4_, G_FILE_QUERY_INFO_NONE, NULL); if (_tmp5_ == G_FILE_TYPE_REGULAR) { GFile* _tmp6_; GFileInfo* _tmp7_ = NULL; GFileInfo* _tmp8_; GFileInfo* _tmp9_; const gchar* _tmp10_ = NULL; gchar* _tmp11_; gchar* _tmp12_; gchar* content_type; const gchar* _tmp13_; gboolean _tmp14_ = FALSE; _tmp6_ = file; _tmp7_ = g_file_query_info (_tmp6_, "standard::content-type", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_); _tmp8_ = _tmp7_; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); _g_object_unref0 (file); return FALSE; } _tmp9_ = _tmp8_; _tmp10_ = g_file_info_get_content_type (_tmp9_); _tmp11_ = g_strdup (_tmp10_); _tmp12_ = _tmp11_; _g_object_unref0 (_tmp9_); content_type = _tmp12_; _tmp13_ = content_type; _tmp14_ = string_contains (_tmp13_, "video"); result = _tmp14_; _g_free0 (content_type); _g_object_unref0 (file); return result; } } result = FALSE; _g_object_unref0 (file); return result; } gboolean unity_utils_is_hidden (const gchar* path, GError** error) { gboolean result = FALSE; const gchar* _tmp0_; GFile* _tmp1_ = NULL; GFile* file; GFileInfo* _tmp2_ = NULL; GFileInfo* _tmp3_; GFileInfo* _tmp4_; gboolean _tmp5_ = FALSE; gboolean _tmp6_; GError * _inner_error_ = NULL; g_return_val_if_fail (path != NULL, FALSE); _tmp0_ = path; _tmp1_ = g_file_new_for_path (_tmp0_); file = _tmp1_; _tmp2_ = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_); _tmp3_ = _tmp2_; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); _g_object_unref0 (file); return FALSE; } _tmp4_ = _tmp3_; _tmp5_ = g_file_info_get_is_hidden (_tmp4_); _tmp6_ = _tmp5_; _g_object_unref0 (_tmp4_); result = _tmp6_; _g_object_unref0 (file); return result; } gchar* unity_utils_get_name (const gchar* path, GError** error) { gchar* result = NULL; const gchar* _tmp0_; GFile* _tmp1_ = NULL; GFile* file; GFileInfo* _tmp2_ = NULL; GFileInfo* finfo; gchar* _tmp3_ = NULL; GError * _inner_error_ = NULL; g_return_val_if_fail (path != NULL, NULL); _tmp0_ = path; _tmp1_ = g_file_new_for_path (_tmp0_); file = _tmp1_; _tmp2_ = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_); finfo = _tmp2_; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); _g_object_unref0 (file); return NULL; } _tmp3_ = g_file_info_get_attribute_as_string (finfo, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME); result = _tmp3_; _g_object_unref0 (finfo); _g_object_unref0 (file); return result; } guint unity_utils_gcd (guint a, guint b) { guint result = 0U; guint _tmp0_; guint _tmp1_; _tmp0_ = a; _tmp1_ = b; g_return_val_if_fail ((_tmp0_ > ((guint) 0)) && (_tmp1_ > ((guint) 0)), 0U); { gboolean _tmp2_; _tmp2_ = TRUE; while (TRUE) { gboolean _tmp3_; guint _tmp4_; guint _tmp5_; _tmp3_ = _tmp2_; if (!_tmp3_) { } _tmp2_ = FALSE; _tmp4_ = a; _tmp5_ = b; if (_tmp4_ > _tmp5_) { guint _tmp6_; guint _tmp7_; guint _tmp8_; _tmp6_ = a; _tmp7_ = b; a = _tmp6_ % _tmp7_; _tmp8_ = a; if (_tmp8_ == ((guint) 0)) { guint _tmp9_; guint _tmp10_; _tmp9_ = b; result = _tmp9_; _tmp10_ = result; g_warn_if_fail (_tmp10_ > ((guint) 0)); return result; } } else { guint _tmp11_; guint _tmp12_; guint _tmp13_; _tmp11_ = b; _tmp12_ = a; b = _tmp11_ % _tmp12_; _tmp13_ = b; if (_tmp13_ == ((guint) 0)) { guint _tmp14_; guint _tmp15_; _tmp14_ = a; result = _tmp14_; _tmp15_ = result; g_warn_if_fail (_tmp15_ > ((guint) 0)); return result; } } } } } unity-china-video-scope/.bzr/checkout/conflicts000664 001750 001750 00000000033 12607616420 022430 0ustar00kylinkylin000000 000000 BZR conflict list format 1 unity-china-video-scope/src/remote-uri.vala000664 001750 001750 00000002760 12607616420 021576 0ustar00kylinkylin000000 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 RemoteUri { public string uri { get; set; } public string title { get; set; } public string icon { get; set; } public string details_uri { get; set; } public RemoteUri (string uri, string title, string icon, string details_uri) { this.uri = uri; this.title = title; this.icon = icon; this.details_uri = details_uri; } public static RemoteUri? from_rawuri (string raw_uri) { RemoteUri uri = null; string[] args = raw_uri.split ("lens-meta://", 4); if (args.length == 4) { uri = new RemoteUri (args[0], args[1], args[2], args[3]); } return uri; } public string to_rawuri () { return string.join ("lens-meta://", uri, title, icon, details_uri); } } } unity-china-video-scope/.bzr/README000664 001750 001750 00000000223 12607616415 017601 0ustar00kylinkylin000000 000000 This is a Bazaar control directory. Do not change any files in this directory. See http://bazaar.canonical.com/ for more information about Bazaar. unity-china-video-scope/.bzr/checkout/dirstate000664 001750 001750 00000042661 12607616421 022301 0ustar00kylinkylin000000 000000 #bazaar dirstate flat format 3 crc32: 1255514587 num_entries: 85 1shuilupi@ubuntukylin.com-20151015025846-bqyxuxjnj82cf7sf 0 tree_root-20130730175527-o0etnhg82vqrwqjt-1d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls .pcpc-20130730175527-o0etnhg82vqrwqjt-84d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-c1wgqe9722gicv0d AUTHORSauthors-20130730175527-o0etnhg82vqrwqjt-52f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls COPYINGcopying-20130730175527-o0etnhg82vqrwqjt-23f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf8624bcdae55baeef00cd11d5dfcfa60f68710a0235147npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls ChangeLogchangelog-20130730175527-o0etnhg82vqrwqjt-48f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls MANIFEST.inmanifest.in-20130730175527-o0etnhg82vqrwqjt-22f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfb937ba5b54cd4ce427a84015fdb16b4134720e32197npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls Makefile.ammakefile.am-20130730175527-o0etnhg82vqrwqjt-56f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfbfc3af1429ca8c1aa32a141487ea5c843571d72c123npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls Makefile.am.coveragemakefile.am.coverage-20130730175527-o0etnhg82vqrwqjt-69f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf3d964220756f1614c52dff474d39dfd559d47c141349npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls Makefile.declmakefile.decl-20130730175527-o0etnhg82vqrwqjt-82f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfe2a08865a59e37f533556f47d518f329899db29a2823npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls NEWSnews-20130730175527-o0etnhg82vqrwqjt-80f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls READMEreadme-20130730175527-o0etnhg82vqrwqjt-35f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf923e82cd4c3b689dc586021c01f0e39964622b8e130npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls acinclude.m4acinclude.m4-20130730175527-o0etnhg82vqrwqjt-58f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxffc1e084a3bd4193d0164e5e55f85d266e4fa56dd967npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls autogen.shautogen.sh-20130730175527-o0etnhg82vqrwqjt-67f0yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf50de859f7345050b1680e483b6dc4032b09941e7191ypackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls configure.acconfigure.ac-20130730175527-o0etnhg82vqrwqjt-7f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf47cdcfae7ff8726a0c5e4395f2584307db773ec37033nshuilupi@ubuntukylin.com-20151015025846-bqyxuxjnj82cf7sf datadata-20130730175527-o0etnhg82vqrwqjt-59d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls debiandebian-20130730175527-o0etnhg82vqrwqjt-70d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls m4m4-20130730175527-o0etnhg82vqrwqjt-28d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls popo-20130730175527-o0etnhg82vqrwqjt-3d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcsrc-20130730175527-o0etnhg82vqrwqjt-55d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls teststests-20130730175527-o0etnhg82vqrwqjt-26d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls vapivapi-20130730175527-o0etnhg82vqrwqjt-33d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls .pc.quilt_patchesquilt_patches-20130730175527-o0etnhg82vqrwqjt-87f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxff9b45dee55b5a3eb6fd9fd81b77c1a8e446be60b15npackage-import@ubuntu.com-20130720170130-c1wgqe9722gicv0d .pc.quilt_seriesquilt_series-20130730175527-o0etnhg82vqrwqjt-97f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf2859777d6f2bf7f5165b3db310e170ac6c7c86727npackage-import@ubuntu.com-20130720170130-c1wgqe9722gicv0d .pc.versionversion-20130730175527-o0etnhg82vqrwqjt-89f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf7448d8798a4380162d4b56f9b452e2f6f9e24e7a2npackage-import@ubuntu.com-20130720170130-c1wgqe9722gicv0d .pcapplied-patchesappliedpatches-20130730175527-o0etnhg82vqrwqjt-88f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-c1wgqe9722gicv0d dataMakefile.ammakefile.am-20130730175527-o0etnhg82vqrwqjt-77f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfaa73080c2294e63dc8ccf43e1a33184c23062539558npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls dataunity-china-video-scope.service.inunitychinavideoscope-20130730175527-o0etnhg82vqrwqjt-46f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf0a00860034958d49178928a060cba68a4b24cc8898npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls dataunity-lens-video1.pngunitylensvideo1.png-20130730175527-o0etnhg82vqrwqjt-27f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfc94cc79c7609b512bb8ec458bf52da1fa126128c3902npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls datavideoyouku.scope.in.invideoyouku.scope.in.-20130730175527-o0etnhg82vqrwqjt-75f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf2de00d110c9910a21ff33a4b5782ff49626fed98527npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls debianchangelogchangelog-20130730175527-o0etnhg82vqrwqjt-6f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf4f0270a03a463fd352e7ea63a9f36f4b61b41c33694nshuilupi@ubuntukylin.com-20151015025846-bqyxuxjnj82cf7sf debiancompatcompat-20130730175527-o0etnhg82vqrwqjt-42f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfb6abd567fa79cbe0196d093a067271361dc6ca8b2npackage-import@ubuntu.com-20130829004851-6jgjgqgdj0w1aym0 debiancontrolcontrol-20130730175527-o0etnhg82vqrwqjt-39f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf83f3d00458ec649c55840788c7349cc1012fc9a8941nshuilupi@ubuntukylin.com-20151008060843-s92oe6oinp62x9ep debiancopyrightcopyright-20130730175527-o0etnhg82vqrwqjt-15f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf01edcaed4a3f703b8f0c2bc43fed64c4e86b42b31770npackage-import@ubuntu.com-20130829004851-6jgjgqgdj0w1aym0 debianrulesrules-20130730175527-o0etnhg82vqrwqjt-47f0yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf20b868432d6d19fbb00041b5d6381a281008bf17273ypackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls debiansourcesource-20130730175527-o0etnhg82vqrwqjt-21d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls debianwatchwatch-20130730175527-o0etnhg82vqrwqjt-24f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf18700b69ba00ac8ddd0836bca018d88d07c3f1b8153npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls debian/sourceformatformat-20130730175527-o0etnhg82vqrwqjt-53f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf1064dc0ce263680c076a1005f35ec906a5cf5a3212npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls m4gcov.m4gcov.m4-20130730175527-o0etnhg82vqrwqjt-62f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf0694440f84cbd5e29b521289ddeea4a637396dd32501npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls po.intltool-merge-cacheintltoolmergecache-20130730175527-o0etnhg82vqrwqjt-5f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf207ee0a3c51baae0e38b94cb94029fb9a9712d21611npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls poLINGUASlinguas-20130730175527-o0etnhg82vqrwqjt-63f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf9e7d5f85d6f6f8b90c98abcf22068ffd553b57206npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls poPOTFILES.inpotfiles.in-20130730175527-o0etnhg82vqrwqjt-20f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf08e2600e1eb55ea38e545d5944bde595e959a360142npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls poPOTFILES.skippotfiles.skip-20130730175527-o0etnhg82vqrwqjt-73f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf00d3b74b5b6345aa36b12fe783d91e38fefd33b344npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls poen_US.poen_us.po-20130730175527-o0etnhg82vqrwqjt-31f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf493e1e1a4c27274b7bbfcf1198593d0f223ac43b2120npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls pounity-china-video-scope.potunitychinavideoscope-20130730175527-o0etnhg82vqrwqjt-11f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxffa14072f722446ea6484970247139e996a15228b1689npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls pozh_CN.pozh_cn.po-20130730175527-o0etnhg82vqrwqjt-41f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfc9a5a34fae4651ce43fb3cb63e416cee26bd8df42123npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls src.libslibs-20130730175527-o0etnhg82vqrwqjt-49d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcMakefile.ammakefile.am-20130730175527-o0etnhg82vqrwqjt-18f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf08708219ee1c2a4ed0e696250d9518b581b72ac31704nshuilupi@ubuntukylin.com-20151013093505-4qgzd5tvklsljv4c srca.loga.log-20130730175527-o0etnhg82vqrwqjt-60f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcconfig.vala.inconfig.vala.in-20130730175527-o0etnhg82vqrwqjt-43f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf6913c921d7342e2402daeeb79d476fb9d7f30c49387npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcremote-scope-globals.cremotescopeglobals.c-20130730175527-o0etnhg82vqrwqjt-14f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf59116cbb805ccdb2a982cc80e507a7d0811c305d1059npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcremote-scope-globals.valaremotescopeglobals.v-20130730175527-o0etnhg82vqrwqjt-54f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfb11f336a46ddeeaff797859d7847a4c12961dc1d796npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcremote-scope.cremotescope.c-20130730175527-o0etnhg82vqrwqjt-65f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf8f1f79be99a8f47176a52a1c9fbe79019146e6a5129587npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcremote-scope.valaremotescope.vala-20130730175527-o0etnhg82vqrwqjt-38f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf0a08b50f71fbb7250ba488b8d3a98bbcf2106e1422593npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcremote-uri.cremoteuri.c-20130730175527-o0etnhg82vqrwqjt-13f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxff65f4aa03c33c594aa39a386ab844110e3ee537917657npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcremote-uri.valaremoteuri.vala-20130730175527-o0etnhg82vqrwqjt-30f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf00acdc43e70970bed4c76edf34210f179f64e61c1520npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcremote-video-main.cremotevideomain.c-20130730175527-o0etnhg82vqrwqjt-51f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf64eb88b585004f14c52bbf5d67861c07361fa03a5512npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcremote-video-main.valaremotevideomain.vala-20130730175527-o0etnhg82vqrwqjt-4f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf704eb0da5266c7fba6a03def05ce43183e5a20001741npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcutils.cutils.c-20130730175527-o0etnhg82vqrwqjt-81f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf54c32b2169b0ff9074ad1279f95db138e2a2c3986746npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcutils.valautils.vala-20130730175527-o0etnhg82vqrwqjt-50f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfe8e3b50caf001969f6aa83a202b09c8db02f63952312npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcvideo-file.cvideofile.c-20130730175527-o0etnhg82vqrwqjt-45f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxff18d95002d5ad2547803c3740955246ac38d154e13898npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcvideo-file.valavideofile.vala-20130730175527-o0etnhg82vqrwqjt-12f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfe660827103e7f6ce281742f7ff354fe97ef6ff391356npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcyouku-video-search.cyoukuvideosearch.c-20130730175527-o0etnhg82vqrwqjt-76f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxff8ae7aaf7a303c2f2dfc73849367686ccfb4fa9535964npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls srcyouku-video-search.valayoukuvideosearch.val-20130730175527-o0etnhg82vqrwqjt-16f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf05b4eb30e0f30a775324552153e6c82bc5644b968012npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls testsmanualmanual-20130730175527-o0etnhg82vqrwqjt-61d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls testsunitunit-20130730175527-o0etnhg82vqrwqjt-78d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/manuallocal-video-previews.txtlocalvideopreviews.t-20130730175527-o0etnhg82vqrwqjt-44f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf965951d03dbb76f61ca62c5747ecc236d604bc791255npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/manuallocal-video-search.txtlocalvideosearch.txt-20130730175527-o0etnhg82vqrwqjt-74f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf27c9b157ac55d2ee254367593dd9f992b695df15514npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unitMakefile.ammakefile.am-20130730175527-o0etnhg82vqrwqjt-71f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf574661c45dabf78f393022b3c4d6203906d140df2775nshuilupi@ubuntukylin.com-20151013093505-4qgzd5tvklsljv4c tests/unitconfig-tests.vala.inconfigtests.vala.in-20130730175527-o0etnhg82vqrwqjt-37f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfeb99cc5da37acece2fc6d10b91735f153e5a4b09283npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unitdatadata-20130730175527-o0etnhg82vqrwqjt-25d0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd0npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unittest-locate.valatestlocate.vala-20130730175527-o0etnhg82vqrwqjt-32f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxffc3d19e41f223345b49b90bc799d54968ae9d3091975npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unittest-ubuntu-video-search.valatestubuntuvideosearc-20130730175527-o0etnhg82vqrwqjt-72f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf3cb839359e5463a1d8c62dc84d2ebaa1464f775511280npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unittest-utils.valatestutils.vala-20130730175527-o0etnhg82vqrwqjt-17f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf057cefaea5f2fb1e0f8aab9f8d31c616d817ca281840npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unitthumbnailer-mock.valathumbnailermock.vala-20130730175527-o0etnhg82vqrwqjt-36f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf41e6326b642d7c5db678c75b8bcfc77bae1a20db846npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideo1.avivideo1.avi-20130730175527-o0etnhg82vqrwqjt-10f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideo1.mpgvideo1.mpg-20130730175527-o0etnhg82vqrwqjt-57f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideo2.avivideo2.avi-20130730175527-o0etnhg82vqrwqjt-19f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideo2.mpgvideo2.mpg-20130730175527-o0etnhg82vqrwqjt-66f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideo3.avivideo3.avi-20130730175527-o0etnhg82vqrwqjt-29f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideo3.mpgvideo3.mpg-20130730175527-o0etnhg82vqrwqjt-9f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfda39a3ee5e6b4b0d3255bfef95601890afd807090npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideosearch_details1.txtvideosearch_details1-20130730175527-o0etnhg82vqrwqjt-34f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfb8eca7b26b361ef9f3c8d9c007bb9fba0e3f9960510npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideosearch_input1.txtvideosearch_input1.t-20130730175527-o0etnhg82vqrwqjt-64f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfb000d60439043024a690448573932410c81c00a9895npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls tests/unit/datavideosearch_input2.txtvideosearch_input2.t-20130730175527-o0etnhg82vqrwqjt-79f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfcdf66ef5486be526ff136c539b7592e7e2ca24e2335npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls vapiMakefile.ammakefile.am-20130730175527-o0etnhg82vqrwqjt-68f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf251d08d896d59c6581d0148d3e52c01cdfcba06873npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls vapilibsoup-gnome-2.4.vapilibsoupgnome2.4.vapi-20130730175527-o0etnhg82vqrwqjt-40f0nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfbaccaa189906b49ad2d8d3235a9dca9471fe5a7a423npackage-import@ubuntu.com-20130720170130-ngvubtekpiuzfrls unity-china-video-scope/.bzr/branch/format000664 001750 001750 00000000047 12607616420 021371 0ustar00kylinkylin000000 000000 Bazaar Branch Format 7 (needs bzr 1.6) unity-china-video-scope/.pc/applied-patches000664 001750 001750 00000000000 12607616420 021501 0ustar00kylinkylin000000 000000 unity-china-video-scope/src/remote-scope.vala000664 001750 001750 00000054101 12607616420 022104 0ustar00kylinkylin000000 000000 /* * 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 * */ using Config; namespace Unity.VideoLens { public class RemoteVideoScope : Unity.DeprecatedScope { private static int REFRESH_INTERVAL = 3600; // fetch sources & recommendations once an hour private static int RETRY_INTERVAL = 60; // retry sources/recommendations after a minute private static string IS_IN_CHINA = "Unknown"; private const string ASK_IP_SERVER_URI_ONE = "http://ip.chinaz.com/"; private const string ASK_IP_SERVER_URI_TWO = "http://www.123myip.co.uk/"; private static string PREVIEW_ON_LMB = "lmb-preview"; private Soup.Session session; private PreferencesManager preferences = PreferencesManager.get_default (); Gee.ArrayList recommendations; int64 recommendations_last_update = 0; Zeitgeist.DataSourceRegistry zg_sources; bool use_zeitgeist; private bool is_in_China ( GLib.Cancellable? cancellable = null) { if(IS_IN_CHINA == "Unknown") { File file = File.new_for_uri (ASK_IP_SERVER_URI_ONE); uint8[] data; string content; string etag_out; if( file.load_contents(cancellable, out data, out etag_out)) { //Convert uint8[] to string. content = (string) data; var location = content.index_of("北京") + content.index_of("上海") + content.index_of("天津") + content.index_of("重庆") + content.index_of("黑龙江") + content.index_of("吉林") + content.index_of("辽宁") + content.index_of("江苏") + content.index_of("山东") + content.index_of("安徽") + content.index_of("河北") + content.index_of("河南") + content.index_of("湖北") + content.index_of("湖南") + content.index_of("江西") + content.index_of("陕西") + content.index_of("山西") + content.index_of("四川") + content.index_of("青海") + content.index_of("海南") + content.index_of("广东") + content.index_of("贵州") + content.index_of("浙江") + content.index_of("福建") + content.index_of("台湾") + content.index_of("甘肃") + content.index_of("云南") + content.index_of("内蒙古") + content.index_of("宁夏") + content.index_of("新疆") + content.index_of("西藏") + content.index_of("广西"); if(location <0 ) { //if ASK_IP_SERVER_URI_ONE server reposended failed,ask ASK_IP_SERVER_URI_TWO server. file = File.new_for_uri (ASK_IP_SERVER_URI_TWO); try { if( file.load_contents(cancellable, out data, out etag_out)) { //Convert uint8[] to string. content = (string) data; location = content.index_of("China") ; if(location > 0 ) { IS_IN_CHINA = "Yes"; return true; } } } catch (Error e) { warning ("Error reading URL '%s': %s", file.get_uri (), e.message); } } else { IS_IN_CHINA = "Yes"; return true; } } } else { return true; } return true; } public RemoteVideoScope () { Object (dbus_path: "/net/launchpad/scope/youkuvideos", id: "videoyouku.scope"); } protected override void constructed () { base.constructed (); schema.add_field (PREVIEW_ON_LMB, "b", Unity.Schema.FieldType.OPTIONAL); recommendations = new Gee.ArrayList (); use_zeitgeist = false; try { zeitgeist_init (); use_zeitgeist = true; } catch (Error e) { warning ("Failed to initialize Zeitgeist, won't store events"); } session = new Soup.SessionAsync (); session.ssl_use_system_ca_file = true; session.ssl_strict = true; session.user_agent = "Unity Video Lens Remote Scope v" + Config.VERSION; session.add_feature_by_type (typeof (SoupGNOME.ProxyResolverGNOME)); search_in_global = false; search_changed.connect ((search, search_type, cancellable) => { update_search_async.begin (search, search_type, cancellable); }); generate_search_key.connect ((scope, search) => { return search.search_string.strip (); }); preferences.notify["remote-content-search"].connect ((obj, pspec) => { queue_search_changed (SearchType.DEFAULT); }); populate_categories (); query_list_of_sources (); // refresh the at least once every 30 minutes GLib.Timeout.add_seconds (REFRESH_INTERVAL/2, () => { queue_search_changed (SearchType.DEFAULT); return true; }); try { export (); } catch (Error e) { error ("Failed to export scope: %s", e.message); } } private void populate_categories () { var categories = new Unity.CategorySet (); var icon_dir = File.new_for_path (Config.ICON_PATH); categories.add(new Unity.Category ("online", _("Online"), new FileIcon (icon_dir.get_child ("group-internet.svg")), Unity.CategoryRenderer.VERTICAL_TILE)); categories.add(new Unity.Category ("more", _("More suggestions"), new FileIcon (icon_dir.get_child ("group-treat-yourself.svg")), Unity.CategoryRenderer.VERTICAL_TILE)); this.categories = categories; } /* Query the server for a list of sources that will be used * to build sources filter options and search queries. */ private void query_list_of_sources () { var msg = new Soup.Message ("GET", UbuntuVideoSearch.sources_uri ()); session.queue_message (msg, sources_cb); } private Gee.ArrayList? handle_search_response (Soup.Message msg, bool is_treat_yourself = false) { if (msg.status_code != 200) { warning ("Unable to get results from the server: %u, %s", msg.status_code, msg.reason_phrase); } else { try { return UbuntuVideoSearch.process_search_results ((string)msg.response_body.data, is_treat_yourself); } catch (Error e) { warning ("Error processing search results: %s", e.message); } } return null; } private void sources_cb (Soup.Session session, Soup.Message msg) { uint interval = RETRY_INTERVAL; if (msg.status_code != 200) { warning ("Unable to query the server for a list of sources, %u: %s", msg.status_code, msg.reason_phrase); } else { try { var sources_array = UbuntuVideoSearch.process_sources_results ((string) msg.response_body.data); // remove all existing sources var to_remove = new SList (); foreach (var opt in sources.options) to_remove.append (opt.id); foreach (var id in to_remove) sources.remove_option (id); // add sources foreach (var src in sources_array) { sources.add_option (src, src, null); } interval = REFRESH_INTERVAL; } catch (Error e) { warning ("Got invalid json from the server"); } } GLib.Timeout.add_seconds (interval, () => { query_list_of_sources (); return false; }); } public override async Unity.ActivationResponse? activate_result (ScopeResult result) { var realcat = result.metadata.lookup (PREVIEW_ON_LMB); // activation of More Suggestions should display a preview. if (realcat != null && realcat.get_boolean ()) { var preview = yield preview_result (result); return new Unity.ActivationResponse.with_preview (preview); } return on_activate_uri (result.uri); } private Unity.ActivationResponse on_activate_uri (string rawuri) { var fakeuri = RemoteUri.from_rawuri (rawuri); if (fakeuri != null) { if (use_zeitgeist) zeitgeist_insert_event (fakeuri.uri, fakeuri.title, fakeuri.icon); try { GLib.AppInfo.launch_default_for_uri (fakeuri.uri, null); return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH); } catch (GLib.Error e) { warning ("Failed to launch default application for '%s': %s", fakeuri.uri, e.message); } } else { warning ("Invalid raw uri: '%s'", rawuri); } return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED); } private Unity.ActivationResponse on_play_video (string rawuri) { return on_activate_uri (rawuri); } private Unity.Preview? build_preview (RemoteUri uri, RemoteVideoDetails? details) { string title = uri.title; string subtitle = ""; string description = ""; File song_file; uint8[] song_data; string etag_out; string content = ""; song_file = File.new_for_uri (uri.uri); if(song_file.load_contents(null, out song_data, out etag_out)) { content = (string) song_data; } var iIndex = content.index_of(""); content = content.substring(iIndex+34, iEnd-37); description = content; if (details != null) { title = details.title; description = details.description; if (details.release_date != null && details.release_date != "") subtitle = details.release_date; if (details.duration > 0) { string duration = ngettext ("%d min", "%d mins", details.duration).printf (details.duration); if (subtitle != "") subtitle += ", " + duration; else subtitle = duration; } } GLib.Icon thumbnail = new GLib.FileIcon (GLib.File.new_for_uri (details != null ? details.image : uri.icon)); var real_preview = new Unity.MoviePreview (title, subtitle, description, thumbnail); var play_video = new Unity.PreviewAction ("play", _("Play"), null); play_video.activated.connect (on_play_video); real_preview.add_action (play_video); // For now, rating == -1 and num_ratings == 0 hides the rating widget from the preview real_preview.set_rating (-1, 0); if (details != null) { //TODO: For details of future source types, factor out common detail key/value pairs if (details.directors.length > 0) real_preview.add_info (new Unity.InfoHint ("directors", ngettext ("Director", "Directors", details.directors.length), null, string.joinv (", ", details.directors))); if (details.starring != null && details.starring != "") real_preview.add_info (new Unity.InfoHint ("cast", _("Cast"), null, details.starring)); if (details.genres != null && details.genres.length > 0) real_preview.add_info (new Unity.InfoHint ("genres", ngettext("Genre", "Genres", details.genres.length), null, string.joinv (", ", details.genres))); // TODO: Add Vimeo & YouTube details for v1 of JSON API if (details.uploaded_by != null && details.uploaded_by != "") real_preview.add_info (new Unity.InfoHint ("uploaded-by", _("Uploaded by"), null, details.uploaded_by)); if (details.date_uploaded != null && details.date_uploaded != "") real_preview.add_info (new Unity.InfoHint ("uploaded-on", _("Uploaded on"), null, details.date_uploaded)); } return real_preview; } public override async Preview? preview_result (ScopeResult result) { var fakeuri = RemoteUri.from_rawuri (result.uri); if (fakeuri != null) { RemoteVideoDetails? details = null; if (fakeuri.details_uri != null && fakeuri.details_uri != "") { try { // details = yield get_details (fakeuri.details_uri); details = yield get_details (fakeuri.uri); } catch (Error e) { warning ("Failed to fetch video details: %s", e.message); } } return build_preview (fakeuri, details); } else { warning ("Invalid raw uri: '%s'", result.uri); } return null; } private async RemoteVideoDetails? get_details (string url) throws Error { var msg = new Soup.Message ("GET", url); session.queue_message (msg, (session_, msg_) => { msg = msg_; get_details.callback (); }); yield; if (msg.status_code != 200) { warning ("Unable to get details from the server: %u, %s", msg.status_code, msg.reason_phrase); return null; } else { var details = UbuntuVideoSearch.process_details_results ((string) msg.response_body.data); return details; } } private async void update_search_async (DeprecatedScopeSearch search, SearchType search_type, GLib.Cancellable? cancellable) { if(!is_in_China(cancellable)) { warning("Error can not search video from Youku !"); return; } try { var search_string = search.search_string.strip (); debug ("Remote search string changed to: %s", search_string); var model = search.results_model; model.clear (); // only perform the request if the user has not disabled // online/commercial suggestions. That will hide the category as well. if (preferences.remote_content_search != Unity.PreferencesManager.RemoteContent.ALL) { search.finished(); return; } // create a list of activated sources var active_sources = new Gee.ArrayList (null); foreach (var opt in sources.options) { if (source_activated (opt.id)) active_sources.add (opt.id); } // If all the sources are activated, don't bother passing them as arguments if (active_sources.size == sources.options.length ()) { active_sources.clear (); } if (search_type == Unity.SearchType.DEFAULT) { if (at_least_one_source_is_on (active_sources)) { try { yield perform_search (search_string, search, active_sources, cancellable); } catch (Error e) { warning ("Search interrupted: %s", e.message); } } } search.finished (); } catch (Error e) { warning ("Error getting result from youku: %s(Failed to Search video from Youku)!", e.message); } } private bool source_activated (string id) { bool active = sources.get_option (id).active; bool filtering = sources.filtering; if ((active && filtering) || (!active && !filtering)) return true; return false; } /* Return a general activation state of all sources of this scope. * This is needed, because we don't want to show recommends if an option * from another scope is the only one activated */ private bool at_least_one_source_is_on (Gee.ArrayList active_sources) { return (sources.filtering && active_sources.size > 0 || !sources.filtering); } /* Query the server with the search string and the list of sources. */ private async void perform_search (string search_string, DeprecatedScopeSearch search, Gee.ArrayList active_sources, GLib.Cancellable? cancellable) throws Error { search.results_model.clear (); if ((search_string == null || search_string == "") && (active_sources.size == 0) && (recommendations.size > 0)) { var time = new DateTime.now_utc (); if (time.to_unix () - recommendations_last_update < REFRESH_INTERVAL) { debug ("Updating search results with recommendations"); update_results_model (search.results_model, recommendations); return; } } var url = UbuntuVideoSearch.build_search_uri (search_string, active_sources); debug ("Querying the server: %s", url); bool is_treat_yourself = (search_string == null || search_string == "" || active_sources.size == 0); var msg = new Soup.Message ("GET", url); session.queue_message (msg, (session_, msg_) => { msg = msg_; perform_search.callback (); }); var cancelled = false; ulong cancel_id = 0; if (cancellable != null) { cancel_id = cancellable.connect (() => { cancelled = true; session.cancel_message (msg, Soup.KnownStatusCode.CANCELLED); }); } yield; if (cancelled) { // we can't disconnect right away, as that would deadlock (cause // cancel_message doesn't return before invoking the callback) Idle.add (perform_search.callback); yield; cancellable.disconnect (cancel_id); throw new IOError.CANCELLED ("Cancelled"); } if (cancellable != null) { // clean up cancellable.disconnect (cancel_id); } var results = handle_search_response (msg, is_treat_yourself); if (results != null) { if (search_string == null || search_string.strip () == "" && active_sources.size == 0) { debug ("Empty search, updating recommendations"); var time = new DateTime.now_utc (); recommendations = results; recommendations_last_update = time.to_unix (); } update_results_model (search.results_model, results); } } private void update_results_model (Dee.Model model, Gee.ArrayList results) { foreach (var video in results) { if (video.uri.has_prefix ("http")) { var fake_uri = new RemoteUri (video.uri, video.title, video.icon, "video.details_uri"); //note: details_uri have not if (fake_uri == null) // test message... warning("fake_uri is null"); var result_icon = video.icon; if (video.category == CAT_INDEX_MORE && video.price != null && video.price != "") { var anno_icon = new Unity.AnnotatedIcon (new FileIcon (File.new_for_uri (result_icon))); anno_icon.category = Unity.CategoryType.MOVIE; anno_icon.ribbon = video.price; result_icon = anno_icon.to_string (); } // aggregator scope remaps categories, so we won't get real category back; // put real category into metadata var realcat = new Variant.dict_entry (PREVIEW_ON_LMB, new Variant.variant (video.category == CAT_INDEX_MORE)); var metadata = new Variant.array (VariantType.VARDICT.element (), {realcat}); model.append (fake_uri.to_rawuri (), result_icon, video.category, ResultType.DEFAULT, "text/html", video.title, video.comment, video.uri, metadata); } } } private void zeitgeist_init () throws Error { zg_sources = new Zeitgeist.DataSourceRegistry (); var templates = new PtrArray.sized(1); var ev = new Zeitgeist.Event.full (Zeitgeist.ZG_ACCESS_EVENT, Zeitgeist.ZG_USER_ACTIVITY, "lens://unity-lens-video"); templates.add ((ev as GLib.Object).ref()); var data_source = new Zeitgeist.DataSource.full ("98898", "Unity Video Lens", "", templates); zg_sources.register_data_source (data_source, null); } private void zeitgeist_insert_event (string uri, string title, string icon) { var subject = new Zeitgeist.Subject.full (uri, Zeitgeist.NFO_VIDEO, Zeitgeist.NFO_REMOTE_DATA_OBJECT, "", uri, title, icon); var event = new Zeitgeist.Event.full (Zeitgeist.ZG_ACCESS_EVENT, Zeitgeist.ZG_USER_ACTIVITY, "lens://unity-lens-video"); event.add_subject (subject); var ev_array = new PtrArray.sized(1); ev_array.add ((event as GLib.Object).ref ()); Zeitgeist.Log.get_default ().insert_events_from_ptrarray (ev_array, null); } } } unity-china-video-scope/po/POTFILES.in000664 001750 001750 00000000216 12607616420 020237 0ustar00kylinkylin000000 000000 [encoding: UTF-8] src/remote-scope.vala src/remote-video-main.vala src/youku-video-search.vala [type: gettext/ini]data/videoyouku.scope.in.in unity-china-video-scope/src/utils.vala000664 001750 001750 00000004410 12607616420 020640 0ustar00kylinkylin000000 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 * based on python code by David Calle */ namespace Unity.Utils { public bool is_regular_file (string path) { var file = GLib.File.new_for_path (path); if (file.query_exists (null)) return file.query_file_type (GLib.FileQueryInfoFlags.NONE, null) == GLib.FileType.REGULAR; return false; } public bool is_video (string path) throws Error { var file = GLib.File.new_for_path (path); if (file.query_exists (null)) { if (file.query_file_type (GLib.FileQueryInfoFlags.NONE, null) == GLib.FileType.REGULAR) { var content_type = file.query_info ("standard::content-type", GLib.FileQueryInfoFlags.NONE, null).get_content_type (); return content_type.contains ("video"); } } return false; } private bool is_hidden (string path) throws Error { var file = GLib.File.new_for_path (path); return file.query_info (GLib.FileAttribute.STANDARD_IS_HIDDEN, GLib.FileQueryInfoFlags.NONE, null).get_is_hidden (); } public string get_name (string path) throws Error { var file = GLib.File.new_for_path (path); var finfo = file.query_info (GLib.FileAttribute.STANDARD_DISPLAY_NAME, GLib.FileQueryInfoFlags.NONE, null); return finfo.get_attribute_as_string (GLib.FileAttribute.STANDARD_DISPLAY_NAME); } public uint gcd (uint a, uint b) requires (a > 0 && b > 0) ensures (result > 0) { for (;;) { if (a > b) { a = a % b; if (a == 0) return b; } else { b = b % a; if (b == 0) return a; } } } }unity-china-video-scope/tests/unit/data/video1.mpg000664 001750 001750 00000000000 12607616420 022761 0ustar00kylinkylin000000 000000 unity-china-video-scope/data/000775 001750 001750 00000000000 12607616420 016756 5ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/repository/obsolete_packs/000775 001750 001750 00000000000 12607616415 024140 5ustar00kylinkylin000000 000000 unity-china-video-scope/tests/unit/data/videosearch_details1.txt000664 001750 001750 00000000776 12607616420 025734 0ustar00kylinkylin000000 000000 { "browser_url": "http://browserurl1", "genres": [ "genre1", "genre2" ], "description": "a movie", "title": "title1", "price": 1, "source": "source1", "directors": [ "director1", "director2" ], "details": "http://detailsurl1", "starring": [ "star1", "star2" ], "uploaded_by": "uploader1", "duration": "5477", "release_date": "2010-04-01T07:00:00.000Z", "image": "http://image1", "date_uploaded": "2012-06-06T21:55:12.000Z", "formatted_price": "$1" } unity-china-video-scope/data/unity-lens-video1.png000664 001750 001750 00000007476 12607616420 022776 0ustar00kylinkylin000000 000000 PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe<fiTXtXML:com.adobe.xmp nw^ nIDATxڤZk]E^39>IZM@mEr1Fkl4( 14F 6/5JocbXJ**Prz3˵<9m>Zz.mǮ]*5n㷙|6LQrl,_vRV!Bu9[U]X$Znp-,p.R:>\or [LV W`vWph50k18?LzsYZ:F{[qqe+yL־d#àEU"<2#b=GװB %e7k6FA$>`;ćB* Y vɁ]԰>+@ arf=K0K]l(= *9pS 5܆{F5}z 9-!)vJ'B]P>󨽏Hd.ҧ>h>kSo}hHkHPD yօ"@K8eKӁ:X|p TO݂zxƺصPU0\)5AZ-br%iRN(n%bIg@R(Zݷu/f:*B&c\jm;?>;_×=[;uu:9.+ׁ#Vv-['O|Ή6f SsXЎ&[XeQp/)<7ov5&&" Z#MT&H[|٥D_ߨ\yiH^$VjgQ>x{ٽȾ m9 9RԅxӶ{.*la(P-{},Գ1˴7  RSC]4kF,k~AӪtN8֓%w{^|Vo#vۅPR(tEKzh֜wQ# 1BB< 4Őj sƠ-#4:t4sDF$}[tf ͏RsgRGT,t#M|ap\.,'AţZ/S od[w…qiV @uL{y$|敏@u"&8r`FE^2kSM7R+4A%J N_Nloo51uIԱ_jp? jx S ^s x[@M)"UP5& F-:ju܎MkBQ8[y?)W䳮M ٞцyJd*˿I3?jc9Kِ(cc?1I/6>{*| SH*L gVL7@⿩Jt?M<|`:[#3HT?k҈+MVt缮Rbh`P xPVΟ=ׁ^[if5cmcQ QJ7#*ldolSd:M뺲Jtec=|\U&mn0rŧR_~6c6ˢ==.ʥ}9`XO*TZv,,qsTey)Q0^IENDB`unity-china-video-scope/.bzr/000775 001750 001750 00000000000 12607616420 016720 5ustar00kylinkylin000000 000000 unity-china-video-scope/po/000775 001750 001750 00000000000 12607616420 016463 5ustar00kylinkylin000000 000000 unity-china-video-scope/NEWS000664 001750 001750 00000000000 12607616420 016532 0ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/branch/last-revision000664 001750 001750 00000000073 12607616420 022677 0ustar00kylinkylin000000 000000 6 shuilupi@ubuntukylin.com-20151015025846-bqyxuxjnj82cf7sf unity-china-video-scope/.bzr/checkout/000775 001750 001750 00000000000 12607616421 020526 5ustar00kylinkylin000000 000000 unity-china-video-scope/po/en_US.po000664 001750 001750 00000004110 12607616420 020030 0ustar00kylinkylin000000 000000 # English 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-video-scope\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-02-06 11:27+0100\n" "PO-Revision-Date: 2012-02-06 11:28+0100\n" "Last-Translator: David Call \n" "Language-Team: English\n" "Language: en_US\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/remote-scope.vala:132 msgid "Online" msgstr "Online" #: ../src/remote-scope.vala:133 msgid "More suggestions" msgstr "More suggestions" #: ../src/remote-scope.vala:280 #, c-format msgid "%d min" msgid_plural "%d mins" msgstr[0] "%d min" msgstr[1] "%d mins" #: ../src/remote-scope.vala:291 msgid "Play" msgstr "Play" #: ../src/remote-scope.vala:302 msgid "Director" msgid_plural "Directors" msgstr[0] "Director" msgstr[1] "Directors" #: ../src/remote-scope.vala:305 msgid "Cast" msgstr "Cast" #: ../src/remote-scope.vala:308 msgid "Genre" msgid_plural "Genres" msgstr[0] "Genre" msgstr[1] "Genres" #: ../src/remote-scope.vala:312 msgid "Uploaded by" msgstr "Uploaded by" #: ../src/remote-scope.vala:315 msgid "Uploaded on" msgstr "Uploaded on" #: ../data/videoyouku.scope.in.in.h:1 msgid "Youku videos" msgstr "Youku videos" #: ../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 "" "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." unity-china-video-scope/Makefile.am000664 001750 001750 00000000173 12607616420 020102 0ustar00kylinkylin000000 000000 SUBDIRS = src po vapi data DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall include $(top_srcdir)/Makefile.am.coverage unity-china-video-scope/src/remote-scope-globals.vala000664 001750 001750 00000001434 12607616420 023526 0ustar00kylinkylin000000 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 { static int CAT_INDEX_ONLINE = 0; static int CAT_INDEX_MORE = 1; } unity-china-video-scope/m4/gcov.m4000664 001750 001750 00000004705 12607616420 017573 0ustar00kylinkylin000000 000000 # Checks for existence of coverage tools: # * gcov # * lcov # * genhtml # * gcovr # # Sets ac_cv_check_gcov to yes if tooling is present # and reports the executables to the variables LCOV, GCOVR and GENHTML. AC_DEFUN([AC_TDD_GCOV], [ AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov], [enable coverage testing with gcov]), [use_gcov=$enableval], [use_gcov=no]) if test "x$use_gcov" = "xyes"; then # we need gcc: if test "$GCC" != "yes"; then AC_MSG_ERROR([GCC is required for --enable-gcov]) fi # Check if ccache is being used AC_CHECK_PROG(SHTOOL, shtool, shtool) case `$SHTOOL path $CC` in *ccache*[)] gcc_ccache=yes;; *[)] gcc_ccache=no;; esac if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) fi lcov_version_list="1.6 1.7 1.8 1.9" AC_CHECK_PROG(LCOV, lcov, lcov) AC_CHECK_PROG(GENHTML, genhtml, genhtml) if test "$LCOV"; then AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [ glib_cv_lcov_version=invalid lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` for lcov_check_version in $lcov_version_list; do if test "$lcov_version" = "$lcov_check_version"; then glib_cv_lcov_version="$lcov_check_version (ok)" fi done ]) else lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" AC_MSG_ERROR([$lcov_msg]) fi case $glib_cv_lcov_version in ""|invalid[)] lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." AC_MSG_ERROR([$lcov_msg]) LCOV="exit 0;" ;; esac if test -z "$GENHTML"; then AC_MSG_ERROR([Could not find genhtml from the lcov package]) fi ac_cv_check_gcov=yes ac_cv_check_lcov=yes # Remove all optimization flags from CFLAGS changequote({,}) CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'` changequote([,]) # Add the special gcc flags COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage" COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage" COVERAGE_LDFLAGS="-lgcov" # Check availability of gcovr AC_CHECK_PROG(GCOVR, gcovr, gcovr) if test -z "$GCOVR"; then ac_cv_check_gcovr=no else ac_cv_check_gcovr=yes fi fi ]) # AC_TDD_GCOV unity-china-video-scope/po/POTFILES.skip000664 001750 001750 00000000054 12607616420 020577 0ustar00kylinkylin000000 000000 src/remote-scope.c src/youku-video-search.c unity-china-video-scope/src/remote-scope-globals.c000664 001750 001750 00000002043 12607616420 023022 0ustar00kylinkylin000000 000000 /* remote-scope-globals.c generated by valac 0.20.1, the Vala compiler * generated from remote-scope-globals.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 extern gint unity_video_lens_CAT_INDEX_ONLINE; gint unity_video_lens_CAT_INDEX_ONLINE = 0; extern gint unity_video_lens_CAT_INDEX_MORE; gint unity_video_lens_CAT_INDEX_MORE = 1; unity-china-video-scope/.bzr/repository/lock/000775 001750 001750 00000000000 12607616420 022067 5ustar00kylinkylin000000 000000 unity-china-video-scope/src/config.vala.in000664 001750 001750 00000000603 12607616420 021352 0ustar00kylinkylin000000 000000 namespace Config { const string PREFIX = "@prefix@"; const string DATADIR = "@DATADIR@"; const string PKGDATADIR = "@DATADIR@/unity"; const string BINDIR = "@prefix@/bin"; const string LOCALEDIR = "@DATADIR@/locale"; const string PACKAGE = "@PACKAGE@"; const string VERSION = "@VERSION@"; const string ICON_PATH = "@DATADIR@/icons/unity-icon-theme/places/svg"; } unity-china-video-scope/tests/unit/data/video1.avi000664 001750 001750 00000000000 12607616420 022755 0ustar00kylinkylin000000 000000 unity-china-video-scope/src/remote-video-main.c000664 001750 001750 00000012610 12607616420 022321 0ustar00kylinkylin000000 000000 /* remote-video-main.c generated by valac 0.20.1, the Vala compiler * generated from remote-video-main.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 . */ #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; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) extern UnityDeprecatedScope* unity_video_lens_scope; UnityDeprecatedScope* unity_video_lens_scope = NULL; extern GApplication* unity_video_lens_app; GApplication* unity_video_lens_app = NULL; #define UNITY_VIDEO_LENS_BUS_NAME "net.launchpad.scope.YoukuVideos" gint unity_video_lens_main (gchar** args, int args_length1); #define CONFIG_PACKAGE "unity-china-video-scope" #define CONFIG_LOCALEDIR "/usr/share/locale" static void ___lambda2_ (void); UnityVideoLensRemoteVideoScope* unity_video_lens_remote_video_scope_new (void); UnityVideoLensRemoteVideoScope* unity_video_lens_remote_video_scope_construct (GType object_type); GType unity_video_lens_remote_video_scope_get_type (void) G_GNUC_CONST; static void ____lambda2__unity_extras_create_scope_callback (gpointer self); static void ___lambda2_ (void) { UnityVideoLensRemoteVideoScope* _tmp0_; UnityDeprecatedScope* _tmp1_; GError * _inner_error_ = NULL; _tmp0_ = unity_video_lens_remote_video_scope_new (); _g_object_unref0 (unity_video_lens_scope); unity_video_lens_scope = (UnityDeprecatedScope*) _tmp0_; _tmp1_ = unity_video_lens_scope; unity_deprecated_scope_base_export ((UnityDeprecatedScopeBase*) _tmp1_, &_inner_error_); 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 ____lambda2__unity_extras_create_scope_callback (gpointer self) { ___lambda2_ (); } gint unity_video_lens_main (gchar** args, int args_length1) { gint result = 0; GApplication* _tmp4_; GApplication* _tmp5_; gint _tmp6_ = 0; GError * _inner_error_ = NULL; g_set_prgname ("unity-remote-video-scope"); textdomain (CONFIG_PACKAGE); bindtextdomain (CONFIG_PACKAGE, CONFIG_LOCALEDIR); bind_textdomain_codeset (CONFIG_PACKAGE, "UTF-8"); setlocale (LC_ALL, ""); { GApplication* _tmp0_ = NULL; GApplication* _tmp1_; _tmp0_ = unity_extras_dbus_own_name (UNITY_VIDEO_LENS_BUS_NAME, ____lambda2__unity_extras_create_scope_callback, NULL, &_inner_error_); _tmp1_ = _tmp0_; if (_inner_error_ != NULL) { goto __catch0_g_error; } _g_object_unref0 (unity_video_lens_app); unity_video_lens_app = _tmp1_; } goto __finally0; __catch0_g_error: { GError* e = NULL; GError* _tmp2_; const gchar* _tmp3_; e = _inner_error_; _inner_error_ = NULL; _tmp2_ = e; _tmp3_ = _tmp2_->message; g_warning ("remote-video-main.vala:47: Failed to start video lens daemon: %s\n", _tmp3_); result = 1; _g_error_free0 (e); return result; } __finally0: 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 0; } _tmp4_ = unity_video_lens_app; if (_tmp4_ == NULL) { g_warning ("remote-video-main.vala:53: %s", "Another instance of the Unity Videos Lens " "already appears to be running.\nBailing out.\n"); result = 2; return result; } _tmp5_ = unity_video_lens_app; _tmp6_ = g_application_run (_tmp5_, 0, NULL); result = _tmp6_; return result; } int main (int argc, char ** argv) { g_type_init (); return unity_video_lens_main (argv, argc); } unity-china-video-scope/.bzr/repository/indices/2422833eb61cb6fc21677a014bae1b9f.iix000664 001750 001750 00000000506 12607616417 027637 0ustar00kylinkylin000000 000000 B+Tree Graph Index 2 node_ref_lists=1 key_elements=1 len=6 row_lengths=1 xn q>/@3 U_դuV˄ fFUsUF#6}"tSxS}mf)|7!ƪ̡tmxTfp <2xI=[['T03 tp^Nq Rlkc8Q^vEjfCR)vǙaɔCt0Ms݌S%,s*3;"wunity-china-video-scope/.bzr/repository/indices/2422833eb61cb6fc21677a014bae1b9f.tix000664 001750 001750 00000003607 12607616417 027657 0ustar00kylinkylin000000 000000 B+Tree Graph Index 2 node_ref_lists=1 key_elements=2 len=107 row_lengths=1 xM )A`Uscb}A;k&.+7x?ȏRc 1X QYXU86L`*ꛩ[?=vMadҖ00S@4UVg*rhܘR˳Imn73tW c0m^T滷U|]rR*#6p_X9sApI ըsw78죸4ddd.{XM8NZ&LB/ҸLlSQ$<5Uqvae௳s-9Kn z#@9z}s#x}$xJ _uz?Ь@;tu*2t.[8FG爽&=ѷ2J۹ oͯDLQgjkٕ@n MBշN\Yum]P@[OyCxzn1Kf,.g_o ye'L3Ľk3jw[/>Is!^/gͥ/Xr ͛:Lmql_A.ͥ@e$R9$^c)T2rZxYD):rtoqqoא\?9maZw?liШ#) 禔i&ֈlm. h#\WܧsEԜC8Km2L/0n`KGR*ɞ%_zDpfG[zMQ RHO$St N>m$_#JaCmW^“E I~؂[;g{4f!UeNs Y}ح2*ж)Ȁ*1 Y_@}uHUۿ>[gm9 SAٺC{nF=7]n0 9'H8h6uT/K/q(8-zz Z`1mR-Gڵ5=}+vN{\ZC/6mɂMt&V(6Q)Fq:> 5oqxVՙ!ud Igpm2щk, >[Lü'YAPU0q pEB)V5:p$ )I0< &4בlQk;/HgG>0r9XMEB.`o[$CA"9FneфN3Éq.X]y_:kѺ)NttVFNZ0 |+#`5F DhvDʭRb5w\ܜciM^ We'"Yl[qM.<ػN\-KBB/ej4 E.CgpBj.pRW&i%Tz[2BBؚL ʚ­f͠- S!b0J ѢJATllIBfrЁ³nL?s \5"[[ _&c la\A݈;c3v&P71 EwN 8&CSQ%ZU{bӁ*. * * Authored by Pawel Stolowski */ namespace Unity.VideoLens { private Thumbnailer thumbnailer; private Locate locate; private string video_dir; private string user_videos_folder; public static int main (string[] args) { video_dir = Config.TESTDATADIR; user_videos_folder = GLib.Environment.get_user_special_dir (GLib.UserDirectory.VIDEOS); locate = new Locate ("cache", video_dir); thumbnailer = new Thumbnailer (); Test.init (ref args); Test.add_data_func ("/Locate/ParseLocateResults", test_parse); Test.add_data_func ("/Locate/LocateQueryString", test_query_string); Test.run (); return 0; } internal static void test_parse () { string input = @"$video_dir/video1.avi\n$video_dir/video2.avi\n$video_dir/video1.mpg\n$video_dir/video2.mpg\n"; var results = locate.parse_locate_results (input, 1000, thumbnailer, (path) => { return true; }); assert (results.size == 4); /* Filter out all results */ results = locate.parse_locate_results (input, 1000, thumbnailer, (path) => { return false; }); assert (results.size == 0); } internal static void test_query_string () { assert (locate.locate_query_string ("foo") == video_dir + "*foo*"); assert (locate.locate_query_string ("foo bar") == video_dir + "*foo*bar*"); } }unity-china-video-scope/tests/unit/000775 001750 001750 00000000000 12607616420 020166 5ustar00kylinkylin000000 000000 unity-china-video-scope/m4/000775 001750 001750 00000000000 12607616420 016365 5ustar00kylinkylin000000 000000 unity-china-video-scope/tests/unit/data/videosearch_input1.txt000664 001750 001750 00000001577 12607616420 025446 0ustar00kylinkylin000000 000000 { "other": [ { "url": "http://url0", "source": "source0", "img": "http://image0", "title": "title0" }, { "url": "http://url1", "source": "source1", "details": "http://details1", "img": "http://image1", "title": "title1" } ], "treats": [ { "img": "http://image2", "title": "title2", "url": "http://url2", "price": 1, "source": "source2", "details": "http://details2", "formatted_price": "1 USD" }, { "img": "http://image3", "title": "title3", "url": "http://url3", "price": 0, "source": "source3", "details": "http://details3", "formatted_price": "free" }, { "img": "http://image4", "title": "title4", "url": "http://url4", "source": "source4", "details": "http://details4" } ] } unity-china-video-scope/tests/manual/local-video-previews.txt000664 001750 001750 00000002347 12607616420 025273 0ustar00kylinkylin000000 000000 Preview of local video file --------------------------- Test that details of a local video file are displayed in the preview. Setup: Have some video files available in ~/Videos folder. Actions: 1. Open the Dash and switch to the video lens. 2. Make sure some video files from ~/Videos folder are displayed. 3. Right click a video file. Expected Result: Video preview should be displayed. Verify the preview display a sample video frame (a picture) and contains the following data: file name (as title), modification date and time (as subtitle) and 'Format', 'Dimensions', 'Size' info; 'Dimensions' should include resolution and aspect ratio, e.g. '1280:720, 16:9'. Preview of local video file - preview-player close -------------------------------------------------- Test that music-preview-player is closed automatically when not needed. Setup: Have some video files available in ~/Videos folder. Actions: 1. Open the Dash and switch to the video lens. 2. Make sure some video files from ~/Videos folder are displayed. 3. Right click a video file. 4. Close the preview. Expected Result: Video preview should be displayed. After closing the preview, verify with 'ps aux' that music-preview-player process disappears after approximately 1 minute. unity-china-video-scope/.bzr/checkout/views000664 001750 001750 00000000000 12607616420 021573 0ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/branch/000775 001750 001750 00000000000 12607616420 020155 5ustar00kylinkylin000000 000000 unity-china-video-scope/tests/manual/local-video-search.txt000664 001750 001750 00000001002 12607616420 024657 0ustar00kylinkylin000000 000000 Search a local video file --------------------------- Test that local video files in the ~/Videos folder are easily found Setup: Have some video files available in ~/Videos folder. Actions: 1. Open the Dash and switch to the video lens. 2. Make sure some video files from ~/Videos folder are displayed. 3. Search for multiple consecutive substrings of a video file name. Expected Result: Results matching the search should be displayed. For example, searching for "ubuntu 1" should returns "ubuntu_video1.avi". unity-china-video-scope/autogen.sh000775 001750 001750 00000000277 12607616420 020054 0ustar00kylinkylin000000 000000 #!/bin/sh srcdir=`dirname $0` PKG_NAME="unity-lens-video" which gnome-autogen.sh || { echo "You need gnome-common from GNOME SVN" exit 1 } USE_GNOME2_MACROS=1 \ . gnome-autogen.sh "$@" unity-china-video-scope/.bzr/branch-format000664 001750 001750 00000000043 12607616415 021367 0ustar00kylinkylin000000 000000 Bazaar-NG meta directory, format 1 unity-china-video-scope/ChangeLog000664 001750 001750 00000000000 12607616420 017605 0ustar00kylinkylin000000 000000 unity-china-video-scope/tests/unit/Makefile.am000664 001750 001750 00000005327 12607616420 022231 0ustar00kylinkylin000000 000000 include $(top_srcdir)/Makefile.decl check_PROGRAMS = \ test-locate \ test-utils \ test-ubuntu-video-search \ $(NULL) TEST_PROGS += $(check_PROGRAMS) AM_VALAFLAGS = \ --pkg dee-1.0 \ --pkg unity \ --pkg unity-extras \ --pkg gio-2.0 \ --pkg gio-unix-2.0 \ --pkg json-glib-1.0 \ --pkg glib-2.0 \ --pkg gee-0.8 \ --pkg zeitgeist-1.0 \ --pkg libsoup-gnome-2.4 \ --pkg libsoup-2.4 \ --vapidir $(srcdir) \ --vapidir $(top_srcdir)/vapi \ --target-glib=2.26 \ $(MAINTAINER_VALAFLAGS) \ $(NULL) LDADD = $(SCOPE_DAEMON_LIBS) \ $(test_libs) AM_CPPFLAGS = \ $(SCOPE_DAEMON_CFLAGS) \ -I$(srcdir) \ -I$(top_srcdir)/src \ -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ $(COVERAGE_CFLAGS) \ $(NULL) AM_LDFLAGS = $(COVERAGE_LDFLAGS) if !ENABLE_C_WARNINGS AM_CPPFLAGS += -w endif test_locate_VALASOURCES = \ test-locate.vala \ thumbnailer-mock.vala \ config-tests.vala \ $(top_srcdir)/src/locate.vala \ $(top_srcdir)/src/utils.vala \ $(top_srcdir)/src/video-file.vala \ $(NULL) test_utils_VALASOURCES = \ test-utils.vala \ config-tests.vala \ $(top_srcdir)/src/utils.vala \ $(NULL) test_ubuntu_video_search_VALASOURCES = \ test-ubuntu-video-search.vala \ config-tests.vala \ $(top_srcdir)/src/remote-scope-globals.vala \ $(top_srcdir)/src/ubuntu-video-search.vala \ $(top_srcdir)/src/video-file.vala \ $(top_srcdir)/src/remote-scope.vala \ $(top_srcdir)/src/remote-uri.vala \ $(top_srcdir)/src/utils.vala \ $(NULL) nodist_test_locate_SOURCES = $(test_locate_VALASOURCES:.vala=.c) nodist_test_utils_SOURCES = $(test_utils_VALASOURCES:.vala=.c) nodist_test_ubuntu_video_search_SOURCES = $(test_ubuntu_video_search_VALASOURCES:.vala=.c) CLEANFILES = *.stamp \ *.c \ $(NULL) EXTRA_DIST = \ $(test_locate_VALASOURCES) \ $(test_utils_VALASOURCES) \ $(test_ubuntu_video_search_VALASOURCES) \ data/videosearch_input1.txt \ data/videosearch_input2.txt \ data/videosearch_details1.txt \ data/video1.avi \ data/video2.avi \ data/video3.avi \ data/video1.mpg \ data/video2.mpg \ data/video3.mpg \ $(NULL) BUILT_SOURCES = \ test-locate.vala.stamp \ test-utils.vala.stamp \ test-ubuntu-video-search.vala.stamp \ $(NULL) test-locate.vala.stamp: $(test_locate_VALASOURCES) $(AM_V_GEN)$(VALAC) -C $(AM_VALAFLAGS) $(VALAFLAGS) $^ @touch $@ test-utils.vala.stamp: $(test_utils_VALASOURCES) $(AM_V_GEN)$(VALAC) -C $(AM_VALAFLAGS) $(VALAFLAGS) $^ @touch $@ test-ubuntu-video-search.vala.stamp: $(test_ubuntu_video_search_VALASOURCES) $(AM_V_GEN)$(VALAC) -C $(AM_VALAFLAGS) $(VALAFLAGS) $^ @touch $@ # START HEADLESS TESTS if ENABLE_HEADLESS_TESTS test-headless: $(XVFB) make test-nonrecursive; \ sleep 1; endif # END HEADLESS TESTS unity-china-video-scope/.bzr/repository/indices/2422833eb61cb6fc21677a014bae1b9f.rix000664 001750 001750 00000000515 12607616417 027650 0ustar00kylinkylin000000 000000 B+Tree Graph Index 2 node_ref_lists=1 key_elements=1 len=6 row_lengths=1 xMn0 FYs . I#*4!@sBUŨucy=ͩ}^6VȴOʾEp ||oPzPM9C]I5ބg}wcDIH*%O0 q)L @(AW8_[1 &Z |Cՙ 1 AS4Jҫ7"?sp؏Ć)蠟ƍδm8@BSyπ0A3T YAʚYG"4unity-china-video-scope/tests/unit/data/video2.avi000664 001750 001750 00000000000 12607616420 022756 0ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/repository/indices/000775 001750 001750 00000000000 12607616417 022563 5ustar00kylinkylin000000 000000 unity-china-video-scope/tests/unit/test-utils.vala000664 001750 001750 00000003460 12607616420 023153 0ustar00kylinkylin000000 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 static int main (string[] args) { Test.init (ref args); Test.add_data_func ("/Utils/Gcd", test_gcd); Test.add_data_func ("/Utils/IsRegularFile", test_is_regular_file); Test.add_data_func ("/Utils/GetName", test_get_name); Test.add_data_func ("/Utils/IsVideo", test_is_video); Test.run (); return 0; } internal static void test_gcd () { assert (Utils.gcd (1, 1) == 1); assert (Utils.gcd (2, 1) == 1); assert (Utils.gcd (10, 2) == 2); assert (Utils.gcd (2, 10) == 2); assert (Utils.gcd (20, 15) == 5); } internal static void test_is_regular_file () { assert (Utils.is_regular_file ("/etc/passwd") == true); assert (Utils.is_regular_file ("/dev/null") == false); assert (Utils.is_regular_file ("/non-existing-file") == false); } internal static void test_get_name () { assert (Utils.get_name ("/etc/passwd") == "passwd"); } internal static void test_is_video () { var video_dir = Config.TESTDATADIR; assert (Utils.is_video ("/etc/passwd") == false); assert (Utils.is_video (@"$video_dir/video1.avi") == true); } }unity-china-video-scope/data/unity-china-video-scope.service.in000664 001750 001750 00000000142 12607616420 025405 0ustar00kylinkylin000000 000000 [D-BUS Service] Name=net.launchpad.scope.YoukuVideos Exec=@pkglibexecdir@/unity-china-video-scope unity-china-video-scope/src/000775 001750 001750 00000000000 12607616420 016634 5ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/branch/lock/000775 001750 001750 00000000000 12607616421 021106 5ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/repository/packs/2422833eb61cb6fc21677a014bae1b9f.pack000664 001750 001750 00000253006 12607616417 027454 0ustar00kylinkylin000000 000000 Bazaar pack format 1 (introduced in 0.18) B5231 gcb1z 5215 7301 xy꒖='BB"a $#wo lvM}_ڻ})$@B_A2 !)"ߝ;FVo[USUiϬp.a(M3۶tD{afDK7/є6\wiPM }c?\Sßvq+A?/qQvᗵL_7Y}ECD_b1]˩/eO/0{gkLMb_ki7_QQe>%dᛵg٭~%.):]f4UUQԀ0牳#?t0UFn=9ipiG~E TnƹCp MTZ%s{)OlZnB|ջpJ+(jO$w{~V{\ XUG4 1X8BO9ܣ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IIuƟhHYu\dij`dJebb1w1T骭l!6ZZ8H<:hL!tZhb,+c˫ry&3}u1Uٸ:j<ڬ.m"tUEFMc1B5ɡP9- /?RR jM% P6)YtTP˸]n %%]rZp&lpt%EAUH G_g4!pz?o mkֶ|lpbw#G/f͵ڢ|Hk]15d4ۀQ5j(;,S:/?߹(#-˻eǟhcKA}7?Λnyh2ւ>{/dl *TfI/$}Su>d[=}p뾭 p( vŧ֠NЖ]%I'm]RnX>tٳ=[W?}D%u߳ugK6ڟzSY :l^{ }+cN?}Fpw-Yoٲ/.>fEunity-china-video-scope/tests/unit/data/video3.avi000664 001750 001750 00000000000 12607616420 022757 0ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/checkout/format000664 001750 001750 00000000050 12607616420 021733 0ustar00kylinkylin000000 000000 Bazaar Working Tree Format 6 (bzr 1.14) unity-china-video-scope/vapi/Makefile.am000664 001750 001750 00000000111 12607616420 021031 0ustar00kylinkylin000000 000000 NULL = BUILT_SOURCES = CLEANFILES = EXTRA_DIST = libsoup-gnome-2.4.vapi unity-china-video-scope/AUTHORS000664 001750 001750 00000000000 12607616420 017103 0ustar00kylinkylin000000 000000 unity-china-video-scope/.bzr/checkout/lock/000775 001750 001750 00000000000 12607616421 021456 5ustar00kylinkylin000000 000000 unity-china-video-scope/configure.ac000664 001750 001750 00000015571 12607616420 020344 0ustar00kylinkylin000000 000000 AC_INIT(unity-china-video-scope, 1.0, https://launchpad.net/unity-china-video-scope) AC_COPYRIGHT([Copyright 2013 National University of Defense Technology(NUDT) & Kylin Ltd]) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) ##################################################### # Silent build rules ##################################################### m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_PREREQ(2.59) AC_CONFIG_HEADERS([config.h]) ##################################################### # Init the other things we depend on ##################################################### AM_MAINTAINER_MODE AM_PROG_VALAC([0.16.0]) AS_IF([test -z "$VALAC"], [AC_MSG_ERROR(["No valac compiler found."])]) AC_PROG_CC AM_PROG_CC_C_O AC_HEADER_STDC LT_INIT AC_CONFIG_MACRO_DIR([m4]) ############################################# # Gettext ############################################# GETTEXT_PACKAGE="$PACKAGE" AC_SUBST(GETTEXT_PACKAGE) AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS']) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext domain]) AM_GLIB_GNU_GETTEXT # AM_GNOME_GETTEXT above substs $DATADIRNAME # this is the directory where the *.{mo,gmo} files are installed localedir='${prefix}/share/locale' AC_SUBST(localedir) IT_PROG_INTLTOOL([0.40.0]) AC_DEFINE_UNQUOTED(LOCALE_DIR, "${PREFIX}/share/locale",[Locale directory]) AC_DEFINE_UNQUOTED(DATADIR, "${PREFIX}/${DATADIRNAME}",[Data directory]) AC_DEFINE_UNQUOTED(PREFIXDIR, "${PREFIX}",[Prefix directory]) AC_SUBST([libexecdir],['${PREFIX}/lib']) ###################################################### # intltool rule for generating translated .scope file ###################################################### INTLTOOL_SCOPE_RULE='%.scope: %.scope.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' AC_SUBST(INTLTOOL_SCOPE_RULE) ########################### # gcov coverage reporting ########################### m4_include([m4/gcov.m4]) AC_TDD_GCOV AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes]) AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes]) AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes]) AC_SUBST(COVERAGE_CFLAGS) AC_SUBST(COVERAGE_LDFLAGS) ##################################################### # Check for module and library dependancies ##################################################### GLIB_REQUIRED=2.27 PKG_CHECK_MODULES(SCOPE_DAEMON, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED gio-unix-2.0 >= $GLIB_REQUIRED dee-1.0 >= 1.0.7 gee-0.8 libsoup-gnome-2.4 json-glib-1.0 zeitgeist-1.0 >= 0.3.8 unity >= 7.0.0 unity-extras >= 6.91.11 ) AC_SUBST(SCOPE_DAEMON_CFLAGS) AC_SUBST(SCOPE_DAEMON_LIBS) #################################################################### # C compiler warnings #################################################################### AC_ARG_ENABLE([c-warnings], AC_HELP_STRING([--enable-c-warnings=@<:@no/yes@:>@], [show warnings from the C compiler @<:@default=no@:>@]),, [enable_c_warnings=no]) if test "x$enable_c_warnings" = "xyes"; then AC_DEFINE(ENABLE_C_WARNINGS, 1, [show warnings from the C compiler]) fi AM_CONDITIONAL(ENABLE_C_WARNINGS, test "$enable_c_warnings" = "yes") ##################################################### # local install for distcheck and stand-alone running ##################################################### with_localinstall="no" AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], [Install all of the files locally instead of in system directories (for distcheck)]), with_localinstall=$enableval, with_localinstall=no) AM_CONDITIONAL([HAVE_LOCALINSTALL], [test "x$with_localinstall" = "xyes"]) #################################################################### # Headless tests #################################################################### AC_ARG_ENABLE([headless-tests], AS_HELP_STRING([--enable-headless-tests=@<:@no/yes@:>@],[enable headless test suite (requires Xvfb) @<:@default=no@:>@]),, [enable_headless_tests=no]) AM_CONDITIONAL([ENABLE_HEADLESS_TESTS],[test "x$enable_headless_tests" != "xno"]) if test "x$enable_headless_tests" = "xyes"; then AC_PATH_PROG([XVFB],[xvfb-run]) fi ##################################################### # local install for distcheck and stand-alone running ##################################################### with_localinstall="no" AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], [Install all of the files locally instead of in system directories (for distcheck)]), with_localinstall=$enableval, with_localinstall=no) AM_CONDITIONAL([HAVE_LOCALINSTALL], [test "x$with_localinstall" = "xyes"]) ##################################################### # Expand variables needed for config.vala ##################################################### AS_AC_EXPAND(PREFIX, $prefix) AC_SUBST(PREFIX) AS_AC_EXPAND(DATADIR, $datarootdir) AC_SUBST(DATADIR) ##################################################### # Look for dbus service dir ##################################################### if test "x$with_localinstall" = "xyes"; then DBUSSERVICEDIR="${datadir}/dbus-1/services/" else DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1` fi AC_SUBST(DBUSSERVICEDIR) ##################################################### # Look for correct Scopes dir ##################################################### if test "x$with_localinstall" = "xyes"; then SCOPESDIR="${datadir}/unity/scopes" else SCOPESDIR=`$PKG_CONFIG --variable=scopesdir unity` fi AC_SUBST(SCOPESDIR) ############################################# # GSettings macros ############################################# GLIB_GSETTINGS ##################################################### # Create the Makefiles ##################################################### AC_CONFIG_FILES([ Makefile data/Makefile data/videoyouku.scope.in src/Makefile po/Makefile.in src/config.vala vapi/Makefile ]) AC_OUTPUT ##################################################### # Output the results ##################################################### AC_MSG_NOTICE([ Unity China Video Lens Daemon $VERSION ---------------------------------- Prefix : ${prefix} Local install : ${with_localinstall} Extra CFlags : ${CPPFLAGS} $MAINTAINER_CFLAGS Extra ValaFlags : ${CPPFLAGS} $MAINTAINER_VALAFLAGS Scopes Directory: ${SCOPESDIR} Testing Headless tests : ${enable_headless_tests} Coverage reporting : ${use_gcov} ]) unity-china-video-scope/tests/unit/data/videosearch_input2.txt000664 001750 001750 00000000517 12607616420 025440 0ustar00kylinkylin000000 000000 [ { "url": "http://url0", "source": "source0", "img": "http://image0", "title": "title0" }, { "url": "http://url1", "source": "source1", "details": "http://details1", "img": "http://image1", "title": "title1", "price": 1, "formatted_price": "1 USD" } ] unity-china-video-scope/COPYING000664 001750 001750 00000104513 12607616420 017104 0ustar00kylinkylin000000 000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . unity-china-video-scope/.bzr/branch/tags000664 001750 001750 00000000343 12607616420 021036 0ustar00kylinkylin000000 000000 d12:1.1-0ubuntu157:package-import@ubuntu.com-20130720170130-c1wgqe9722gicv0d12:1.1-0ubuntu257:package-import@ubuntu.com-20130829004851-6jgjgqgdj0w1aym012:upstream-1.157:package-import@ubuntu.com-20130720170130-ngvubtekpiuzfrlseunity-china-video-scope/src/.libs/000775 001750 001750 00000000000 12607616420 017643 5ustar00kylinkylin000000 000000 unity-china-video-scope/tests/unit/config-tests.vala.in000664 001750 001750 00000000433 12607616420 024045 0ustar00kylinkylin000000 000000 namespace Config { const string TESTDATADIR = "@abs_top_srcdir@/tests/unit/data"; const string LOCALEDIR = "@DATADIR@/locale"; const string PACKAGE = "@PACKAGE@"; const string VERSION = "@VERSION@"; const string ICON_PATH = "@DATADIR@/icons/unity-icon-theme/places/svg"; } unity-china-video-scope/.bzr/branch/branch.conf000664 001750 001750 00000000160 12607616420 022256 0ustar00kylinkylin000000 000000 parent_location = bzr+ssh://bazaar.launchpad.net/~pishuilu1128/unity-china-video-scope/unity-china-video-scope/