Skip to content

Commit f46c6df

Browse files
committed
Automatically show correct year in about box
As it is a Qt project it is better to use QDate
1 parent a6c76f5 commit f46c6df

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

addon/doxywizard/doxywizard.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "version.h"
1515
#include "expert.h"
1616
#include "wizard.h"
17-
#include <ctime>
1817

1918
#include <QMenu>
2019
#include <QMenuBar>
@@ -37,6 +36,7 @@
3736
#include <QTextStream>
3837
#include <QRegularExpression>
3938
#include <QDebug>
39+
#include <QDate>
4040

4141
#ifdef _WIN32
4242
#include <windows.h>
@@ -264,11 +264,8 @@ void MainWindow::manual()
264264

265265
void MainWindow::about()
266266
{
267-
auto now = std::chrono::system_clock::now();
268-
std::time_t time = std::chrono::system_clock::to_time_t(now);
269-
auto current = *localtime(&time);
270267
char tmp[10];
271-
sprintf(tmp,"%d",current.tm_year+1900);
268+
sprintf(tmp,"%d",QDate::currentDate().year());
272269

273270
QString msg;
274271
QTextStream t(&msg,QIODevice::WriteOnly);

0 commit comments

Comments
 (0)