Fix problems with code
This commit is contained in:
parent
bf55bc08fb
commit
ba1d73d1aa
@ -143,8 +143,8 @@ void InternetModel::AddService(InternetService* service) {
|
|||||||
SIGNAL(ScrollToIndex(QModelIndex)));
|
SIGNAL(ScrollToIndex(QModelIndex)));
|
||||||
connect(service, SIGNAL(destroyed()), SLOT(ServiceDeleted()));
|
connect(service, SIGNAL(destroyed()), SLOT(ServiceDeleted()));
|
||||||
|
|
||||||
if (service->hasLoadSettings()) {
|
if (service->has_initial_load_settings()) {
|
||||||
service->LoadSettings();
|
service->InitialLoadSettings();
|
||||||
} else {
|
} else {
|
||||||
service->ReloadSettings();
|
service->ReloadSettings();
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ class InternetService : public QObject {
|
|||||||
|
|
||||||
virtual QStandardItem* CreateRootItem() = 0;
|
virtual QStandardItem* CreateRootItem() = 0;
|
||||||
virtual void LazyPopulate(QStandardItem* parent) = 0;
|
virtual void LazyPopulate(QStandardItem* parent) = 0;
|
||||||
virtual bool hasLoadSettings() const { return false; }
|
virtual bool has_initial_load_settings() const { return false; }
|
||||||
virtual void LoadSettings() {}
|
virtual void InitialLoadSettings() {}
|
||||||
virtual void ShowContextMenu(const QPoint& global_pos) {}
|
virtual void ShowContextMenu(const QPoint& global_pos) {}
|
||||||
virtual void ItemDoubleClicked(QStandardItem* item) {}
|
virtual void ItemDoubleClicked(QStandardItem* item) {}
|
||||||
// Create a generator for smart playlists
|
// Create a generator for smart playlists
|
||||||
|
@ -214,9 +214,10 @@ void PodcastParser::ParseItem(QXmlStreamReader* reader, Podcast* ret) const {
|
|||||||
episode.set_publication_date(Utilities::ParseRFC822DateTime(date));
|
episode.set_publication_date(Utilities::ParseRFC822DateTime(date));
|
||||||
if (!episode.publication_date().isValid()) {
|
if (!episode.publication_date().isValid()) {
|
||||||
qLog(Error) << "Unable to parse date:" << date
|
qLog(Error) << "Unable to parse date:" << date
|
||||||
<< "Pleas submit it to "
|
<< "Please submit it to "
|
||||||
"https://github.com/clementine-player/Clementine/"
|
"> https://github.com/clementine-player/Clementine/"
|
||||||
"issues/new";
|
"issues/new?title=[podcast] Unable to parse date:"
|
||||||
|
<< date <<" <";
|
||||||
}
|
}
|
||||||
} else if (name == "duration" && lower_namespace == kItunesNamespace) {
|
} else if (name == "duration" && lower_namespace == kItunesNamespace) {
|
||||||
// http://www.apple.com/itunes/podcasts/specs.html
|
// http://www.apple.com/itunes/podcasts/specs.html
|
||||||
|
@ -551,12 +551,12 @@ void PodcastService::RemoveSelectedPodcast() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PodcastService::ReloadSettings() {
|
void PodcastService::ReloadSettings() {
|
||||||
LoadSettings();
|
InitialLoadSettings();
|
||||||
ClearPodcastList(model_->invisibleRootItem());
|
ClearPodcastList(model_->invisibleRootItem());
|
||||||
PopulatePodcastList(model_->invisibleRootItem());
|
PopulatePodcastList(model_->invisibleRootItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PodcastService::LoadSettings() {
|
void PodcastService::InitialLoadSettings() {
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(LibraryView::kSettingsGroup);
|
s.beginGroup(LibraryView::kSettingsGroup);
|
||||||
use_pretty_covers_ = s.value("pretty_covers", true).toBool();
|
use_pretty_covers_ = s.value("pretty_covers", true).toBool();
|
||||||
|
@ -58,10 +58,10 @@ class PodcastService : public InternetService {
|
|||||||
|
|
||||||
QStandardItem* CreateRootItem();
|
QStandardItem* CreateRootItem();
|
||||||
void LazyPopulate(QStandardItem* parent);
|
void LazyPopulate(QStandardItem* parent);
|
||||||
bool hasLoadSettings() const { return true; }
|
bool has_initial_load_settings() const { return true; }
|
||||||
void ShowContextMenu(const QPoint& global_pos);
|
void ShowContextMenu(const QPoint& global_pos);
|
||||||
void ReloadSettings();
|
void ReloadSettings();
|
||||||
void LoadSettings();
|
void InitialLoadSettings();
|
||||||
// Called by SongLoader when the user adds a Podcast URL directly. Adds a
|
// 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
|
// 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.
|
// contains an OPML file then this displays it in the Add Podcast dialog.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user