Fixed broken "sync on startup" preference.

This commit is contained in:
casey langen 2017-04-09 12:20:15 -07:00
parent 1dd69725f5
commit 63381607a9
2 changed files with 10 additions and 6 deletions

View File

@ -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) */

View File

@ -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();
}
}
}