Skip to content

Commit

Permalink
Make background steams build-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
xif-fr committed Nov 28, 2021
1 parent bbc5f94 commit 49ce0c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/ui/backgroundstreamssettingspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,24 @@

BackgroundStreamsSettingsPage::BackgroundStreamsSettingsPage(
SettingsDialog* dialog)
: SettingsPage(dialog), ui_(new Ui_BackgroundStreamsSettingsPage) {
: SettingsPage(dialog),
ui_(new Ui_BackgroundStreamsSettingsPage),
loaded_(false) {
ui_->setupUi(this);
setWindowIcon(
IconLoader::Load("weather-showers-scattered", IconLoader::Base));

for (const QString& name : dialog->background_streams()->streams()) {
AddStream(name);
}
}

BackgroundStreamsSettingsPage::~BackgroundStreamsSettingsPage() { delete ui_; }

void BackgroundStreamsSettingsPage::Load() {}
void BackgroundStreamsSettingsPage::Load() {
if (!loaded_ and dialog()->background_streams()) {
for (const QString& name : dialog()->background_streams()->streams()) {
AddStream(name);
}
loaded_ = true;
}
}

void BackgroundStreamsSettingsPage::Save() {
dialog()->background_streams()->SaveStreams();
Expand Down
1 change: 1 addition & 0 deletions src/ui/backgroundstreamssettingspage.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class BackgroundStreamsSettingsPage : public SettingsPage {

private:
Ui_BackgroundStreamsSettingsPage* ui_;
bool loaded_;
};

#endif // BACKGROUNDSTREAMSSETTINGSPAGE_H

0 comments on commit 49ce0c6

Please sign in to comment.