Package: cutecom
Version: 0.22.0-1
Severity: normal
Tags: patch
If a line of text is received in two chunks, cutecom breaks up the line because
of the way qt4 textbrowser works with paragraphs instead of text strings.
Included is a proposed fix, which uses the cursor based interface that is the
preferred way to insert text in qt4 textbrowser.
-- System Information:
Debian Release: squeeze/sid
APT prefers lucid-updates
APT policy: (500, 'lucid-updates'), (500, 'lucid-security'), (500, 'lucid')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-24-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages cutecom depends on:
ii libc6 2.11.1-0ubuntu7.2 Embedded GNU C Library: Shared lib
ii libgcc1 1:4.4.3-4ubuntu5 GCC support library
ii libqt4-qt3support 4:4.6.2-0ubuntu5 Qt 3 compatibility library for Qt
ii libqtcore4 4:4.6.2-0ubuntu5 Qt 4 core module
ii libqtgui4 4:4.6.2-0ubuntu5 Qt 4 GUI module
ii libstdc++6 4.4.3-4ubuntu5 The GNU Standard C++ Library v3
cutecom recommends no packages.
Versions of packages cutecom suggests:
ii lrzsz 0.12.21-5 Tools for zmodem/xmodem/ymodem fil
-- no debconf information
diff -ruN cutecom-0.22.0/qcppdialogimpl.cpp cutecom-0.22.0-nolinebreak/qcppdialogimpl.cpp
--- cutecom-0.22.0/qcppdialogimpl.cpp 2009-06-25 21:10:49.000000000 +0100
+++ cutecom-0.22.0-nolinebreak/qcppdialogimpl.cpp 2010-08-04 15:57:15.951009886 +0100
@@ -18,6 +18,7 @@
#include "qcppdialogimpl.h"
+#include <qscrollbar.h>
#include <qcombobox.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
@@ -1362,13 +1363,23 @@
void QCPPDialogImpl::doOutput()
{
- if (m_outputBuffer.isEmpty())
- {
- return;
- }
+ QScrollBar* vScrollBar;
+ bool scrollWithText;
+
+ if (m_outputBuffer.isEmpty())
+ return;
+
+ vScrollBar = m_outputView->verticalScrollBar();
+ scrollWithText = (vScrollBar->value() == vScrollBar->maximum());
+
+ QTextCursor cursor(m_outputView->document());
+ cursor.movePosition(QTextCursor::End);
+ cursor.insertText(m_outputBuffer);
+
+ if ((scrollWithText))
+ vScrollBar->setValue(vScrollBar->maximum());
- m_outputView->append(m_outputBuffer);
- m_outputBuffer.clear();
+ m_outputBuffer.clear();
}
void QCPPDialogImpl::hexOutputClicked(bool /* on */)