diff --git a/TODO b/TODO index 075e320df..d6961e8c0 100644 --- a/TODO +++ b/TODO @@ -50,7 +50,7 @@ The KDE 4.0 TODO List: Make as much of the functionality from the main program available in the part as possible. -- Implement loading and saving of custom shortcuts. +- Make custom shortcuts work to create new sessions. - Implement changing of the Konsole window size by terminal applications. diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index 51055b4bc..e60f2e58a 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -411,7 +411,7 @@ void EditProfileDialog::unpreview(int property) _previewedProperties.remove(property); } -void EditProfileDialog::preview(int property , QVariant value) +void EditProfileDialog::preview(int property , const QVariant& value) { QHash map; map.insert((Profile::Property)property,value); diff --git a/src/EditProfileDialog.h b/src/EditProfileDialog.h index c6ddc3349..79a7c3ef5 100644 --- a/src/EditProfileDialog.h +++ b/src/EditProfileDialog.h @@ -163,7 +163,7 @@ private: void changeCheckedItem( QAbstractItemModel* mode, const QModelIndex& to ); - void preview(int property , QVariant value); + void preview(int property , const QVariant& value); void unpreview(int property); void unpreviewAll(); diff --git a/src/Emulation.h b/src/Emulation.h index 3cf0d3704..886ad7533 100644 --- a/src/Emulation.h +++ b/src/Emulation.h @@ -72,7 +72,7 @@ enum * Base class for terminal emulation back-ends. * * The back-end is responsible for decoding an incoming character stream and - * producing an ouput image of characters. + * producing an output image of characters. * * When input from the terminal is received, the receiveData() slot should be called with * the data which has arrived. The emulation will process the data and update the diff --git a/src/KeyTrans.cpp b/src/KeyTrans.cpp index cbb6c2231..394f5156f 100644 --- a/src/KeyTrans.cpp +++ b/src/KeyTrans.cpp @@ -47,7 +47,12 @@ instances represent the individual assignments */ -KeyTrans::KeyEntry::KeyEntry(int _ref, int _key, int _bits, int _mask, int _cmd, QString _txt) +KeyTrans::KeyEntry::KeyEntry(int _ref, + int _key, + int _bits, + int _mask, + int _cmd, + const QString& _txt) : ref(_ref), key(_key), bits(_bits), mask(_mask), cmd(_cmd), txt(_txt) { } @@ -118,7 +123,12 @@ KeyTrans::~KeyTrans() delete tableIter.next(); } -KeyTrans::KeyEntry* KeyTrans::addEntry(int ref, int key, int bits, int mask, int cmd, QString txt) +KeyTrans::KeyEntry* KeyTrans::addEntry(int ref, + int key, + int bits, + int mask, + int cmd, + const QString& txt) // returns conflicting entry { QListIterator tableIter(tableX); @@ -207,7 +217,7 @@ bool KeyTrans::findEntry(int key, int bits, int* cmd, QByteArray &txt, bool* met class KeytabReader { public: - KeytabReader(QString p, QIODevice &d); + KeytabReader(const QString& p, QIODevice &d); public: void getCc(); void getSymbol(); @@ -229,7 +239,7 @@ private: }; -KeytabReader::KeytabReader(QString p, QIODevice &d) +KeytabReader::KeytabReader(const QString& p, QIODevice &d) { path = p; buf = &d; diff --git a/src/KeyTrans.h b/src/KeyTrans.h index d1a0039c4..596d7b65f 100644 --- a/src/KeyTrans.h +++ b/src/KeyTrans.h @@ -67,7 +67,7 @@ class KeyTrans class KeyEntry { public: - KeyEntry(int ref, int key, int bits, int mask, int cmd, QString txt); + KeyEntry(int ref, int key, int bits, int mask, int cmd, const QString& txt); ~KeyEntry(); bool matches(int key, int bits, int mask); bool metaspecified(void); @@ -84,7 +84,12 @@ class KeyTrans }; private: - KeyEntry* addEntry(int ref, int key, int bits, int mask, int cmd, QString txt); + KeyEntry* addEntry(int ref, + int key, + int bits, + int mask, + int cmd, + const QString& txt); void addKeyTrans(); //headerOnly - set to true to only read the header at the top of the file (which gives the name for display in menus and so on) //and not the rest of the file diff --git a/src/Profile.cpp b/src/Profile.cpp index 7354f83c5..e7bee7172 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -269,7 +269,7 @@ bool KDE4ProfileReader::readProfile(const QString& path , Profile* profile) KConfigGroup keyboard = config.group("Keyboard"); readStandardElement(keyboard,"KeyBindings",profile,Profile::KeyBindings); - // appearence + // appearance KConfigGroup appearance = config.group("Appearance"); readStandardElement(appearance,"ColorScheme",profile,Profile::ColorScheme); diff --git a/src/Session.cpp b/src/Session.cpp index 084f24550..2397899f3 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -810,7 +810,7 @@ QSize Session::size() return _emulation->imageSize(); } -void Session::setSize(QSize size) +void Session::setSize(const QSize& size) { if ((size.width() <= 1) || (size.height() <= 1)) return; diff --git a/src/Session.h b/src/Session.h index a4d52e51c..1196c978c 100644 --- a/src/Session.h +++ b/src/Session.h @@ -339,7 +339,7 @@ public: * * @param size The size in lines and columns to request. */ - void setSize(QSize size); + void setSize(const QSize& size); public slots: diff --git a/src/SessionController.h b/src/SessionController.h index e859cf952..f82b4d6ca 100644 --- a/src/SessionController.h +++ b/src/SessionController.h @@ -336,7 +336,7 @@ public: Backwards }; - SearchHistoryTask(ScreenWindow* window , QObject* parent = 0); + explicit SearchHistoryTask(ScreenWindow* window , QObject* parent = 0); /** Sets the regular expression which is searched for when execute() is called */ void setRegExp(const QRegExp& regExp); diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 4d5caa275..4c76e05fe 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -62,7 +62,7 @@ #include // Konsole -#include "config.h" +#include #include "Filter.h" #include "konsole_wcwidth.h" #include "ScreenWindow.h" @@ -341,7 +341,7 @@ TerminalDisplay::TerminalDisplay(QWidget *parent) // im setAttribute(Qt::WA_InputMethodEnabled, true); - // this is an important optimisation, it tells Qt + // this is an important optimization, it tells Qt // that TerminalDisplay will handle repainting its entire area. setAttribute(Qt::WA_OpaquePaintEvent); @@ -1668,8 +1668,10 @@ void TerminalDisplay::setSelectionEnd() extendSelection( _configureRequestPoint ); } -void TerminalDisplay::extendSelection( QPoint pos ) +void TerminalDisplay::extendSelection( const QPoint& position ) { + QPoint pos = position; + if ( !_screenWindow ) return; @@ -1934,7 +1936,7 @@ void TerminalDisplay::mouseReleaseEvent(QMouseEvent* ev) } } -void TerminalDisplay::characterPosition(QPoint widgetPoint,int& line,int& column) +void TerminalDisplay::characterPosition(const QPoint& widgetPoint,int& line,int& column) { column = (widgetPoint.x()-contentsRect().left()-_bX) / _fontWidth; line = (widgetPoint.y()-contentsRect().top()-_bY) / _fontHeight; diff --git a/src/TerminalDisplay.h b/src/TerminalDisplay.h index 827c0e6d1..ac5cb21af 100644 --- a/src/TerminalDisplay.h +++ b/src/TerminalDisplay.h @@ -487,7 +487,7 @@ protected: void mousePressEvent( QMouseEvent* ); void mouseReleaseEvent( QMouseEvent* ); void mouseMoveEvent( QMouseEvent* ); - void extendSelection( QPoint pos ); + void extendSelection( const QPoint& pos ); void wheelEvent( QWheelEvent* ); bool focusNextPrevChild( bool next ); @@ -553,7 +553,7 @@ private: // maps a point on the widget to the position ( ie. line and column ) of the character // at that point. - void characterPosition(QPoint widgetPoint,int& line,int& column); + void characterPosition(const QPoint& widgetPoint,int& line,int& column); // shows a notification window in the middle of the widget indicating the terminal's // current size in columns and lines diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp index da1ed4e47..494b5f673 100644 --- a/src/Vt102Emulation.cpp +++ b/src/Vt102Emulation.cpp @@ -21,20 +21,14 @@ // Own #include "Vt102Emulation.h" -/*! \class Vt102Emulation - \brief Actual Emulation for Konsole - - \sa TerminalDisplay \sa Screen -*/ -#include "config-konsole.h" +#include #if defined(__osf__) || defined(__APPLE__) #define AVOID_XKB #endif - // this allows konsole to be compiled without XKB and XTEST extensions // even though it might be available on a particular system. #if defined(AVOID_XKB) @@ -89,12 +83,6 @@ using namespace Konsole; /* */ /* ------------------------------------------------------------------------- */ -/* - Nothing really intesting happens here. -*/ - -/*! -*/ Vt102Emulation::Vt102Emulation() : Emulation() { @@ -106,51 +94,10 @@ Vt102Emulation::Vt102Emulation() : Emulation() reset(); } -#if 0 -void Vt102Emulation::setReceiveViewInput(TerminalDisplay* view , bool enable) -{ - if (enable) - { - QObject::connect(view,SIGNAL(mouseSignal(int,int,int,int)), - this,SLOT(onMouse(int,int,int,int))); - QObject::connect(view, SIGNAL(sendStringToEmu(const char*)), - this, SLOT(sendString(const char*))); - } - else - { - QObject::disconnect(view,0, - this,SLOT(onMouse(int,int,int,int))); - QObject::disconnect(view,0, - this, SLOT(sendString(const char*))); - } -} -#endif - -#if 0 -void Vt102Emulation::addView(TerminalDisplay* view) -{ - Emulation::addView(view); - setReceiveViewInput(view,true); -} - -void Vt102Emulation::removeView(TerminalDisplay* view) -{ - Emulation::removeView(view); - setReceiveViewInput(view,false); -} -#endif - - -/*! -*/ - Vt102Emulation::~Vt102Emulation() { } -/*! -*/ - void Vt102Emulation::clearEntireScreen() { _currentScreen->clearEntireScreen(); @@ -1130,27 +1077,18 @@ void Vt102Emulation::resetCharset(int scrno) _charset[scrno].pound = false; } -/*! -*/ - void Vt102Emulation::setCharset(int n, int cs) // on both screens. { _charset[0].charset[n&3] = cs; useCharset(_charset[0].cu_cs); _charset[1].charset[n&3] = cs; useCharset(_charset[1].cu_cs); } -/*! -*/ - void Vt102Emulation::setAndUseCharset(int n, int cs) { CHARSET.charset[n&3] = cs; useCharset(n&3); } -/*! -*/ - void Vt102Emulation::useCharset(int n) { CHARSET.cu_cs = n&3; @@ -1356,9 +1294,6 @@ char Vt102Emulation::getErase() const \sa ReportErrorToken */ -/*! -*/ - static void hexdump(int* s, int len) { int i; for (i = 0; i < len; i++) diff --git a/src/XKB.cpp b/src/XKB.cpp index 6a166f03a..84724d9b4 100644 --- a/src/XKB.cpp +++ b/src/XKB.cpp @@ -28,7 +28,7 @@ DEALINGS IN THE SOFTWARE. #include -#include "config-konsole.h" +#include #if defined(HAVE_XKB) #include diff --git a/src/old/konsole.cpp b/src/old/konsole.cpp index f794c04e8..faf3b0082 100644 --- a/src/old/konsole.cpp +++ b/src/old/konsole.cpp @@ -29,6 +29,8 @@ terminal sessions and applying settings. */ +#include "konsole.h" + // System #include #include @@ -59,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -122,7 +123,6 @@ #include "ViewContainer.h" #include "NavigationItem.h" -#include "konsole.h" #define KONSOLEDEBUG kDebug(1211) @@ -137,7 +137,7 @@ extern bool true_transparency; // declared in main.characterpp and konsole_part. // KonsoleFontSelectAction is now also used for selectSize! class KonsoleFontSelectAction : public KSelectAction { public: - KonsoleFontSelectAction(const QString &text, KActionCollection* parent, const QString &name = QString::null ) + KonsoleFontSelectAction(const QString &text, KActionCollection* parent, const QString &name = QString() ) : KSelectAction(text, parent, name) {} protected: diff --git a/src/old/konsole_part.cpp b/src/old/konsole_part.cpp index bbaab87cb..c8524fc5c 100644 --- a/src/old/konsole_part.cpp +++ b/src/old/konsole_part.cpp @@ -19,6 +19,8 @@ */ +#include "konsole_part.h" + // System #include @@ -57,7 +59,6 @@ #include // Konsole -#include "konsole_part.h" #include "KeyTrans.h" #include "schema.h" #include "Session.h" diff --git a/src/old/main.cpp b/src/old/main.cpp index 26ca3a553..d19335e96 100644 --- a/src/old/main.cpp +++ b/src/old/main.cpp @@ -57,7 +57,7 @@ #include // Konsole -#include "config-konsole.h" +#include #include "konsole.h" #include "SessionManager.h" diff --git a/src/old/schema.cpp b/src/old/schema.cpp index cc6619725..a7381e1c4 100644 --- a/src/old/schema.cpp +++ b/src/old/schema.cpp @@ -46,6 +46,8 @@ ** a particular m_number, but remember that find may return NULL. */ +#include "schema.h" + // System #include #include @@ -65,8 +67,6 @@ #include #include -// Konsole -#include "schema.h" using namespace Konsole; diff --git a/src/old/settings/kcmkonsole.cpp b/src/old/settings/kcmkonsole.cpp index caf6ba46a..9065317ed 100644 --- a/src/old/settings/kcmkonsole.cpp +++ b/src/old/settings/kcmkonsole.cpp @@ -15,6 +15,8 @@ * * ***************************************************************************/ +#include "kcmkonsole.h" + #include #include #include @@ -33,7 +35,6 @@ #include "schemaeditor.h" #include "sessioneditor.h" -#include "kcmkonsole.h" #ifdef Q_WS_X11 #include