fixed #11 compile against Qt 5 (Qt4 and Qt5 supported and waguely tested)

This commit is contained in:
Petr Vanek
2014-04-11 21:28:52 +02:00
parent d6ceb5ae00
commit 5d3ef34cc2
35 changed files with 138 additions and 127 deletions
+4 -4
View File
@@ -24,6 +24,8 @@
#include "kpty_p.h"
#include <QtDebug>
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#define HAVE_LOGIN
@@ -138,8 +140,6 @@ extern "C" {
//#include <kdebug.h>
//#include <kstandarddirs.h> // findExe
#include <QtCore>
// not defined on HP-UX for example
#ifndef CTRL
# define CTRL(x) ((x) & 037)
@@ -269,8 +269,8 @@ bool KPty::open()
// Linux device names, FIXME: Trouble on other systems?
for (const char * s3 = "pqrstuvwxyzabcde"; *s3; s3++) {
for (const char * s4 = "0123456789abcdef"; *s4; s4++) {
ptyName = QString().sprintf("/dev/pty%c%c", *s3, *s4).toAscii();
d->ttyName = QString().sprintf("/dev/tty%c%c", *s3, *s4).toAscii();
ptyName = QString().sprintf("/dev/pty%c%c", *s3, *s4).toUtf8();
d->ttyName = QString().sprintf("/dev/tty%c%c", *s3, *s4).toUtf8();
d->masterFd = ::open(ptyName.data(), O_RDWR);
if (d->masterFd >= 0) {