void SubsonicService::LazyPopulate(QStandardItem* item) { switch (item->data(InternetModel::Role_Type).toInt()) { case InternetModel::Type_Service: library_model_->Init(); if (login_state() != LoginState_Loggedin) { ShowConfig(); } else if (total_song_count_ == 0 && !load_database_task_id_) { ReloadDatabase(); } model()->merged_model()->AddSubModel(item->index(), library_sort_model_); break; default: break; } }
void VkAuth::get_access_token() { common::log("get_access_token"); QUrl url = web_view->url(); common::log(url.toString()); QUrlQuery url_query(url.toString().replace("#", "&")); common::OAuthData oauth_data; oauth_data.access_token = url_query.queryItemValue("access_token"); oauth_data.user_id = url_query.queryItemValue("user_id"); common::log(oauth_data.access_token); emit login_state((oauth_data.access_token.isEmpty() ? false : true), oauth_data); step = 0; }