format code

This commit is contained in:
kiselev-dv 2015-05-20 17:34:37 +05:00
parent e122898187
commit aba271ed6a
2 changed files with 13 additions and 10 deletions

View File

@ -75,8 +75,7 @@ void OutgoingDataCreator::SetClients(QList<RemoteClient*>* clients) {
SLOT(ResultsAvailable(int, SearchProvider::ResultList)), SLOT(ResultsAvailable(int, SearchProvider::ResultList)),
Qt::QueuedConnection); Qt::QueuedConnection);
connect(app_->global_search(), connect(app_->global_search(), SIGNAL(SearchFinished(int)),
SIGNAL(SearchFinished(int)),
SLOT(SearchFinished(int))); SLOT(SearchFinished(int)));
} }
@ -130,8 +129,8 @@ void OutgoingDataCreator::CheckEnabledProviders() {
} }
} }
SongInfoProvider* OutgoingDataCreator::ProviderByName(const QString& name) SongInfoProvider* OutgoingDataCreator::ProviderByName(
const { const QString& name) const {
for (SongInfoProvider* provider : fetcher_->providers()) { for (SongInfoProvider* provider : fetcher_->providers()) {
if (UltimateLyricsProvider* lyrics = if (UltimateLyricsProvider* lyrics =
qobject_cast<UltimateLyricsProvider*>(provider)) { qobject_cast<UltimateLyricsProvider*>(provider)) {
@ -656,14 +655,16 @@ void OutgoingDataCreator::SendKitten(const QImage& kitten) {
} }
} }
void OutgoingDataCreator::DoGlobalSearch(const QString &query, RemoteClient *client) { void OutgoingDataCreator::DoGlobalSearch(const QString& query,
RemoteClient* client) {
int id = app_->global_search()->SearchAsync(query); int id = app_->global_search()->SearchAsync(query);
GlobalSearchRequest request(id, query, client); GlobalSearchRequest request(id, query, client);
global_search_result_map_.insert(id, request); global_search_result_map_.insert(id, request);
} }
void OutgoingDataCreator::ResultsAvailable(int id, const SearchProvider::ResultList& results) { void OutgoingDataCreator::ResultsAvailable(
int id, const SearchProvider::ResultList& results) {
if (!global_search_result_map_.contains(id)) return; if (!global_search_result_map_.contains(id)) return;
GlobalSearchRequest search_request = global_search_result_map_.value(id); GlobalSearchRequest search_request = global_search_result_map_.value(id);
@ -671,12 +672,14 @@ void OutgoingDataCreator::ResultsAvailable(int id, const SearchProvider::ResultL
QImage null_img; QImage null_img;
pb::remote::Message msg; pb::remote::Message msg;
pb::remote::ResponseGlobalSearch* response = msg.mutable_response_global_search(); pb::remote::ResponseGlobalSearch* response =
msg.mutable_response_global_search();
msg.set_type(pb::remote::GLOBAL_SEARCH_RESULT); msg.set_type(pb::remote::GLOBAL_SEARCH_RESULT);
response->set_id(search_request.id_); response->set_id(search_request.id_);
response->set_query(DataCommaSizeFromQString(search_request.query_)); response->set_query(DataCommaSizeFromQString(search_request.query_));
response->set_search_provider(DataCommaSizeFromQString(results.first().provider_->name())); response->set_search_provider(
DataCommaSizeFromQString(results.first().provider_->name()));
// Append the icon // Append the icon
QImage icon_image(results.first().provider_->icon().pixmap(48, 48).toImage()); QImage icon_image(results.first().provider_->icon().pixmap(48, 48).toImage());