Fix problems with code

This commit is contained in:
Krzysztof Sobiecki 2014-12-14 14:35:21 +01:00
parent bf55bc08fb
commit ba1d73d1aa
5 changed files with 12 additions and 11 deletions

View File

@ -143,8 +143,8 @@ void InternetModel::AddService(InternetService* service) {
SIGNAL(ScrollToIndex(QModelIndex)));
connect(service, SIGNAL(destroyed()), SLOT(ServiceDeleted()));
if (service->hasLoadSettings()) {
service->LoadSettings();
if (service->has_initial_load_settings()) {
service->InitialLoadSettings();
} else {
service->ReloadSettings();
}

View File

@ -48,8 +48,8 @@ class InternetService : public QObject {
virtual QStandardItem* CreateRootItem() = 0;
virtual void LazyPopulate(QStandardItem* parent) = 0;
virtual bool hasLoadSettings() const { return false; }
virtual void LoadSettings() {}
virtual bool has_initial_load_settings() const { return false; }
virtual void InitialLoadSettings() {}
virtual void ShowContextMenu(const QPoint& global_pos) {}
virtual void ItemDoubleClicked(QStandardItem* item) {}
// Create a generator for smart playlists

View File

@ -214,9 +214,10 @@ void PodcastParser::ParseItem(QXmlStreamReader* reader, Podcast* ret) const {
episode.set_publication_date(Utilities::ParseRFC822DateTime(date));
if (!episode.publication_date().isValid()) {
qLog(Error) << "Unable to parse date:" << date
<< "Pleas submit it to "
"https://github.com/clementine-player/Clementine/"
"issues/new";
<< "Please submit it to "
"> https://github.com/clementine-player/Clementine/"
"issues/new?title=[podcast] Unable to parse date:"
<< date <<" <";
}
} else if (name == "duration" && lower_namespace == kItunesNamespace) {
// http://www.apple.com/itunes/podcasts/specs.html

View File

@ -551,12 +551,12 @@ void PodcastService::RemoveSelectedPodcast() {
}
void PodcastService::ReloadSettings() {
LoadSettings();
InitialLoadSettings();
ClearPodcastList(model_->invisibleRootItem());
PopulatePodcastList(model_->invisibleRootItem());
}
void PodcastService::LoadSettings() {
void PodcastService::InitialLoadSettings() {
QSettings s;
s.beginGroup(LibraryView::kSettingsGroup);
use_pretty_covers_ = s.value("pretty_covers", true).toBool();

View File

@ -58,10 +58,10 @@ class PodcastService : public InternetService {
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* parent);
bool hasLoadSettings() const { return true; }
bool has_initial_load_settings() const { return true; }
void ShowContextMenu(const QPoint& global_pos);
void ReloadSettings();
void LoadSettings();
void InitialLoadSettings();
// Called by SongLoader when the user adds a Podcast URL directly. Adds a
// subscription to the podcast and displays it in the UI. If the QVariant
// contains an OPML file then this displays it in the Add Podcast dialog.