[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/sysadmin/muon/libmuon/HistoryView
From: Jonathan Michael Thomas <echidnaman () kubuntu ! org>
Date: 2010-12-03 17:50:05
Message-ID: 20101203175005.3F313AC8A4 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1203352 by jmthomas:
Use KLocale::formatTime() on our QDateTime so that we can get "Today"/"Yesterday"/ \
weekday names in the history categories
M +2 -10 HistoryView.cpp
--- trunk/extragear/sysadmin/muon/libmuon/HistoryView/HistoryView.cpp \
#1203351:1203352 @@ -34,6 +34,7 @@
#include <KLineEdit>
#include <KLocale>
#include <KDebug>
+#include <kdeversion.h>
#include <LibQApt/History>
@@ -94,19 +95,10 @@
QDateTime weekAgoTime = QDateTime::currentDateTime().addDays(-7);
foreach (QApt::HistoryItem *item, m_history->historyItems()) {
- QString category;
QDateTime startDateTime = item->startDate();
QString formattedTime = KGlobal::locale()->formatTime(startDateTime.time());
+ QString category = KGlobal::locale()->formatDate(startDateTime.date(), \
KLocale::FancyShortDate);
- category = startDateTime.toString("MMMM dd");
-
-// if (startDateTime > weekAgoTime) {
-// //category = KGlobal::locale()->dayPeriodText(startDateTime.time(), \
KLocale::LongName);
-// category = startDateTime.toString("dddd");
-// } else {
-// category = startDateTime.toString("MMMM dd");
-// }
-
QStandardItem *parentItem = 0;
if (!m_categoryHash.contains(category)) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic