mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-14 13:21:13 +00:00
Ensure remote library settings are always saved.
This commit is contained in:
parent
ed4869298c
commit
60a206a2d6
@ -73,6 +73,7 @@ RemoteLibrarySettingsLayout::RemoteLibrarySettingsLayout()
|
||||
}
|
||||
|
||||
RemoteLibrarySettingsLayout::~RemoteLibrarySettingsLayout() {
|
||||
this->SavePreferences();
|
||||
}
|
||||
|
||||
void RemoteLibrarySettingsLayout::OnLayout() {
|
||||
@ -218,7 +219,7 @@ void RemoteLibrarySettingsLayout::LoadPreferences() {
|
||||
this->httpTlsCheckbox->CheckChanged.connect(this, &RemoteLibrarySettingsLayout::OnTlsCheckboxChanged);
|
||||
}
|
||||
|
||||
void RemoteLibrarySettingsLayout::LoadPreferencesAndLayout() {
|
||||
void RemoteLibrarySettingsLayout::SyncPreferencesAndLayout() {
|
||||
this->SavePreferences();
|
||||
this->LoadPreferences();
|
||||
this->Layout();
|
||||
@ -255,12 +256,12 @@ void RemoteLibrarySettingsLayout::SavePreferences() {
|
||||
|
||||
void RemoteLibrarySettingsLayout::OnActivateTranscoderFormat(cursespp::TextLabel* tl) {
|
||||
SettingsOverlays::ShowTranscoderFormatOverlay([this]() {
|
||||
this->LoadPreferencesAndLayout();
|
||||
this->SyncPreferencesAndLayout();
|
||||
});
|
||||
}
|
||||
|
||||
void RemoteLibrarySettingsLayout::OnActivateTranscoderBitrate(cursespp::TextLabel* tl) {
|
||||
SettingsOverlays::ShowTranscoderBitrateOverlay([this]() {
|
||||
this->LoadPreferencesAndLayout();
|
||||
this->SyncPreferencesAndLayout();
|
||||
});
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace musik { namespace cube {
|
||||
|
||||
private:
|
||||
void InitializeWindows();
|
||||
void LoadPreferencesAndLayout();
|
||||
void SyncPreferencesAndLayout();
|
||||
|
||||
void OnTlsCheckboxChanged(cursespp::Checkbox* cb, bool checked);
|
||||
void OnActivateTranscoderFormat(cursespp::TextLabel* tl);
|
||||
|
@ -199,8 +199,8 @@ class FileReadStream {
|
||||
}
|
||||
|
||||
clearerr(this->file);
|
||||
int available = this->length - this->Position();
|
||||
unsigned actualReadBytes = std::max(0, std::min(available, (int) readBytes));
|
||||
const int available = this->length - this->Position();
|
||||
const unsigned actualReadBytes = std::max(0, std::min(available, (int) readBytes));
|
||||
return (PositionType) fread(buffer, 1, actualReadBytes, this->file);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user