mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-30 04:20:47 +00:00
Fixed broken "sync on startup" preference.
This commit is contained in:
parent
1dd69725f5
commit
63381607a9
@ -143,7 +143,7 @@ int main(int argc, char* argv[])
|
||||
#endif
|
||||
/* fire up the indexer if configured to run on startup */
|
||||
if (prefs->GetBool(musik::core::prefs::keys::SyncOnStartup, true)) {
|
||||
library->Indexer()->Schedule(IIndexer::SyncType::Sources);
|
||||
library->Indexer()->Schedule(IIndexer::SyncType::All);
|
||||
}
|
||||
|
||||
/* set color mode (basic, palette, rgb) */
|
||||
|
@ -94,6 +94,10 @@ void MainLayout::OnLayout() {
|
||||
yOffset = 1;
|
||||
this->syncing->MoveAndResize(0, 0, cx, 1);
|
||||
this->syncing->Show();
|
||||
|
||||
if (this->syncUpdateCount == 0) {
|
||||
updateSyncingText(this->syncing.get(), 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this->syncing->Hide();
|
||||
@ -245,12 +249,8 @@ bool MainLayout::KeyPress(const std::string& key) {
|
||||
void MainLayout::ProcessMessage(musik::core::runtime::IMessage &message) {
|
||||
int type = message.Type();
|
||||
if (type == message::IndexerStarted) {
|
||||
updateSyncingText(this->syncing.get(), 0);
|
||||
this->syncUpdateCount = 0;
|
||||
|
||||
if (!syncing->IsVisible()) {
|
||||
this->Layout();
|
||||
}
|
||||
this->Layout();
|
||||
}
|
||||
else if (type == message::IndexerFinished) {
|
||||
this->Layout();
|
||||
@ -258,6 +258,10 @@ void MainLayout::ProcessMessage(musik::core::runtime::IMessage &message) {
|
||||
else if (type == message::IndexerProgress) {
|
||||
this->syncUpdateCount += (int)message.UserData1();
|
||||
updateSyncingText(this->syncing.get(), this->syncUpdateCount);
|
||||
|
||||
if (!syncing->IsVisible()) {
|
||||
this->Layout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user