Commit e67661d2 authored by Kurt Hindenburg's avatar Kurt Hindenburg

uncrustify using kf5 config

parent ba2be5c6
......@@ -33,8 +33,7 @@
class QKeyEvent;
namespace Konsole
{
namespace Konsole {
class KeyboardTranslator;
class HistoryType;
class Screen;
......@@ -128,7 +127,7 @@ public:
* of the window are then rendered by views which are set to use this window using the
* TerminalDisplay::setScreenWindow() method.
*/
ScreenWindow* createWindow();
ScreenWindow *createWindow();
/** Returns the size of the screen image which the emulation produces */
QSize imageSize() const;
......@@ -146,9 +145,9 @@ public:
* The number of lines which are kept and the storage location depend on the
* type of store.
*/
void setHistory(const HistoryType&);
void setHistory(const HistoryType &);
/** Returns the history store used by this emulation. See setHistory() */
const HistoryType& history() const;
const HistoryType &history() const;
/** Clears the history scroll. */
void clearHistory();
......@@ -163,26 +162,28 @@ public:
* @param startLine Index of first line to copy
* @param endLine Index of last line to copy
*/
virtual void writeToStream(TerminalCharacterDecoder* decoder, int startLine, int endLine);
virtual void writeToStream(TerminalCharacterDecoder *decoder, int startLine, int endLine);
/** Returns the codec used to decode incoming characters. See setCodec() */
const QTextCodec* codec() const {
const QTextCodec *codec() const
{
return _codec;
}
/** Sets the codec used to decode incoming characters. */
void setCodec(const QTextCodec*);
void setCodec(const QTextCodec *);
/**
* Convenience method.
* Returns true if the current codec used to decode incoming
* characters is UTF-8
*/
bool utf8() const {
bool utf8() const
{
Q_ASSERT(_codec);
return _codec->mibEnum() == 106;
}
/** Returns the special character used for erasing character. */
virtual char eraseChar() const;
......@@ -191,7 +192,7 @@ public:
* ( received through sendKeyEvent() ) into character
* streams to send to the terminal.
*/
void setKeyBindings(const QString& name);
void setKeyBindings(const QString &name);
/**
* Returns the name of the emulation's current key bindings.
* See setKeyBindings()
......@@ -226,13 +227,13 @@ public Q_SLOTS:
* Interprets a sequence of characters and sends the result to the terminal.
* This is equivalent to calling sendKeyEvent() for each character in @p text in succession.
*/
virtual void sendText(const QString& text) = 0;
virtual void sendText(const QString &text) = 0;
/**
* Interprets a key press event and emits the sendData() signal with
* the resulting character stream.
*/
virtual void sendKeyEvent(QKeyEvent*);
virtual void sendKeyEvent(QKeyEvent *);
/**
* Converts information about a mouse event into an xterm-compatible escape
......@@ -259,7 +260,7 @@ public Q_SLOTS:
* @param buffer A string of characters received from the terminal program.
* @param len The length of @p buffer
*/
void receiveData(const char* buffer, int len);
void receiveData(const char *buffer, int len);
/**
* Sends information about the focus lost event to the terminal.
......@@ -279,7 +280,7 @@ Q_SIGNALS:
*
* @param data The buffer of data ready to be sent
*/
void sendData(const QByteArray& data);
void sendData(const QByteArray &data);
/**
* Requests that the pty used by the terminal process
......@@ -303,7 +304,6 @@ Q_SIGNALS:
*/
void zmodemDetected();
/**
* Requests that the color of the text used
* to represent the tabs associated with this
......@@ -371,12 +371,12 @@ Q_SIGNALS:
* @param newTitle Specifies the new title
*/
void titleChanged(int title, const QString& newTitle);
void titleChanged(int title, const QString &newTitle);
/**
* Emitted when the terminal emulator's size has changed
*/
void imageSizeChanged(int lineCount , int columnCount);
void imageSizeChanged(int lineCount, int columnCount);
/**
* Emitted when the setImageSize() is called on this emulation for
......@@ -388,7 +388,7 @@ Q_SIGNALS:
* Emitted after receiving the escape sequence which asks to change
* the terminal emulator's size
*/
void imageResizeRequest(const QSize& sizz);
void imageResizeRequest(const QSize &sizz);
/**
* Emitted when the terminal program requests to change various properties
......@@ -401,7 +401,7 @@ Q_SIGNALS:
* @param text A string expected to contain a series of key and value pairs in
* the form: name=value;name2=value2 ...
*/
void profileChangeCommandReceived(const QString& text);
void profileChangeCommandReceived(const QString &text);
/**
* Emitted when a flow control key combination ( Ctrl+S or Ctrl+Q ) is pressed.
......@@ -419,7 +419,7 @@ Q_SIGNALS:
/**
* Emitted when the text selection is changed
*/
void selectionChanged(const QString& text);
void selectionChanged(const QString &text);
/**
* Emitted when terminal code requiring terminal's response received.
......@@ -447,27 +447,26 @@ protected:
enum EmulationCodec {
LocaleCodec = 0,
Utf8Codec = 1
Utf8Codec = 1
};
void setCodec(EmulationCodec codec);
QList<ScreenWindow*> _windows;
QList<ScreenWindow *> _windows;
Screen* _currentScreen; // pointer to the screen which is currently active,
Screen *_currentScreen; // pointer to the screen which is currently active,
// this is one of the elements in the screen[] array
Screen* _screen[2]; // 0 = primary screen ( used by most programs, including the shell
Screen *_screen[2]; // 0 = primary screen ( used by most programs, including the shell
// scrollbars are enabled in this mode )
// 1 = alternate ( used by vi , emacs etc.
// scrollbars are not enabled in this mode )
//decodes an incoming C-style character stream into a unicode QString using
//the current text codec. (this allows for rendering of non-ASCII characters in text files etc.)
const QTextCodec* _codec;
QTextDecoder* _decoder;
const KeyboardTranslator* _keyTranslator; // the keyboard layout
const QTextCodec *_codec;
QTextDecoder *_decoder;
const KeyboardTranslator *_keyTranslator; // the keyboard layout
protected Q_SLOTS:
/**
......
......@@ -22,8 +22,7 @@
#ifndef ENUMERATION_H
#define ENUMERATION_H
namespace Konsole
{
namespace Konsole {
/**
* This class serves as a place for putting enum definitions that are
* used or referenced in multiple places in the code. Keep it small.
......@@ -39,7 +38,7 @@ public:
/** No output is remembered. As soon as lines of text are scrolled
* off-screen they are lost.
*/
NoHistory = 0,
NoHistory = 0,
/** A fixed number of lines of output are remembered. Once the
* limit is reached, the oldest lines are lost.
*/
......@@ -57,9 +56,9 @@ public:
*/
enum ScrollBarPositionEnum {
/** Show the scroll-bar on the left of the terminal display. */
ScrollBarLeft = 0,
ScrollBarLeft = 0,
/** Show the scroll-bar on the right of the terminal display. */
ScrollBarRight = 1,
ScrollBarRight = 1,
/** Do not show the scroll-bar. */
ScrollBarHidden = 2
};
......@@ -79,11 +78,11 @@ public:
*/
enum CursorShapeEnum {
/** Use a solid rectangular block to draw the cursor. */
BlockCursor = 0,
BlockCursor = 0,
/** Use an 'I' shape, similar to that used in text editing
* applications, to draw the cursor.
*/
IBeamCursor = 1,
IBeamCursor = 1,
/** Draw a line underneath the cursor's position. */
UnderlineCursor = 2
};
......@@ -134,8 +133,6 @@ public:
*/
BackwardsSearch
};
};
}
#endif // ENUMERATION_H
......@@ -25,8 +25,7 @@
// Qt
#include <QHash>
namespace Konsole
{
namespace Konsole {
/**
* A table which stores sequences of unicode characters, referenced
* by hash keys. The hash key itself is the same size as a unicode
......@@ -51,7 +50,7 @@ public:
* @param unicodePoints An array of unicode character points
* @param length Length of @p unicodePoints
*/
ushort createExtendedChar(const ushort* unicodePoints , ushort length);
ushort createExtendedChar(const ushort *unicodePoints, ushort length);
/**
* Looks up and returns a pointer to a sequence of unicode characters
* which was added to the table using createExtendedChar().
......@@ -62,20 +61,20 @@ public:
*
* @return A unicode character sequence of size @p length.
*/
ushort* lookupExtendedChar(ushort hash , ushort& length) const;
ushort *lookupExtendedChar(ushort hash, ushort &length) const;
/** The global ExtendedCharTable instance. */
static ExtendedCharTable instance;
private:
// calculates the hash key of a sequence of unicode points of size 'length'
ushort extendedCharHash(const ushort* unicodePoints , ushort length) const;
ushort extendedCharHash(const ushort *unicodePoints, ushort length) const;
// tests whether the entry in the table specified by 'hash' matches the
// character sequence 'unicodePoints' of size 'length'
bool extendedCharMatch(ushort hash , const ushort* unicodePoints , ushort length) const;
bool extendedCharMatch(ushort hash, const ushort *unicodePoints, ushort length) const;
// internal, maps hash keys to character sequence buffers. The first ushort
// in each value is the length of the buffer, followed by the ushorts in the buffer
// themselves.
QHash<ushort, ushort*> extendedCharTable;
QHash<ushort, ushort *> extendedCharTable;
};
}
#endif // end of EXTENDEDCHARTABLE_H
......@@ -35,8 +35,7 @@ class QAction;
class QStringList;
class QKeyEvent;
namespace Konsole
{
namespace Konsole {
class Session;
class SessionController;
class ViewManager;
......@@ -46,22 +45,21 @@ class ViewProperties;
* A re-usable terminal emulator component using the KParts framework which can
* be used to embed terminal emulators into other applications.
*/
class Part : public KParts::ReadOnlyPart , public TerminalInterface
class Part : public KParts::ReadOnlyPart, public TerminalInterface
{
Q_OBJECT
Q_INTERFACES(TerminalInterface)
public:
/** Constructs a new Konsole part with the specified parent. */
explicit Part(QWidget* parentWidget , QObject* parent, const QVariantList&);
explicit Part(QWidget *parentWidget, QObject *parent, const QVariantList &);
~Part() Q_DECL_OVERRIDE;
/** Reimplemented from TerminalInterface. */
void startProgram(const QString& program,
const QStringList& arguments) Q_DECL_OVERRIDE;
void startProgram(const QString &program, const QStringList &arguments) Q_DECL_OVERRIDE;
/** Reimplemented from TerminalInterface. */
void showShellInDir(const QString& dir) Q_DECL_OVERRIDE;
void showShellInDir(const QString &dir) Q_DECL_OVERRIDE;
/** Reimplemented from TerminalInterface. */
void sendInput(const QString& text) Q_DECL_OVERRIDE;
void sendInput(const QString &text) Q_DECL_OVERRIDE;
/** Reimplemented from TerminalInterface. */
int terminalProcessId() Q_DECL_OVERRIDE;
......@@ -84,7 +82,8 @@ public Q_SLOTS:
*
* This is highly experimental. Do not use it at the moment
*/
void createSession(const QString& profileName = QString(), const QString& directory = QString());
void createSession(const QString &profileName = QString(),
const QString &directory = QString());
/**
* Returns a list of names of all available profiles
......@@ -102,7 +101,7 @@ public Q_SLOTS:
*
* @param parent The parent widget of the new dialog.
*/
void showEditCurrentProfileDialog(QWidget* parent);
void showEditCurrentProfileDialog(QWidget *parent);
/**
* Sends a profile change command to the active session. This is equivalent to using
* the konsoleprofile tool within the session to change its settings. The @p text string
......@@ -112,7 +111,7 @@ public Q_SLOTS:
*
* This is experimental API and not guaranteed to be present in later KDE 4 releases.
*/
void changeSessionSettings(const QString& text);
void changeSessionSettings(const QString &text);
/**
* Connects to an existing pseudo-teletype. See Session::openTeletype().
......@@ -157,7 +156,7 @@ Q_SIGNALS:
* @param event Describes the keys that were pressed.
* @param override Set this to false to prevent the terminal display from overriding the shortcut
*/
void overrideShortcut(QKeyEvent* event, bool& override);
void overrideShortcut(QKeyEvent *event, bool &override);
/**
* Emitted when silence has been detected in the active session. Monitoring
......@@ -174,27 +173,27 @@ Q_SIGNALS:
/**
* Emitted when the current working directory of the active session has changed.
*/
void currentDirectoryChanged(const QString& dir);
void currentDirectoryChanged(const QString &dir);
protected:
/** Reimplemented from KParts::PartBase. */
bool openFile() Q_DECL_OVERRIDE;
bool openUrl(const QUrl& url) Q_DECL_OVERRIDE;
bool openUrl(const QUrl &url) Q_DECL_OVERRIDE;
private Q_SLOTS:
void activeViewChanged(SessionController* controller);
void activeViewTitleChanged(ViewProperties* properties);
void activeViewChanged(SessionController *controller);
void activeViewTitleChanged(ViewProperties *properties);
void terminalExited();
void newTab();
void overrideTerminalShortcut(QKeyEvent*, bool& override);
void overrideTerminalShortcut(QKeyEvent *, bool &override);
void sessionStateChanged(int state);
private:
Session* activeSession() const;
Session *activeSession() const;
private:
ViewManager* _viewManager;
SessionController* _pluggedController;
QAction* _manageProfilesAction;
ViewManager *_viewManager;
SessionController *_pluggedController;
QAction *_manageProfilesAction;
};
}
......
......@@ -23,14 +23,13 @@
#include "ui_PrintOptions.h"
namespace Konsole
{
namespace Konsole {
class PrintOptions : public QWidget, private Ui::PrintOptions
{
Q_OBJECT
public:
explicit PrintOptions(QWidget* parent = 0);
explicit PrintOptions(QWidget *parent = 0);
~PrintOptions() Q_DECL_OVERRIDE;
public Q_SLOTS:
......
......@@ -26,8 +26,7 @@
#include <QString>
#include <QVector>
namespace Konsole
{
namespace Konsole {
/**
* Takes a snapshot of the state of a process and provides access to
* information such as the process name, parent process,
......@@ -81,9 +80,11 @@ public:
* @param titleFormat The local title format - used to determine if it
* contains %u which requires expensive prodecures to be used.
*/
static ProcessInfo* newInstance(int pid, const QString& titleFormat);
static ProcessInfo *newInstance(int pid, const QString &titleFormat);
virtual ~ProcessInfo() {}
virtual ~ProcessInfo()
{
}
/**
* Updates the information about the process. This must
......@@ -98,13 +99,13 @@ public:
*
* @param ok Set to true if the process id was read successfully or false otherwise
*/
int pid(bool* ok) const;
int pid(bool *ok) const;
/**
* Returns the id of the parent process id was read successfully or false otherwise
*
* @param ok Set to true if the parent process id
*/
int parentPid(bool* ok) const;
int parentPid(bool *ok) const;
/**
* Returns the id of the current foreground process
......@@ -115,10 +116,10 @@ public:
*
* @param ok Set to true if the foreground process id was read successfully or false otherwise
*/
int foregroundPid(bool* ok) const;
int foregroundPid(bool *ok) const;
/* Returns the user id of the process */
int userId(bool* ok) const;
int userId(bool *ok) const;
/** Returns the user's name of the process */
QString userName() const;
......@@ -130,7 +131,7 @@ public:
static QString localHost();
/** Returns the name of the current process */
QString name(bool* ok) const;
QString name(bool *ok) const;
/**
* Returns the command-line arguments which the process
......@@ -140,14 +141,14 @@ public:
*
* @param ok Set to true if the arguments were read successfully or false otherwise.
*/
QVector<QString> arguments(bool* ok) const;
QVector<QString> arguments(bool *ok) const;
/**
* Returns the current working directory of the process
*
* @param ok Set to true if the current working directory was read successfully or false otherwise
*/
QString currentDir(bool* ok) const;
QString currentDir(bool *ok) const;
/**
* Returns the current working directory of the process (or its parent)
......@@ -176,20 +177,20 @@ public:
Error error() const;
enum Field {
PROCESS_ID = 1,
PARENT_PID = 2,
FOREGROUND_PID = 4,
ARGUMENTS = 8,
NAME = 16,
CURRENT_DIR = 32,
UID = 64
PROCESS_ID = 1,
PARENT_PID = 2,
FOREGROUND_PID = 4,
ARGUMENTS = 8,
NAME = 16,
CURRENT_DIR = 32,
UID = 64
};
Q_DECLARE_FLAGS(Fields, Field)
// takes a full directory path and returns a
// shortened version suitable for display in
// space-constrained UI elements (eg. tabs)
QString formatShortDir(const QString& dirPath) const;
QString formatShortDir(const QString &dirPath) const;
void setUserNameRequired(bool need);
......@@ -200,7 +201,7 @@ protected:
* static ProcessInfo::newInstance() method which will return
* a suitable ProcessInfo instance for the current platform.
*/
explicit ProcessInfo(int pid );
explicit ProcessInfo(int pid);
/**
* This is called on construction to read the process state
......@@ -239,11 +240,11 @@ protected:
/** Sets the user id associated with this ProcessInfo instance */
void setUserId(int uid);
/** Sets the user name of the process as set by readUserName() */
void setUserName(const QString& name);
void setUserName(const QString &name);
/** Sets the name of the process as returned by name() */
void setName(const QString& name);
void setName(const QString &name);
/** Sets the current working directory for the process */
void setCurrentDir(const QString& dir);
void setCurrentDir(const QString &dir);
/** Sets the error */
void setError(Error error);
......@@ -255,7 +256,7 @@ protected:
* Adds a commandline argument for the process, as returned
* by arguments()
*/
void addArgument(const QString& argument);
void addArgument(const QString &argument);
/**
* clear the commandline arguments for the process, as returned
......@@ -304,7 +305,7 @@ public:
* Constructs a new NullProcessInfo instance.
* See ProcessInfo::newInstance()
*/
explicit NullProcessInfo(int pid, const QString& titleFormat);
explicit NullProcessInfo(int pid, const QString &titleFormat);
protected:
void readProcessInfo(int pid) Q_DECL_OVERRIDE;
bool readCurrentDir(int pid) Q_DECL_OVERRIDE;
......@@ -323,14 +324,14 @@ public:
* Constructs a new instance of UnixProcessInfo.
* See ProcessInfo::newInstance()
*/
explicit UnixProcessInfo(int pid, const QString& titleFormat);
explicit UnixProcessInfo(int pid, const QString &titleFormat);
protected:
/**
* Implementation of ProcessInfo::readProcessInfo(); calls the
* four private methods below in turn.
*/
void readProcessInfo(int pid ) Q_DECL_OVERRIDE;
void readProcessInfo(int pid) Q_DECL_OVERRIDE;
void readUserName(void) Q_DECL_OVERRIDE;
......@@ -363,7 +364,7 @@ public:
*
* @param process A ProcessInfo instance for a SSH process.
*/
explicit SSHProcessInfo(const ProcessInfo& process);
explicit SSHProcessInfo(const ProcessInfo &process);
/**
* Returns the user name which the user initially logged into on
......@@ -400,10 +401,10 @@ public:
* %c - Replaced with the command which the user specified
* to execute when starting the SSH process.
*/
QString format(const QString& input) const;
QString format(const QString &input) const;
private:
const ProcessInfo& _process;
const ProcessInfo &_process;
QString _user;
QString _host;
QString _port;
......
This diff is collapsed.
......@@ -33,9 +33,7 @@ class QAction;
class QActionGroup;
class QKeySequence;
namespace Konsole
{
namespace Konsole {
/**
* ProfileList provides a list of actions which represent session profiles
* that a SessionManager can create a session from.
......@@ -60,17 +58,17 @@ public:
* in the session manager should be added to the actions
* @param parent The parent GUI object
*/
ProfileList(bool addShortcuts , QObject* parent);
ProfileList(bool addShortcuts, QObject *parent);
/**
* Returns a list of actions representing profiles
*
* The user-data associated with each action is the corresponding profile
*/
QList<QAction*> actions();
QList<QAction *> actions();
/** TODO: Document me */
void syncWidgetActions(QWidget* widget, bool sync);
void syncWidgetActions(QWidget *widget, bool sync);
Q_SIGNALS:
/**
* Emitted when the user selects an action from the list.
......@@ -81,25 +79,25 @@ Q_SIGNALS:
/**
* Emitted when the list of actions changes.
*/
void actionsChanged(const QList<QAction*>& actions);
void actionsChanged(const QList<QAction *> &actions);
private Q_SLOTS:
void triggered(QAction* action);
void triggered(QAction *action);
void favoriteChanged(Profile::Ptr profile, bool isFavorite);
void profileChanged(Profile::Ptr profile);
void shortcutChanged(Profile::Ptr profile, const QKeySequence& sequence);
void shortcutChanged(Profile::Ptr profile, const QKeySequence &sequence);
private:
QAction* actionForProfile(Profile::Ptr profile) const;
void updateAction(QAction* action , Profile::Ptr profile);
QAction *actionForProfile(Profile::Ptr profile) const;
void updateAction(QAction *action, Profile::Ptr profile);
void updateEmptyAction();
QActionGroup* _group;
QActionGroup *_group;
bool _addShortcuts;
// action to show when the list is empty
QAction* _emptyListAction;
QSet<QWidget*> _registeredWidgets;
QAction *_emptyListAction;
QSet<QWidget *> _registeredWidgets;
};