Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Only check sTerm in TextRender ctor
  • Loading branch information
pvuorela committed Jun 9, 2016
1 parent 15a4921 commit a8f3e55
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions textrender.cpp
Expand Up @@ -82,6 +82,7 @@ TextRender::TextRender(QQuickItem *parent) :
iFontWidth = fontMetrics.maxWidth();
iFontDescent = fontMetrics.descent();

Q_ASSERT(sTerm);
connect(sTerm, SIGNAL(displayBufferChanged()), this, SLOT(redraw()));
connect(sTerm, SIGNAL(cursorPosChanged(QPoint)), this, SLOT(redraw()));
connect(sTerm, SIGNAL(termSizeChanged(QSize)), this, SLOT(redraw()));
Expand All @@ -96,9 +97,6 @@ TextRender::~TextRender()

void TextRender::paint(QPainter* painter)
{
if (!sTerm)
return;

painter->save();
painter->setFont(iFont);

Expand Down Expand Up @@ -296,9 +294,6 @@ void TextRender::setTerminal(Terminal *terminal)

void TextRender::updateTermSize()
{
if (!sTerm)
return;

QSize size((width() - 4) / iFontWidth, (height() - 4) / iFontHeight);
sTerm->setTermSize(size);
}
Expand Down Expand Up @@ -414,9 +409,6 @@ QSize TextRender::cursorPixelSize()

QPointF TextRender::scrollBackBuffer(QPointF now, QPointF last)
{
if(!sTerm)
return last;

int xdist = qAbs(now.x() - last.x());
int ydist = qAbs(now.y() - last.y());
int fontSize = sUtil->settingsValue("ui/fontSize").toInt();
Expand All @@ -436,9 +428,6 @@ QPointF TextRender::scrollBackBuffer(QPointF now, QPointF last)

void TextRender::doGesture(PanGesture gesture)
{
if(!sTerm)
return;

if( gesture==PanLeft ) {
sUtil->notifyText(sUtil->settingsValue("gestures/panLeftTitle").toString());
sTerm->putString(sUtil->settingsValue("gestures/panLeftCommand").toString(), true);
Expand Down

0 comments on commit a8f3e55

Please sign in to comment.