summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp')
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/FileSelector.cpp5
1 files changed, 3 insertions, 2 deletions
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;
12 12
13FileSelector::FileSelector(QObject* parent): QObject(parent) { 13FileSelector::FileSelector(QObject* parent): QObject(parent) {
14 QObject::connect(&this->timer, &QTimer::timeout, this, &FileSelector::onTimeout); 14 QObject::connect(&this->timer, &QTimer::timeout, this, &FileSelector::onTimeout);
15 this->timer.setTimerType(Qt::PreciseTimer);
15} 16}
16 17
17QString FileSelector::directory() const { 18QString FileSelector::directory() const {
@@ -83,8 +84,8 @@ void FileSelector::onTimeout() {
83 84
84 auto currentTime = std::chrono::system_clock::now(); 85 auto currentTime = std::chrono::system_clock::now();
85 uint64_t currentMinorEpoch = currentTime.time_since_epoch() / (*this->mEpoch / this->mFiles.size()); 86 uint64_t currentMinorEpoch = currentTime.time_since_epoch() / (*this->mEpoch / this->mFiles.size());
86 auto nextTime = std::chrono::time_point<std::chrono::system_clock>((2 * currentMinorEpoch + 3) * (*this->mEpoch / (this->mFiles.size() * 2))); 87 auto nextTime = std::chrono::time_point<std::chrono::system_clock>((currentMinorEpoch + 1) * (*this->mEpoch / this->mFiles.size()));
87 this->timer.start(std::chrono::duration_cast<std::chrono::milliseconds>(nextTime - currentTime).count()); 88 this->timer.start(std::chrono::duration_cast<std::chrono::milliseconds>(nextTime - currentTime));
88 89
89 emit this->selectedChanged(); 90 emit this->selectedChanged();
90} 91}