[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:13 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=3730b4e
The following commit has been merged in the master branch:
commit 3730b4eabd0018737fbd0ab87b44a1237179fcf9
Author: Dan Vrátil <dvratil at redhat.com>
Date: Sun Jan 27 18:45:47 2013 +0100
Don't crash when account goes offline while we are loading history
Also clean up coding style in the file a bit.
BUG: 313927
REVIEW: 108607
FIXED-IN: 0.5.3
---
lib/logmanager.cpp | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/lib/logmanager.cpp b/lib/logmanager.cpp
index ac311a2..9ac5103 100644
--- a/lib/logmanager.cpp
+++ b/lib/logmanager.cpp
@@ -103,7 +103,7 @@ void LogManager::fetchLast()
NULL,
NULL);
- Tpl::PendingDates* dates = m_logManager->queryDates( m_account, contactEntity, Tpl::EventTypeMaskText);
+ Tpl::PendingDates* dates = m_logManager->queryDates(m_account, contactEntity, Tpl::EventTypeMaskText);
connect(dates, SIGNAL(finished(Tpl::PendingOperation*)), SLOT(onDatesFinished(Tpl::PendingOperation*)));
return;
}
@@ -125,7 +125,7 @@ void LogManager::onDatesFinished(Tpl::PendingOperation *po)
QList<QDate> dates = pd->dates();
- if( !dates.isEmpty() ) {
+ if (!dates.isEmpty()) {
QDate date = dates.last();
kDebug() << pd->account()->uniqueIdentifier() << pd->entity()->identifier() << dates;
@@ -148,7 +148,7 @@ void LogManager::onEventsFinished(Tpl::PendingOperation *po)
}
QStringList queuedMessageTokens;
- if(!m_textChannel.isNull()) {
+ if (!m_textChannel.isNull()) {
Q_FOREACH(const Tp::ReceivedMessage &message, m_textChannel->messageQueue()) {
queuedMessageTokens.append(message.messageToken());
}
@@ -162,9 +162,9 @@ void LogManager::onEventsFinished(Tpl::PendingOperation *po)
QList<Tpl::EventPtr>::iterator i = allEvents.end();
while (i-- != allEvents.begin() && (events.count() <= m_fetchAmount)) {
Tpl::TextEventPtr textEvent = (*i).dynamicCast<Tpl::TextEvent>();
- if(!textEvent.isNull()) {
- if(!queuedMessageTokens.contains(textEvent->messageToken())) {
- events.prepend( textEvent );
+ if (!textEvent.isNull()) {
+ if (!queuedMessageTokens.contains(textEvent->messageToken())) {
+ events.prepend(textEvent);
}
}
}
@@ -174,7 +174,7 @@ void LogManager::onEventsFinished(Tpl::PendingOperation *po)
Q_FOREACH(const Tpl::TextEventPtr &event, events) {
AdiumThemeMessageInfo::MessageType type;
Tp::ContactPtr contact;
- if(event->sender()->identifier() == m_account->normalizedName()) {
+ if (event->sender()->identifier() == m_account->normalizedName()) {
type = AdiumThemeMessageInfo::HistoryLocalToRemote;
if (m_account->connection()) {
contact = m_account->connection()->selfContact();
@@ -183,6 +183,15 @@ void LogManager::onEventsFinished(Tpl::PendingOperation *po)
type = AdiumThemeMessageInfo::HistoryRemoteToLocal;
contact = m_textChannel->targetContact();
}
+
+ /* When connection is dropped (account goes offline), we get an invalid
+ * contact, so we can't correctly create the message. There's no point
+ * emitting fetched() with only partial list of messages, so let's
+ * just terminate here. */
+ if (!contact) {
+ return;
+ }
+
AdiumThemeContentInfo message(type);
if (type == AdiumThemeMessageInfo::HistoryLocalToRemote) {
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list