kpty: format and indent

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-06-21 02:39:54 +03:00
parent 8bce018375
commit 25bc102ae0
6 changed files with 156 additions and 157 deletions

View file

@ -446,7 +446,7 @@ bool KPty::setEcho(bool echo)
const char *KPty::ttyName() const
{
Q_D(const KPty);
return d->ttyName.data();
return d->ttyName.constData();
}
int KPty::masterFd() const

View file

@ -32,11 +32,10 @@ struct termios;
* Provides primitives for opening & closing a pseudo TTY pair, assigning the
* controlling TTY, utmp registration and setting various terminal attributes.
*/
class KPTY_EXPORT KPty {
class KPTY_EXPORT KPty
{
Q_DECLARE_PRIVATE(KPty)
public:
/**
* Constructor
*/

View file

@ -35,7 +35,8 @@ class KPtyDevicePrivate;
/**
* 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_DECLARE_PRIVATE_MI(KPtyDevice, KPty)

View file

@ -37,7 +37,8 @@ class KPtyProcessPrivate : public KProcessPrivate
{
public:
KPtyProcessPrivate()
: ptyChannels(KPtyProcess::NoChannels),
: pty(nullptr),
ptyChannels(KPtyProcess::NoChannels),
addUtmp(false)
{
}

View file

@ -48,7 +48,6 @@ class KPTY_EXPORT KPtyProcess : public KProcess
{
Q_OBJECT
Q_DECLARE_PRIVATE(KPtyProcess)
public:
enum PtyChannelFlag {
NoChannels = 0, /**< The PTY is not connected to any channel. */
@ -58,7 +57,6 @@ public:
AllOutputChannels = 6, /**< Connect PTY to all output channels. */
AllChannels = 7 /**< Connect PTY to all channels. */
};
Q_DECLARE_FLAGS(PtyChannels, PtyChannelFlag)
/**

View file

@ -138,8 +138,9 @@ void KPtyProcessTest::slotReadyRead()
void KPtyProcessTest::slotDoRead()
{
while (sp.pty()->canReadLine())
while (sp.pty()->canReadLine()) {
log.append('>').append(sp.pty()->readLine()).append("$\n");
}
log.append("!\n");
}
@ -196,7 +197,6 @@ void KPtyProcessTest::test_pty_signals()
QCOMPARE(QLatin1String(log), QLatin1String(want));
}
void KPtyProcessTest::test_ctty()
{
KPtyProcess p;