Exemplo n.º 1
0
LastFMSearchProvider::LastFMSearchProvider(LastFMService* service,
                                           Application* app, QObject* parent)
  : SimpleSearchProvider(app, parent),
    service_(service) {
  Init("Last.fm", "lastfm", QIcon(":last.fm/as.png"),
       CanShowConfig | CanGiveSuggestions);
  icon_ = ScaleAndPad(QImage(":last.fm/as.png"));

  set_safe_words(QStringList() << "lastfm" << "last.fm");

  connect(service, SIGNAL(SavedItemsChanged()), SLOT(MaybeRecreateItems()));

  // Load the friends list on startup only if it doesn't involve going to update
  // info from the server.
  if (!service_->IsFriendsListStale())
    RecreateItems();
}
DigitallyImportedSearchProvider::DigitallyImportedSearchProvider(
  DigitallyImportedServiceBase* service, QObject* parent)
    : SimpleSearchProvider(parent),
      service_(service)
{
  Init(service_->name(), service->api_service_name(), service_->icon(),
       ArtIsInSongMetadata | CanGiveSuggestions | CanShowConfig);

  set_safe_words(QStringList() << "sky.fm" << "skyfm" << "di.fm" << "difm"
                               << "digitallyimported");

  connect(service_, SIGNAL(StreamsChanged()), SLOT(MaybeRecreateItems()));

  // Load the channel list on startup only if it doesn't involve going to update
  // info from the server.
  if (!service_->IsChannelListStale())
    RecreateItems();
}