[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: kdesdk/cervisia
From: Lukáš Tinkl <lukas () kde ! org>
Date: 2003-06-23 7:22:54
[Download RAW message or body]
V Ne, 22. 06. 2003 v 20:10, André Wöbbeking napsal:
> CVS commit by woebbe:
>
> Use KLocale to display a date tag.
>
> TODO: the date tag is in UTC and should be converted to local time,
> but I don't know how.
>
>
> M +18 -17 updateview.cpp 1.46
>
>
> --- kdesdk/cervisia/updateview.cpp #1.45:1.46
> @@ -606,18 +606,19 @@ void UpdateFileItem::setRevTag(const QSt
> && tag[17] == '.')
> {
> - m_tag = tag.mid(1, 4);
> - m_tag += '/';
> - m_tag += tag.mid(6, 2);
> - m_tag += '/';
> - m_tag += tag.mid(9, 2);
> - m_tag += ' ';
> - m_tag += tag.mid(12, 2);
> - m_tag += ':';
> - m_tag += tag.mid(15, 2);
> - m_tag += ':';
> - m_tag += tag.mid(18, 2);
> + const QDate tagDate(tag.mid(1, 4).toInt(),
> + tag.mid(6, 2).toInt(),
> + tag.mid(9, 2).toInt());
> + const QTime tagTime(tag.mid(12, 2).toInt(),
> + tag.mid(15, 2).toInt(),
> + tag.mid(18, 2).toInt());
> + const QDateTime tagDateTime(tagDate, tagTime);
> +
> + // TODO: this is in UTC and should be converted to local time
> + m_tag = tagDateTime.isValid()
> + ? KGlobal::locale()->formatDateTime(tagDateTime)
> + : tag;
> }
> else if (tag.length() > 1 && tag[0] == 'T')
> - m_tag = tag.mid(1, tag.length()-1);
> + m_tag = tag.mid(1);
> else
> m_tag = tag;
>
Try void QDateTime::setTime_t ( uint secsSince1Jan1970UTC, Qt::TimeSpec
ts )
--
Lukáš Tinkl (lukas@kde.org)
KDE developer | KOffice release manager
http://czechia.kde.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic