Merge lp:~xavi-garcia-mena/unity-scope-youtube/disable-oa-button into lp:unity-scope-youtube

Proposed by Xavi Garcia
Status: Rejected
Rejected by: Pete Woods
Proposed branch: lp:~xavi-garcia-mena/unity-scope-youtube/disable-oa-button
Merge into: lp:unity-scope-youtube
Diff against target: 76 lines (+25/-23)
2 files modified
src/youtube/scope/query.cpp (+2/-0)
src/youtube/scope/scope.cpp (+23/-23)
To merge this branch: bzr merge lp:~xavi-garcia-mena/unity-scope-youtube/disable-oa-button
Reviewer Review Type Date Requested Status
Marcus Tomlinson (community) Approve
Review via email: mp+241708@code.launchpad.net

Description of the change

Login button has been disabled. It will not appear in the surfacing screen.

To post a comment you must log in.
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

So unfortunately this change is not enough to fix the related bug.

To avoid the splash screen popping up, we would need to comment out our instantiation of oa_client_ in start(), and then any code that uses oa_client_. Its the stuff in OnlineAccountClient that causes the splash screen to show up.

I don't like that we're doing this actually. The real bug is: https://bugs.launchpad.net/qtmir/+bug/1352251

and then: https://bugs.launchpad.net/ubuntu-system-settings-online-accounts/+bug/1380914

review: Needs Fixing
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

For future reference, here's how to recreate the issue:

1. Go to Settings->Accounts.
2. Remove your Google account(s) (if you have any).
3. Add your Google account.
4. Open the newly created Google account and enable Youtube.
5. Go to the Youtube scope (if favourited, you may need to enter a space into the search bar)

118. By Xavi Garcia

Commented out all refferences to OA in order to prevent the black Online Accounts showing up

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Unfortunately yes, this is "correct".

review: Approve

Unmerged revisions

118. By Xavi Garcia

Commented out all refferences to OA in order to prevent the black Online Accounts showing up

117. By Xavi Garcia

Disabled OA login button

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/youtube/scope/query.cpp'
2--- src/youtube/scope/query.cpp 2014-09-24 12:24:37 +0000
3+++ src/youtube/scope/query.cpp 2014-11-14 08:09:14 +0000
4@@ -520,6 +520,8 @@
5
6 void Query::surfacing(const sc::SearchReplyProxy &reply) {
7 bool include_login_nag = !client_->config()->authenticated;
8+ // Disable login button for bug https://bugs.launchpad.net/unity-scope-youtube/+bug/1391595
9+ include_login_nag = false;
10
11 const sc::CannedQuery &query(sc::SearchQueryBase::query());
12
13
14=== modified file 'src/youtube/scope/scope.cpp'
15--- src/youtube/scope/scope.cpp 2014-11-03 10:10:36 +0000
16+++ src/youtube/scope/scope.cpp 2014-11-14 08:09:14 +0000
17@@ -40,15 +40,15 @@
18 std::lock_guard<std::mutex> lock(config_mutex_);
19 init_config();
20
21- for (auto const& status : oa_client_->get_service_statuses()) {
22- if (status.service_authenticated) {
23- config_->authenticated = true;
24- config_->access_token = status.access_token;
25- config_->client_id = status.client_id;
26- config_->client_secret = status.client_secret;
27- break;
28- }
29- }
30+// for (auto const& status : oa_client_->get_service_statuses()) {
31+// if (status.service_authenticated) {
32+// config_->authenticated = true;
33+// config_->access_token = status.access_token;
34+// config_->client_id = status.client_id;
35+// config_->client_secret = status.client_secret;
36+// break;
37+// }
38+// }
39
40 if (!config_->authenticated) {
41 cerr << "YouTube scope is unauthenticated" << endl;
42@@ -72,20 +72,20 @@
43 + "/../share/locale/";
44 bindtextdomain(GETTEXT_PACKAGE, translation_directory.c_str());
45
46- if (getenv("YOUTUBE_SCOPE_IGNORE_ACCOUNTS") == nullptr) {
47- oa_client_.reset(
48- new sc::OnlineAccountClient(SCOPE_INSTALL_NAME,
49- "sharing", "google"));
50- oa_client_->set_service_update_callback(
51- std::bind(&Scope::service_update, this, std::placeholders::_1));
52-
53- ///! TODO: We should only be waiting here if we know that there is at least one Google account enabled.
54- /// OnlineAccountClient needs to expose some functionality for us to determine that.
55-
56- // Allow 1 second for the callback to initialize config_
57- std::unique_lock<std::mutex> lock(config_mutex_);
58- config_cond_.wait_for(lock, std::chrono::seconds(1), [this] { return config_ != nullptr; });
59- }
60+// if (getenv("YOUTUBE_SCOPE_IGNORE_ACCOUNTS") == nullptr) {
61+// oa_client_.reset(
62+// new sc::OnlineAccountClient(SCOPE_INSTALL_NAME,
63+// "sharing", "google"));
64+// oa_client_->set_service_update_callback(
65+// std::bind(&Scope::service_update, this, std::placeholders::_1));
66+//
67+// ///! TODO: We should only be waiting here if we know that there is at least one Google account enabled.
68+// /// OnlineAccountClient needs to expose some functionality for us to determine that.
69+//
70+// // Allow 1 second for the callback to initialize config_
71+// std::unique_lock<std::mutex> lock(config_mutex_);
72+// config_cond_.wait_for(lock, std::chrono::seconds(1), [this] { return config_ != nullptr; });
73+// }
74 if (config_ == nullptr) {
75 // If the callback was not invoked, default initialize config_
76 init_config();

Subscribers

People subscribed via source and target branches

to all changes: