Remove old code dealing with --no-resize option

In KDE 3.5, there used to be a --no-resize option; it was never
ported/used in KDE 4.x
This commit is contained in:
Kurt Hindenburg
2014-02-16 18:03:54 -05:00
parent 4ac9696ad7
commit b180a6ac08
3 changed files with 9 additions and 47 deletions

View File

@@ -327,7 +327,6 @@ TerminalDisplay::TerminalDisplay(QWidget* parent)
, _hasTextBlinker(false)
, _underlineLinks(true)
, _openLinksByDirectClick(false)
, _isFixedSize(false)
, _ctrlRequiredForDrag(true)
, _tripleClickMode(Enum::SelectWholeLine)
, _possibleTripleClick(false)
@@ -1614,13 +1613,6 @@ void TerminalDisplay::resizeEvent(QResizeEvent*)
void TerminalDisplay::propagateSize()
{
if (_isFixedSize) {
setSize(_columns, _lines);
QWidget::setFixedSize(sizeHint());
parentWidget()->adjustSize();
parentWidget()->setFixedSize(parentWidget()->sizeHint());
return;
}
if (_image)
updateImageSize();
}
@@ -1702,19 +1694,17 @@ void TerminalDisplay::calcGeometry()
break;
}
if (!_isFixedSize) {
// ensure that display is always at least one column wide
_columns = qMax(1, _contentRect.width() / _fontWidth);
_usedColumns = qMin(_usedColumns, _columns);
// ensure that display is always at least one column wide
_columns = qMax(1, _contentRect.width() / _fontWidth);
_usedColumns = qMin(_usedColumns, _columns);
// ensure that display is always at least one line high
_lines = qMax(1, _contentRect.height() / _fontHeight);
_usedLines = qMin(_usedLines, _lines);
// ensure that display is always at least one line high
_lines = qMax(1, _contentRect.height() / _fontHeight);
_usedLines = qMin(_usedLines, _lines);
if(_centerContents) {
QSize unusedPixels = _contentRect.size() - QSize(_columns * _fontWidth, _lines * _fontHeight);
_contentRect.adjust(unusedPixels.width() / 2, unusedPixels.height() / 2, 0, 0);
}
if(_centerContents) {
QSize unusedPixels = _contentRect.size() - QSize(_columns * _fontWidth, _lines * _fontHeight);
_contentRect.adjust(unusedPixels.width() / 2, unusedPixels.height() / 2, 0, 0);
}
}
@@ -1734,24 +1724,6 @@ void TerminalDisplay::setSize(int columns, int lines)
}
}
void TerminalDisplay::setFixedSize(int cols, int lins)
{
_isFixedSize = true;
//ensure that display is at least one line by one column in size
_columns = qMax(1, cols);
_lines = qMax(1, lins);
_usedColumns = qMin(_usedColumns, _columns);
_usedLines = qMin(_usedLines, _lines);
if (_image) {
delete[] _image;
makeImage();
}
setSize(cols, lins);
QWidget::setFixedSize(_size);
}
QSize TerminalDisplay::sizeHint() const
{
return _size;

View File

@@ -294,7 +294,6 @@ public:
}
void setSize(int columns, int lines);
void setFixedSize(int columns, int lines);
// reimplemented
QSize sizeHint() const;
@@ -849,7 +848,6 @@ private:
bool _underlineLinks; // Underline URL and hosts on mouse hover
bool _openLinksByDirectClick; // Open URL and hosts by single mouse click
bool _isFixedSize; // columns/lines are locked.
bool _ctrlRequiredForDrag; // require Ctrl key for drag selected text

View File

@@ -96,14 +96,6 @@ void TerminalTest::testSize()
// TODO: setSize doesn't change size...
//display->setSize(80, 25);
display->setFixedSize(-1, -1);
QCOMPARE(display->columns(), 1);
QCOMPARE(display->lines(), 1);
display->setFixedSize(80, 25);
QCOMPARE(display->columns(), 80);
QCOMPARE(display->lines(), 25);
delete display;
}