mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kpty: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
8bce018375
commit
25bc102ae0
6 changed files with 156 additions and 157 deletions
|
@ -446,7 +446,7 @@ bool KPty::setEcho(bool echo)
|
||||||
const char *KPty::ttyName() const
|
const char *KPty::ttyName() const
|
||||||
{
|
{
|
||||||
Q_D(const KPty);
|
Q_D(const KPty);
|
||||||
return d->ttyName.data();
|
return d->ttyName.constData();
|
||||||
}
|
}
|
||||||
|
|
||||||
int KPty::masterFd() const
|
int KPty::masterFd() const
|
||||||
|
|
|
@ -32,11 +32,10 @@ struct termios;
|
||||||
* Provides primitives for opening & closing a pseudo TTY pair, assigning the
|
* Provides primitives for opening & closing a pseudo TTY pair, assigning the
|
||||||
* controlling TTY, utmp registration and setting various terminal attributes.
|
* controlling TTY, utmp registration and setting various terminal attributes.
|
||||||
*/
|
*/
|
||||||
class KPTY_EXPORT KPty {
|
class KPTY_EXPORT KPty
|
||||||
|
{
|
||||||
Q_DECLARE_PRIVATE(KPty)
|
Q_DECLARE_PRIVATE(KPty)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,7 +35,8 @@ class KPtyDevicePrivate;
|
||||||
/**
|
/**
|
||||||
* Encapsulates KPty into a QIODevice, so it can be used with Q*Stream, etc.
|
* Encapsulates KPty into a QIODevice, so it can be used with Q*Stream, etc.
|
||||||
*/
|
*/
|
||||||
class KPTY_EXPORT KPtyDevice : public QIODevice, public KPty { //krazy:exclude=dpointer (via macro)
|
class KPTY_EXPORT KPtyDevice : public QIODevice, public KPty
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DECLARE_PRIVATE_MI(KPtyDevice, KPty)
|
Q_DECLARE_PRIVATE_MI(KPtyDevice, KPty)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,8 @@ class KPtyProcessPrivate : public KProcessPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KPtyProcessPrivate()
|
KPtyProcessPrivate()
|
||||||
: ptyChannels(KPtyProcess::NoChannels),
|
: pty(nullptr),
|
||||||
|
ptyChannels(KPtyProcess::NoChannels),
|
||||||
addUtmp(false)
|
addUtmp(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ class KPTY_EXPORT KPtyProcess : public KProcess
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DECLARE_PRIVATE(KPtyProcess)
|
Q_DECLARE_PRIVATE(KPtyProcess)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum PtyChannelFlag {
|
enum PtyChannelFlag {
|
||||||
NoChannels = 0, /**< The PTY is not connected to any channel. */
|
NoChannels = 0, /**< The PTY is not connected to any channel. */
|
||||||
|
@ -58,7 +57,6 @@ public:
|
||||||
AllOutputChannels = 6, /**< Connect PTY to all output channels. */
|
AllOutputChannels = 6, /**< Connect PTY to all output channels. */
|
||||||
AllChannels = 7 /**< Connect PTY to all channels. */
|
AllChannels = 7 /**< Connect PTY to all channels. */
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_FLAGS(PtyChannels, PtyChannelFlag)
|
Q_DECLARE_FLAGS(PtyChannels, PtyChannelFlag)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -138,8 +138,9 @@ void KPtyProcessTest::slotReadyRead()
|
||||||
|
|
||||||
void KPtyProcessTest::slotDoRead()
|
void KPtyProcessTest::slotDoRead()
|
||||||
{
|
{
|
||||||
while (sp.pty()->canReadLine())
|
while (sp.pty()->canReadLine()) {
|
||||||
log.append('>').append(sp.pty()->readLine()).append("$\n");
|
log.append('>').append(sp.pty()->readLine()).append("$\n");
|
||||||
|
}
|
||||||
log.append("!\n");
|
log.append("!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +197,6 @@ void KPtyProcessTest::test_pty_signals()
|
||||||
QCOMPARE(QLatin1String(log), QLatin1String(want));
|
QCOMPARE(QLatin1String(log), QLatin1String(want));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void KPtyProcessTest::test_ctty()
|
void KPtyProcessTest::test_ctty()
|
||||||
{
|
{
|
||||||
KPtyProcess p;
|
KPtyProcess p;
|
||||||
|
|
Loading…
Add table
Reference in a new issue