From 045284c405b3027e6d6bb529e2f80d978cb072d1 Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Mon, 4 Jun 2012 13:49:04 +0800 Subject: [PATCH] Swap the order of column(width) and line(height) in method signature It is more natural to use column x line. TODO: The current code is inconsistent with itself regarding this issue --- src/Pty.cpp | 4 ++-- src/Pty.h | 4 ++-- src/Session.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Pty.cpp b/src/Pty.cpp index bc508f8a7..29fb0489d 100644 --- a/src/Pty.cpp +++ b/src/Pty.cpp @@ -80,7 +80,7 @@ void Pty::dataReceived() emit receivedData(data.constData(), data.count()); } -void Pty::setWindowSize(int lines, int columns) +void Pty::setWindowSize(int columns, int lines) { _windowColumns = columns; _windowLines = lines; @@ -243,7 +243,7 @@ int Pty::start(const QString& programName, setUtf8Mode(_utf8); setEraseChar(_eraseChar); - setWindowSize(_windowLines, _windowColumns); + setWindowSize(_windowColumns, _windowLines); KProcess::start(); diff --git a/src/Pty.h b/src/Pty.h index d0030ba59..cbecc2394 100644 --- a/src/Pty.h +++ b/src/Pty.h @@ -107,10 +107,10 @@ public: bool flowControlEnabled() const; /** - * Sets the size of the window (in lines and columns of characters) + * Sets the size of the window (in columns and lines of characters) * used by this teletype. */ - void setWindowSize(int lines, int cols); + void setWindowSize(int columns, int lines); /** Returns the size of the window used by this teletype. See setWindowSize() */ QSize windowSize() const; diff --git a/src/Session.cpp b/src/Session.cpp index d6377ca4c..5746b75d8 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -704,7 +704,7 @@ void Session::updateTerminalSize() void Session::updateWindowSize(int lines, int columns) { Q_ASSERT(lines > 0 && columns > 0); - _shellProcess->setWindowSize(lines, columns); + _shellProcess->setWindowSize(columns, lines); } void Session::refresh() { @@ -723,9 +723,9 @@ void Session::refresh() // send an email with method or patches to konsole-devel@kde.org const QSize existingSize = _shellProcess->windowSize(); - _shellProcess->setWindowSize(existingSize.height(), existingSize.width() + 1); + _shellProcess->setWindowSize(existingSize.width() + 1, existingSize.height()); usleep(500); // introduce small delay to avoid changing size too quickly - _shellProcess->setWindowSize(existingSize.height(), existingSize.width()); + _shellProcess->setWindowSize(existingSize.width(), existingSize.height()); } bool Session::kill(int signal)