From a4e9116570c5bc6fee8368d9ce16a24547026cba Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 2 Sep 2025 11:20:54 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp') diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp index 929b7be6..df0c5781 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Chrono.cpp @@ -75,14 +75,10 @@ void Chrono::schedule(const std::chrono::time_point& this->timer.start(delay); } -QString Chrono::format() const { return this->mFormat; } -void Chrono::setFormat(QString format) { - if (format == this->mFormat) return; - this->mFormat = format; - emit this->formatChanged(); - this->update(); +QString Chrono::format(const QString& fmt) const { + return QString::fromStdString(std::format(std::runtime_format(fmt.toStdString()), std::chrono::zoned_time(std::chrono::current_zone(), std::chrono::time_point_cast(this->currentTime)))); } -QString Chrono::date() const { - return QString::fromStdString(std::format(std::runtime_format(this->mFormat.toStdString()), std::chrono::zoned_time(std::chrono::current_zone(), std::chrono::time_point_cast(this->currentTime)))); +QDateTime Chrono::date() const { + return QDateTime::fromStdTimePoint(std::chrono::time_point_cast(this->currentTime)); } -- cgit v1.2.3