Changeset View
Changeset View
Standalone View
Standalone View
kwrited.cpp
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Line(s) | |||||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | void KWrited::block_in() | 151 | void KWrited::block_in() | ||
152 | { | 152 | { | ||
153 | QByteArray buf = pty->readAll(); | 153 | QByteArray buf = pty->readAll(); | ||
154 | QString msg = QString::fromLocal8Bit( buf.constData(), buf.size() ); | 154 | QString msg = QString::fromLocal8Bit( buf.constData(), buf.size() ); | ||
155 | msg.remove(QLatin1Char('\r')); | 155 | msg.remove(QLatin1Char('\r')); | ||
156 | msg.remove(QLatin1Char('\a')); | 156 | msg.remove(QLatin1Char('\a')); | ||
157 | msg = msg.trimmed(); | ||||
157 | 158 | | |||
158 | KNotification *notification = new KNotification(QStringLiteral("NewMessage"), nullptr, KNotification::Persistent); | 159 | KNotification *notification = new KNotification(QStringLiteral("NewMessage"), nullptr, KNotification::Persistent); | ||
159 | #if !defined(BUILD_AS_EXECUTABLE) | 160 | #if !defined(BUILD_AS_EXECUTABLE) | ||
160 | notification->setComponentName( QStringLiteral("kwrited") ); | 161 | notification->setComponentName( QStringLiteral("kwrited") ); | ||
161 | #endif | 162 | #endif | ||
162 | notification->setText( msg ); | 163 | notification->setText( msg ); | ||
163 | connect(notification, SIGNAL(closed()), notification, SLOT(deleteLater()) ); | 164 | connect(notification, SIGNAL(closed()), notification, SLOT(deleteLater()) ); | ||
164 | notification->sendEvent(); | 165 | notification->sendEvent(); | ||
165 | } | 166 | } | ||
166 | 167 | | |||
167 | #if !defined(BUILD_AS_EXECUTABLE) | 168 | #if !defined(BUILD_AS_EXECUTABLE) | ||
168 | #include "kwrited.moc" | 169 | #include "kwrited.moc" | ||
169 | #endif | 170 | #endif |