author | mickeyl <mickeyl> | 2003-01-21 00:37:32 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-01-21 00:37:32 (UTC) |
commit | 2f708339e301f28aadc622f4d58a2d22e0b598fb (patch) (side-by-side diff) | |
tree | 58cc0564a3e888acdcf5868ca48d21ef8f82ccec | |
parent | c5c75d4622f9c7d6aa1a8fd2ce3aed415032d932 (diff) | |
download | opie-2f708339e301f28aadc622f4d58a2d22e0b598fb.zip opie-2f708339e301f28aadc622f4d58a2d22e0b598fb.tar.gz opie-2f708339e301f28aadc622f4d58a2d22e0b598fb.tar.bz2 |
fixed a lot of errors and sloppyness to make it compile again...
-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.h | 13 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.h | 13 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_layer.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_layer.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 11 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.h | 13 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_serial.h | 21 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 12 |
11 files changed, 81 insertions, 35 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index 23d4966..b2f6a74 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp @@ -195,36 +195,36 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) m_sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); delete m_sn_e; m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); connect(m_sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error())); return 0; } int MyPty::openPty() { // This is code from the Qt DumbTerminal example int ptyfd = -1; #ifdef HAVE_OPENPTY int ttyfd; - if ( openpty(&ptyfd,&ttyfd,ttynam,0,0) ) + if ( openpty(&ptyfd,&ttyfd,m_ttynam,0,0) ) ptyfd = -1; else - close(ttyfd); // we open the ttynam ourselves. + ::close(ttyfd); // we open the ttynam ourselves. #else for (const char* c0 = "pqrstuvwxyzabcde"; ptyfd < 0 && *c0 != 0; c0++) { for (const char* c1 = "0123456789abcdef"; ptyfd < 0 && *c1 != 0; c1++) { sprintf(m_ptynam,"/dev/pty%c%c",*c0,*c1); sprintf(m_ttynam,"/dev/tty%c%c",*c0,*c1); if ((ptyfd = ::open(m_ptynam,O_RDWR)) >= 0) { if (geteuid() != 0 && !access(m_ttynam,R_OK|W_OK) == 0) { ::close(ptyfd); ptyfd = -1; } } } } #endif if ( ptyfd < 0 ) { diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp index 8dd8151..37bf797 100644 --- a/noncore/apps/opie-console/io_bt.cpp +++ b/noncore/apps/opie-console/io_bt.cpp @@ -65,16 +65,28 @@ void IOBt::reload( const Profile &config ) { m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW); } QString IOBt::identifier() const { return "bluetooth"; } QString IOBt::name() const { return "BLuetooth IO Layer"; } void IOBt::slotExited( OProcess* proc ){ close(); delete proc; } + +QBitArray IOBt::supports() const { + return QBitArray( 3 ); +} + +bool IOBt::isConnected() { + return false; +} + +void IOBt::send(const QByteArray &data) { + qDebug( "Please overload me..." ); +} diff --git a/noncore/apps/opie-console/io_bt.h b/noncore/apps/opie-console/io_bt.h index 5e9988c..239eefb 100644 --- a/noncore/apps/opie-console/io_bt.h +++ b/noncore/apps/opie-console/io_bt.h @@ -12,37 +12,40 @@ #define BT_DEFAULT_SBITS 1 #define BT_DEFAULT_FLOW 0 #define BT_DEFAULT_MAC 0 /* IOSerial implements a RS232 IO Layer */ class IOBt : public IOSerial { Q_OBJECT public: IOBt(const Profile &); ~IOBt(); - QString identifier() const; - QString name() const; + virtual QString identifier() const; + virtual QString name() const; + virtual QBitArray supports() const; + virtual bool isConnected(); signals: void received(const QByteArray &); void error(int, const QString &); public slots: - bool open(); - void close(); - void reload(const Profile &); + virtual void send( const QByteArray& ); + virtual bool open(); + virtual void close(); + virtual void reload(const Profile &); private: OProcess *m_attach; QString m_mac; private slots: void slotExited(OProcess* proc); }; #endif /* OPIE_IO_IRDA */ diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index b3b693f..e360fb4 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp @@ -50,16 +50,28 @@ void IOIrda::reload( const Profile &config ) { m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); } QString IOIrda::identifier() const { return "irda"; } QString IOIrda::name() const { return "Irda IO Layer"; } void IOIrda::slotExited(OProcess* proc ){ close(); delete proc; } + +QBitArray IOIrda::supports()const { + return QBitArray( 3 ); +} + +bool IOIrda::isConnected() { + return false; +} + +void IOIrda::send(const QByteArray &data) { + qDebug( "Please overload me..." ); +} diff --git a/noncore/apps/opie-console/io_irda.h b/noncore/apps/opie-console/io_irda.h index 3aee951..14b1ae3 100644 --- a/noncore/apps/opie-console/io_irda.h +++ b/noncore/apps/opie-console/io_irda.h @@ -10,37 +10,40 @@ #define IRDA_DEFAULT_PARITY 0 #define IRDA_DEFAULT_DBITS 8 #define IRDA_DEFAULT_SBITS 1 #define IRDA_DEFAULT_FLOW 0 /* IOSerial implements a RS232 IO Layer */ class IOIrda : public IOSerial { Q_OBJECT public: IOIrda(const Profile &); ~IOIrda(); - QString identifier() const; - QString name() const; + virtual QString identifier() const; + virtual QString name() const; + virtual QBitArray supports() const; + virtual bool isConnected(); signals: void received(const QByteArray &); void error(int, const QString &); public slots: - bool open(); - void close(); - void reload(const Profile &); + virtual void send( const QByteArray& ); + virtual bool open(); + virtual void close(); + virtual void reload(const Profile &); private: OProcess *m_attach; private slots: void slotExited(OProcess* proc); }; #endif /* OPIE_IO_IRDA */ diff --git a/noncore/apps/opie-console/io_layer.cpp b/noncore/apps/opie-console/io_layer.cpp index 975ee60..52ec828 100644 --- a/noncore/apps/opie-console/io_layer.cpp +++ b/noncore/apps/opie-console/io_layer.cpp @@ -7,16 +7,17 @@ IOLayer::IOLayer() IOLayer::IOLayer(const Profile &) : QObject() { } IOLayer::~IOLayer() { } int IOLayer::rawIO()const{ return -1; } void IOLayer::closeRawIO(int) { } void IOLayer::setSize(int, int ) { } + diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h index ed4478b..4f9bbe4 100644 --- a/noncore/apps/opie-console/io_layer.h +++ b/noncore/apps/opie-console/io_layer.h @@ -52,45 +52,45 @@ public: * a small internal identifier */ virtual QString identifier() const = 0; /** * a short name */ virtual QString name() const = 0; /** * a file descriptor which opens * the device for io but does not * do any ioctling on it... * and it'll stop listening to the before opened * device */ - virtual int rawIO()const; + virtual int rawIO() const; /** * will close the rawIO stuff * and will listen to it's data again... */ virtual void closeRawIO(int); /** * What does the IOLayer support? * Bits are related to features */ - virtual QBitArray supports()const = 0; + virtual QBitArray supports() const = 0; virtual bool isConnected() = 0; signals: /** * received input as QCString */ virtual void received( const QByteArray& ); /** * an error occured * int for the error number * and QString for a text */ virtual void error( int, const QString& ); diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index 896c24f..1ce680a 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp @@ -80,16 +80,27 @@ void IOModem::reload( const Profile &config ) { QString IOModem::identifier() const { return "modem"; } QString IOModem::name() const { return "Modem IO Layer"; } void IOModem::slotExited(OProcess* proc ){ close(); /* delete it afterwards */ delete proc; } +QBitArray IOModem::supports()const { + return QBitArray( 3 ); +} + +bool IOModem::isConnected() { + return false; +} + +void IOModem::send(const QByteArray &data) { + qDebug( "Please overload me..." ); +} diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h index 17228bd..2a926df 100644 --- a/noncore/apps/opie-console/io_modem.h +++ b/noncore/apps/opie-console/io_modem.h @@ -30,42 +30,45 @@ #define MODEM_DEFAULT_DTR_DROP_TIME 1 #define MODEM_DEFAULT_BPS_DETECT 0 // bool #define MODEM_DEFAULT_DCD_LINES 1 //bool #define MODEM_DEFAULT_MULTI_LINE_UNTAG 0 // bool /* IOSerial implements a RS232 IO Layer */ class IOModem : public IOSerial { Q_OBJECT public: IOModem(const Profile &); ~IOModem(); - QString identifier() const; - QString name() const; + virtual QString identifier() const; + virtual QString name() const; + virtual QBitArray supports() const; + virtual bool isConnected(); signals: void received(const QByteArray &); void error(int, const QString &); public slots: - bool open(); - void close(); - void reload(const Profile &); + virtual void send( const QByteArray& ); + virtual bool open(); + virtual void close(); + virtual void reload(const Profile &); private: QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, m_bpsDetect, m_dcdLines, m_multiLineUntag; Profile m_profile; private slots: void slotExited(OProcess* proc); }; #endif diff --git a/noncore/apps/opie-console/io_serial.h b/noncore/apps/opie-console/io_serial.h index edceac6..20c1ae1 100644 --- a/noncore/apps/opie-console/io_serial.h +++ b/noncore/apps/opie-console/io_serial.h @@ -20,47 +20,48 @@ public: enum Parity { ParityNone = 0, ParityEven, ParityOdd, ParitySpace, ParityMark }; enum Flow { FlowHW = 0x01, FlowSW = 0x02 }; IOSerial(const Profile &); ~IOSerial(); - QString identifier() const; - QString name() const; - int rawIO()const; - void closeRawIO(int fd ); - QBitArray supports()const; - bool isConnected(); + virtual QString identifier() const; + virtual QString name() const; + int rawIO() const; + void closeRawIO (int fd ); + virtual QBitArray supports() const; + virtual bool isConnected(); + /*signals: void received(const QByteArray &); void error(int, const QString &); */ public slots: - void send(const QByteArray &); - bool open(); - void close(); - void reload(const Profile &); + virtual void send(const QByteArray &); + virtual bool open(); + virtual void close(); + virtual void reload(const Profile &); protected: int baud(int baud) const; void internDetach(); void internAttach(); protected slots: void dataArrived(); void errorOccured(); protected: QSocketNotifier *m_read; QSocketNotifier *m_error; QString m_device; int m_baud; int m_parity; int m_dbits; int m_sbits; int m_flow; diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index 1bb9f35..5ffa46f 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro @@ -1,77 +1,77 @@ TEMPLATE = app -TMAKE_CXXFLAGS =-DHAVE_OPENPTY -CONFIG = qt warn_on release +TMAKE_CXXFLAGS += -DHAVE_OPENPTY +CONFIG += qt warn_on release #CONFIG = qt debug DESTDIR = $(OPIEDIR)/bin HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ file_layer.h filetransfer.h \ metafactory.h \ session.h \ mainwindow.h \ profile.h \ profileconfig.h \ profilemanager.h \ configwidget.h \ tabwidget.h \ configdialog.h \ keytrans.h \ transferdialog.h \ profiledialogwidget.h \ profileeditordialog.h \ default.h \ iolayerbase.h \ serialconfigwidget.h irdaconfigwidget.h \ btconfigwidget.h modemconfigwidget.h \ atconfigdialog.h dialdialog.h \ procctl.h \ function_keyboard.h \ receive_layer.h filereceive.h \ script.h \ dialer.h \ terminalwidget.h \ emulation_handler.h TECommon.h \ - TEHistroy.h TEScreen.h TEWidget.h \ + TEHistory.h TEScreen.h TEWidget.h \ TEmuVt102.h TEmulation.h MyPty.h \ - consoleconfigwidget.h + consoleconfigwidget.h SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ file_layer.cpp filetransfer.cpp \ main.cpp \ metafactory.cpp \ session.cpp \ mainwindow.cpp \ profile.cpp \ profileconfig.cpp \ profilemanager.cpp \ tabwidget.cpp \ configdialog.cpp \ keytrans.cpp \ transferdialog.cpp \ profiledialogwidget.cpp \ profileeditordialog.cpp \ iolayerbase.cpp \ serialconfigwidget.cpp irdaconfigwidget.cpp \ btconfigwidget.cpp modemconfigwidget.cpp \ atconfigdialog.cpp dialdialog.cpp \ default.cpp procctl.cpp \ function_keyboard.cpp \ receive_layer.cpp filereceive.cpp \ script.cpp \ dialer.cpp \ terminalwidget.cpp \ emulation_handler.cpp TEHistory.cpp \ TEScreen.cpp TEWidget.cpp \ TEmuVt102.cpp TEmulation.cpp MyPty.cpp \ - consoleconfigwidget.cpp + consoleconfigwidget.cpp INTERFACES = configurebase.ui editbase.ui INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopie +LIBS += -lqpe -lopie -lutil TARGET = opie-console include ( ../../../include.pro ) |