~ubuntu-branches/ubuntu/utopic/ktp-text-ui/utopic

« back to all changes in this revision

Viewing changes to lib/logmanager.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-04-17 10:33:04 UTC
  • mfrom: (1.2.8)
  • Revision ID: package-import@ubuntu.com-20130417103304-kaw69l942vka3nn4
Tags: 0.6.1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
    }
126
126
}
127
127
 
 
128
bool operator<(const Tpl::EventPtr &e1, const Tpl::EventPtr &e2)
 
129
{
 
130
    return e1->timestamp() < e2->timestamp();
 
131
}
 
132
 
128
133
void LogManager::onEventsFinished(Tpl::PendingOperation *po)
129
134
{
130
135
    Tpl::PendingEvents *pe = (Tpl::PendingEvents*) po;
145
150
 
146
151
    // get last n (m_fetchLast) messages that are not queued
147
152
    QList<Tpl::EventPtr> allEvents = pe->events();
 
153
 
 
154
    // See https://bugs.kde.org/show_bug.cgi?id=317866
 
155
    // Uses the operator< overload above
 
156
    qSort(allEvents);
 
157
 
148
158
    QList<Tpl::TextEventPtr> events;
149
159
    QList<Tpl::EventPtr>::iterator i = allEvents.end();
150
160
    while (i-- != allEvents.begin() && (events.count() < m_fetchAmount)) {