[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:23:49 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=be28c38
The following commit has been merged in the master branch:
commit be28c3891ac11ef4c2bb3b42279dc089f45a8c85
Author: Dan Vrátil <dvratil at redhat.com>
Date: Thu Apr 11 17:03:24 2013 +0200
Sort log entries by timestamp before displaying them
Reviewed-By: David Edmundson, Martin Klapetek
BUG: 317866
FIXED-IN: 0.6.1
---
lib/logmanager.cpp | 10 ++++++++++
logviewer/message-view.cpp | 8 ++++++++
2 files changed, 18 insertions(+)
diff --git a/lib/logmanager.cpp b/lib/logmanager.cpp
index a570adf..d161392 100644
--- a/lib/logmanager.cpp
+++ b/lib/logmanager.cpp
@@ -125,6 +125,11 @@ void LogManager::onDatesFinished(Tpl::PendingOperation *po)
}
}
+bool operator<(const Tpl::EventPtr &e1, const Tpl::EventPtr &e2)
+{
+ return e1->timestamp() < e2->timestamp();
+}
+
void LogManager::onEventsFinished(Tpl::PendingOperation *po)
{
Tpl::PendingEvents *pe = (Tpl::PendingEvents*) po;
@@ -145,6 +150,11 @@ void LogManager::onEventsFinished(Tpl::PendingOperation *po)
// get last n (m_fetchLast) messages that are not queued
QList<Tpl::EventPtr> allEvents = pe->events();
+
+ // See https://bugs.kde.org/show_bug.cgi?id=317866
+ // Uses the operator< overload above
+ qSort(allEvents);
+
QList<Tpl::TextEventPtr> events;
QList<Tpl::EventPtr>::iterator i = allEvents.end();
while (i-- != allEvents.begin() && (events.count() < m_fetchAmount)) {
diff --git a/logviewer/message-view.cpp b/logviewer/message-view.cpp
index 6a59caa..8fdd6f5 100644
--- a/logviewer/message-view.cpp
+++ b/logviewer/message-view.cpp
@@ -102,6 +102,10 @@ void MessageView::onEventsLoaded(Tpl::PendingOperation *po)
initialise(headerInfo);
}
+bool operator<(const Tpl::EventPtr &e1, const Tpl::EventPtr &e2)
+{
+ return e1->timestamp() < e2->timestamp();
+}
void MessageView::processStoredEvents()
{
@@ -114,6 +118,10 @@ void MessageView::processStoredEvents()
addStatusMessage(message);
}
+ // See https://bugs.kde.org/show_bug.cgi?id=317866
+ // Uses the operator< overload above
+ qSort(m_events);
+
while (!m_events.isEmpty()) {
const Tpl::TextEventPtr textEvent(m_events.takeFirst().staticCast<Tpl::TextEvent>());
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list