From 029f4bd118eb3f1eca69ed3a7128997f077e0512 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 4 Sep 2025 22:59:52 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp') diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp index a3a35273..d7051d2a 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp @@ -12,6 +12,7 @@ namespace fs = std::filesystem; FileSelector::FileSelector(QObject* parent): QObject(parent) { QObject::connect(&this->timer, &QTimer::timeout, this, &FileSelector::onTimeout); + this->timer.setTimerType(Qt::PreciseTimer); } QString FileSelector::directory() const { @@ -83,8 +84,8 @@ void FileSelector::onTimeout() { auto currentTime = std::chrono::system_clock::now(); uint64_t currentMinorEpoch = currentTime.time_since_epoch() / (*this->mEpoch / this->mFiles.size()); - auto nextTime = std::chrono::time_point((2 * currentMinorEpoch + 3) * (*this->mEpoch / (this->mFiles.size() * 2))); - this->timer.start(std::chrono::duration_cast(nextTime - currentTime).count()); + auto nextTime = std::chrono::time_point((currentMinorEpoch + 1) * (*this->mEpoch / this->mFiles.size())); + this->timer.start(std::chrono::duration_cast(nextTime - currentTime)); emit this->selectedChanged(); } -- cgit v1.2.3