MCPcopy Create free account
hub / github.com/Cubitect/cubiomes-viewer / updateSearchProgress

Method updateSearchProgress

src/formsearchcontrol.cpp:739–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737}
738
739void FormSearchControl::updateSearchProgress(uint64_t prog, uint64_t end, int64_t seed)
740{
741 ui->lineStart->setText(QString::asprintf("%" PRId64, seed));
742
743 if (!end)
744 return;
745
746 double value = (double)prog / end;
747 int v = (int) floor(10000 * value);
748 ui->progressBar->setValue(v);
749 QString fmt = QString::asprintf(
750 "%" PRIu64 " / %" PRIu64 " (%d.%02d%%)",
751 prog, end, v / 100, v % 100
752 );
753 int searchtype = ui->comboSearchType->currentData().toInt();
754 if (searchtype == SEARCH_LIST)
755 {
756 if (!slist64fnam.isEmpty())
757 {
758 fmt = slist64fnam + ": " + fmt;
759 }
760 }
761 if (searchtype == SEARCH_INC)
762 {
763 if (smin != 0 || smax != ~(uint64_t)0)
764 {
765 fmt = QString::asprintf("[%" PRIu64 " - %" PRIu64 "]: ", smin, smax) + fmt;
766 }
767 }
768 ui->progressBar->setFormat(fmt);
769
770 if (parent)
771 parent->setProgressIndication(value);
772}
773
774void FormSearchControl::searchFinish(bool done)
775{

Callers

nothing calls this directly

Calls 1

setProgressIndicationMethod · 0.80

Tested by

no test coverage detected