summaryrefslogtreecommitdiff
authorzecke <zecke>2002-10-15 10:55:58 (UTC)
committer zecke <zecke>2002-10-15 10:55:58 (UTC)
commitf2e9de1c8b6d3b2b2e82dec23ebf502c5805f575 (patch) (side-by-side diff)
tree108efdb1a75a78dd212a69ccad718c2e65ece0bf
parentdaae7a75b0e9ccbf1ea4c699c631ad77825e6301 (diff)
downloadopie-f2e9de1c8b6d3b2b2e82dec23ebf502c5805f575.zip
opie-f2e9de1c8b6d3b2b2e82dec23ebf502c5805f575.tar.gz
opie-f2e9de1c8b6d3b2b2e82dec23ebf502c5805f575.tar.bz2
Remove debugging output
Fix possible crashes in io_bt and io_irda
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp6
-rw-r--r--noncore/apps/opie-console/configdialog.cpp1
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp6
-rw-r--r--noncore/apps/opie-console/filereceive.cpp2
-rw-r--r--noncore/apps/opie-console/filetransfer.cpp6
-rw-r--r--noncore/apps/opie-console/io_bt.cpp1
-rw-r--r--noncore/apps/opie-console/io_irda.cpp2
-rw-r--r--noncore/apps/opie-console/io_serial.cpp8
-rw-r--r--noncore/apps/opie-console/iolayerbase.cpp3
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp5
-rw-r--r--noncore/apps/opie-console/metafactory.cpp1
-rw-r--r--noncore/apps/opie-console/procctl.cpp1
-rw-r--r--noncore/apps/opie-console/profile.cpp2
-rw-r--r--noncore/apps/opie-console/profileconfig.cpp1
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp7
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp4
-rw-r--r--noncore/apps/opie-console/session.cpp1
-rw-r--r--noncore/apps/opie-console/tabwidget.cpp1
18 files changed, 3 insertions, 55 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index ae01392..b6ae1d9 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -105,45 +105,43 @@ void MyPty::setSize(int lines, int columns)
ioctl(m_fd,TIOCSWINSZ,(char *)&wsize);
}
void MyPty::donePty()
{
// This is code from the Qt DumbTerminal example
int status = 0;
::close(m_fd);
if (m_cpid) {
- qWarning("killing!!!");
kill(m_cpid, SIGHUP);
//waitpid(m_cpid, &status, 0);
delete m_sn_e;
m_sn_e = 0l;
}
m_cpid = 0;
// emit done(status);
}
const char* MyPty::deviceName()
{
return m_ttynam;
}
void MyPty::error()
{
- qWarning("error");
// This is code from the Qt DumbTerminal example
donePty();
}
void MyPty::start() {
char* cmd = "/bin/sh";
QStrList lis;
int r =run(cmd, lis, 0, 0);
r = r;
}
/*!
start the client program.
@@ -259,48 +257,44 @@ bool MyPty::open() {
start();
return true;
}
void MyPty::close() {
donePty();
}
void MyPty::reload( const Profile& ) {
}
/*! sends len bytes through the line */
void MyPty::send(const QByteArray& ar)
{
- qWarning("sending!");
#ifdef VERBOSE_DEBUG
// verbose debug
printf("sending bytes:\n");
for (uint i = 0; i < ar.count(); i++)
printf("%c", ar[i]);
printf("\n");
#endif
::write(m_fd, ar.data(), ar.count());
}
/*! indicates that a block of data is received */
void MyPty::readPty()
{
- qWarning("read");
QByteArray buf(4096);
int len = ::read( m_fd, buf.data(), 4096 );
if (len == -1 || len == 0) {
- qWarning("donePty!!! now!");
donePty();
- qWarning("return %s", sender()->className() );
delete sender();
return;
}
if (len < 0)
return;
buf.resize(len);
emit received(buf);
#ifdef VERBOSE_DEBUG
diff --git a/noncore/apps/opie-console/configdialog.cpp b/noncore/apps/opie-console/configdialog.cpp
index 8745305..0bc6588 100644
--- a/noncore/apps/opie-console/configdialog.cpp
+++ b/noncore/apps/opie-console/configdialog.cpp
@@ -83,25 +83,24 @@ void ConfigDialog::slotEdit() {
{
if(lstView->currentItem()) delete lstView->currentItem();
// use dlg.terminal()!
Profile p = dlg.profile();
new ConfigListItem(lstView, p);
}
}
void ConfigDialog::slotAdd() {
- qWarning("slotAdd");
ProfileEditorDialog dlg(m_fact);
dlg.setCaption("New Connection");
dlg.showMaximized();
int ret = dlg.exec();
if(ret == QDialog::Accepted)
{
// TODO: Move into general profile save part
// assignments
//QString type = dlg.term_type();
//if(type == "VT102") profile = Profile::VT102;
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 836a05b..b2cd348 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -28,29 +28,27 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c
}
EmulationHandler::~EmulationHandler() {
delete m_teEmu;
delete m_teWid;
}
void EmulationHandler::load( const Profile& prof) {
m_teWid->setVTFont( font( prof.readNumEntry("Font") ) );
int num = prof.readNumEntry("Color");
setColor( foreColor(num), backColor(num) );
m_teWid->setBackgroundColor(backColor(num) );
}
void EmulationHandler::recv( const QByteArray& ar) {
- qWarning("received in EmulationHandler!");
m_teEmu->onRcvBlock(ar.data(), ar.count() );
}
void EmulationHandler::recvEmulation(const char* src, int len ) {
- qWarning("received from te ");
QByteArray ar(len);
memcpy(ar.data(), src, sizeof(char) * len );
emit send(ar);
}
QWidget* EmulationHandler::widget() {
return m_teWid;
}
/*
* allocate a new table of colors
*/
@@ -90,57 +88,53 @@ QFont EmulationHandler::font( int id ) {
break;
}
QFont font(name, size, QFont::Normal );
font.setFixedPitch(TRUE );
return font;
}
QColor EmulationHandler::foreColor(int col) {
QColor co;
/* we need to switch it */
switch( col ) {
default:
case Profile::White:
- qWarning("Foreground black");
/* color is black */
co = Qt::white;
break;
case Profile::Black:
- qWarning("Foreground white");
co = Qt::black;
break;
case Profile::Green:
qWarning("Foreground green");
co = Qt::green;
break;
case Profile::Orange:
qWarning("Foreground orange");
// FIXME needs better color here
co = Qt::darkYellow;
break;
}
return co;
}
QColor EmulationHandler::backColor(int col ) {
QColor co;
/* we need to switch it */
switch( col ) {
default:
case Profile::White:
- qWarning("Background white");
/* color is white */
co = Qt::black;
break;
case Profile::Black:
- qWarning("Background black");
co = Qt::white;
break;
case Profile::Green:
qWarning("Background black");
co = Qt::black;
break;
case Profile::Orange:
qWarning("Background black");
co = Qt::black;
break;
}
diff --git a/noncore/apps/opie-console/filereceive.cpp b/noncore/apps/opie-console/filereceive.cpp
index 26b3dec..e517862 100644
--- a/noncore/apps/opie-console/filereceive.cpp
+++ b/noncore/apps/opie-console/filereceive.cpp
@@ -126,31 +126,29 @@ void FileReceive::setupChild() {
* now set the communication
* m_fd STDIN_FILENO
* STDOUT_FILENO
* STDERR_FILENO
*/
dup2( m_fd, STDIN_FILENO );
dup2( m_fd, STDOUT_FILENO );
dup2( m_comm[1], STDERR_FILENO );
}
void FileReceive::slotRead() {
QByteArray ar(4096);
int len = read(m_comm[0], ar.data(), 4096 );
- qWarning("slot read %d", len);
for (int i = 0; i < len; i++ ) {
// printf("%c", ar[i] );
}
ar.resize( len );
QString str( ar );
- qWarning(str.simplifyWhiteSpace() );
}
void FileReceive::slotExec() {
char buf[2];
::read(m_term[0], buf, 1 );
delete m_proc;
delete m_not;
m_not = m_proc = 0l;
close( m_term[0] );
close( m_term[1] );
close( m_comm[0] );
close( m_comm[1] );
layer()->closeRawIO(m_fd);
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp
index 8ca0df2..b81c2a2 100644
--- a/noncore/apps/opie-console/filetransfer.cpp
+++ b/noncore/apps/opie-console/filetransfer.cpp
@@ -44,25 +44,24 @@ void FileTransfer::sendFile( const QString& file ) {
if ( pipe( m_info ) < 0 )
m_info[0] = m_info[1] = 0;
m_pid = fork();
switch( m_pid ) {
case -1:
emit error( StartError, tr("Was not able to fork") );
slotExec();
break;
case 0:{
setupChild();
- qWarning("output:"+file );
/* exec */
char* verbose = "-vv";
char* binray = "-b";
char* typus;
switch(m_type ) {
case SZ:
typus = "";
break;
case SX:
typus = "-X";
@@ -157,37 +156,34 @@ void FileTransfer::setupChild() {
dup2( m_fd, STDIN_FILENO );
dup2( m_fd, STDOUT_FILENO );
dup2( m_comm[1], STDERR_FILENO );
}
/*
* read from the stderr of the child
* process
*/
void FileTransfer::slotRead() {
QByteArray ar(4096);
int len = read(m_comm[0], ar.data(), 4096 );
- qWarning("slot read %d", len);
for (int i = 0; i < len; i++ ) {
// printf("%c", ar[i] );
}
ar.resize( len );
QString str( ar );
- qWarning(str.simplifyWhiteSpace() );
QStringList lis = QStringList::split(' ', str );
/*
* Transfer finished.. either complete or incomplete
*/
if ( lis[0].simplifyWhiteSpace() == "Transfer" ) {
- qWarning("sent!!!!");
return;
}
/*
* do progress reading
*/
slotProgress( lis );
}
/*
* find the progress
*/
@@ -205,25 +201,24 @@ void FileTransfer::slotProgress( const QStringList& list ) {
// Data looks like this
// 0 1 2 3 4 5
// Bytes Sent 65536/11534336 BPS:7784 ETA 24:33
QStringList progi = QStringList::split('/', list[2].simplifyWhiteSpace() );
sent = progi[0].toULong(&complete );
if (!complete ) return;
total = progi[1].toULong(&complete );
if (!complete || total == 0) {
return;
}
- qWarning("%s, %d, %d", progi.join("/").latin1(), sent, total );
double pro = (double)sent/total;
int prog = pro * 100;
// speed
progi = QStringList::split(':', list[3].simplifyWhiteSpace() );
bps = progi[1].toInt();
// time
progi = QStringList::split(':', list[5].simplifyWhiteSpace() );
min = progi[0].toInt();
sec = progi[1].toInt();
@@ -231,25 +226,24 @@ void FileTransfer::slotProgress( const QStringList& list ) {
if ( prog > m_prog ) {
m_prog = prog;
emit progress(m_file, m_prog, bps, -1, min , sec );
}
}
void FileTransfer::cancel() {
if(m_pid > 0) ::kill(m_pid,9 );
}
void FileTransfer::slotExec() {
- qWarning("exited!");
char buf[2];
::read(m_term[0], buf, 1 );
delete m_proc;
delete m_not;
m_proc = m_not = 0l;
close( m_term[0] );
close( m_term[1] );
close( m_comm[0] );
close( m_comm[1] );
layer()->closeRawIO( m_fd );
emit sent();
m_pid = 0;
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index 8bff4df..0831faf 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -27,24 +27,25 @@ bool IOBt::open() {
*m_attach << "hciattach /dev/ttyS2 any 57600";
// then start hcid, then rcfomm handling (m_mac)
connect( m_attach, SIGNAL( processExited( OProcess* ) ),
this, SLOT( slotExited( OProcess* ) ) );
if ( m_attach->start() ) {
IOSerial::open();
} else {
qWarning("could not attach to device");
delete m_attach;
+ m_attach = 0;
}
}
void IOBt::reload( const Profile &config ) {
m_device = config.readEntry("Device", BT_DEFAULT_DEVICE);
m_mac = config.readEntry("Mac", BT_DEFAULT_MAC);
m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD);
m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY);
m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS);
m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS);
m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW);
}
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp
index 8e31e82..56a373c 100644
--- a/noncore/apps/opie-console/io_irda.cpp
+++ b/noncore/apps/opie-console/io_irda.cpp
@@ -23,26 +23,28 @@ void IOIrda::close() {
bool IOIrda::open() {
// irdaattach here
m_attach = new OProcess();
*m_attach << "irattach /dev/ttyS2 -s";
connect( m_attach, SIGNAL( processExited( OProcess* ) ),
this, SLOT( slotExited( OProcess* ) ) );
if ( m_attach->start() ) {
IOSerial::open();
} else {
+ // emit error!!!
qWarning("could not attach to device");
delete m_attach;
+ m_attach = 0l;
}
}
void IOIrda::reload( const Profile &config ) {
m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE);
m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD);
m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY);
m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS);
m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS);
m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW);
}
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index 03f1b1a..a4a6f0b 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -18,52 +18,47 @@ IOSerial::~IOSerial() {
}
}
void IOSerial::send(const QByteArray &data) {
if (m_fd) {
write(m_fd, data.data(), data.size());
} else {
emit error(Refuse, tr("Not connected"));
}
}
void IOSerial::close() {
- qWarning("closing!");
if (m_fd) {
delete m_read;
delete m_error;
::close(m_fd);
m_fd = 0;
} else {
emit error(Refuse, tr("Not connected"));
}
}
bool IOSerial::open() {
- qWarning("open");
if (!m_fd) {
- qWarning("going to open %s", m_device.latin1());
struct termios tty;
m_fd = ::open(m_device, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (m_fd < 0) {
- qWarning(" fd < 0 ");
emit error(CouldNotOpen, strerror(errno));
return FALSE;
}
tcgetattr(m_fd, &tty);
/* Baud rate */
int speed = baud(m_baud);
if (speed == -1) {
- qWarning("speed -1");
emit error(Refuse, tr("Invalid baud rate"));
}
cfsetospeed(&tty, speed);
cfsetispeed(&tty, speed);
/* Take care of Space / Mark parity */
if (m_dbits == 7 && (m_parity == ParitySpace || m_parity == ParityMark)) {
m_dbits = 8;
}
/* Data bits */
switch (m_dbits) {
@@ -109,35 +104,32 @@ bool IOSerial::open() {
tty.c_cflag |= (PARENB | PARODD);
/* Set the changes */
tcsetattr(m_fd, TCSANOW, &tty);
/* Notifications on read & errors */
m_read = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
m_error = new QSocketNotifier(m_fd, QSocketNotifier::Exception, this);
connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived()));
connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured()));
return TRUE;
} else {
- qWarning(" already opened");
emit error(Refuse, tr("Device is already connected"));
m_fd = 0;
return FALSE;
}
}
void IOSerial::reload(const Profile &config) {
m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE);
- qWarning( "Dev" +m_device );
- qWarning( "Conf:" +config.readEntry("Device") );
m_baud = config.readNumEntry("Speed", SERIAL_DEFAULT_BAUD);
m_parity = config.readNumEntry("Parity", SERIAL_DEFAULT_PARITY);
m_dbits = config.readNumEntry("DataBits", SERIAL_DEFAULT_DBITS);
m_sbits = config.readNumEntry("StopBits", SERIAL_DEFAULT_SBITS);
m_flow = config.readNumEntry("Flow", SERIAL_DEFAULT_FLOW);
}
int IOSerial::baud(int baud) const {
switch (baud) {
case 300: return B300; break;
case 600: return B600; break;
diff --git a/noncore/apps/opie-console/iolayerbase.cpp b/noncore/apps/opie-console/iolayerbase.cpp
index 49ed284..b0df02d 100644
--- a/noncore/apps/opie-console/iolayerbase.cpp
+++ b/noncore/apps/opie-console/iolayerbase.cpp
@@ -120,31 +120,28 @@ void IOLayerBase::setSpeed( Speed sp ) {
break;
case Baud_19200:
index = id_baud_19200;
break;
case Baud_9600:
index = id_baud_9600;
break;
}
m_speedBox->setCurrentItem(index );
}
IOLayerBase::Flow IOLayerBase::flow()const {
if (m_flowHw->isChecked() ) {
- qWarning("Hardware flow");
return Hardware;
}else if( m_flowSw->isChecked() ) {
- qWarning("Software");
return Software;
} else {
- qWarning("None");
return None;
}
}
IOLayerBase::Parity IOLayerBase::parity()const {
if ( m_parityOdd->isChecked() ) {
return Odd;
} else if ( m_parityEven->isChecked() ) {
return Even;
} else {
return NonePar;
}
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index b770551..94c99bc 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -254,25 +254,24 @@ MetaFactory* MainWindow::factory() {
return m_factory;
}
Session* MainWindow::currentSession() {
return m_curSession;
}
QList<Session> MainWindow::sessions() {
return m_sessions;
}
void MainWindow::slotNew() {
- qWarning("New Connection");
ProfileEditorDialog dlg(factory() );
dlg.showMaximized();
int ret = dlg.exec();
if ( ret == QDialog::Accepted ) {
create( dlg.profile() );
}
}
void MainWindow::slotRecordScript() {
/* if (currentSession()) {
currentSession()->emulationLayer()->startRecording();
@@ -330,46 +329,43 @@ void MainWindow::slotDisconnect() {
}
}
void MainWindow::slotTerminate() {
if ( currentSession() )
currentSession()->layer()->close();
slotClose();
/* FIXME move to the next session */
}
void MainWindow::slotConfigure() {
- qWarning("configure");
ConfigDialog conf( manager()->all(), factory() );
conf.showMaximized();
int ret = conf.exec();
if ( QDialog::Accepted == ret ) {
- qWarning("conf %d", conf.list().count() );
manager()->setProfiles( conf.list() );
manager()->save();
populateProfiles();
}
}
/*
* we will remove
* this window from the tabwidget
* remove it from the list
* delete it
* and set the currentSession()
*/
void MainWindow::slotClose() {
- qWarning("close");
if (!currentSession() )
return;
tabWidget()->remove( currentSession() );
/*it's autodelete */
m_sessions.remove( m_curSession );
m_curSession = m_sessions.first();
tabWidget()->setCurrent( m_curSession );
if (!currentSession() ) {
m_connect->setEnabled( false );
m_disconnect->setEnabled( false );
@@ -429,25 +425,24 @@ void MainWindow::slotTransfer()
}
}
void MainWindow::slotOpenKeb(bool state) {
if (state) m_keyBar->show();
else m_keyBar->hide();
}
void MainWindow::slotSessionChanged( Session* ses ) {
if ( ses ) {
- qWarning("changing %s", ses->name().latin1() );
m_curSession = ses;
if ( m_curSession->isConnected() ) {
m_connect->setEnabled( false );
m_disconnect->setEnabled( true );
} else {
m_connect->setEnabled( true );
m_disconnect->setEnabled( false );
}
}
}
diff --git a/noncore/apps/opie-console/metafactory.cpp b/noncore/apps/opie-console/metafactory.cpp
index 09ba586..04a5dfa 100644
--- a/noncore/apps/opie-console/metafactory.cpp
+++ b/noncore/apps/opie-console/metafactory.cpp
@@ -111,25 +111,24 @@ ProfileDialogWidget *MetaFactory::newConnectionPlugin ( const QString& str, QWid
QMap<QString, configWidget>::Iterator it;
it = m_conFact.find( str );
if ( it != m_conFact.end() ) {
wid = (*(it.data() ) )(str,parent);
}
return wid;
}
ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget *parent) {
if (str.isEmpty() )
return 0l;
ProfileDialogWidget* wid = 0l;
- qWarning("new terminalPlugin %s %l", str.latin1(), parent );
QMap<QString, configWidget>::Iterator it;
it = m_termFact.find( str );
if ( it != m_termFact.end() ) {
wid = (*(it.data() ) )(str,parent);
}
return wid;
}
EmulationLayer* MetaFactory::newEmulationLayer( const QString& str, WidgetLayer* wid) {
EmulationLayer* lay = 0l;
QMap<QString, emulationLayer>::Iterator it;
diff --git a/noncore/apps/opie-console/procctl.cpp b/noncore/apps/opie-console/procctl.cpp
index d1cfaf6..ff6bea8 100644
--- a/noncore/apps/opie-console/procctl.cpp
+++ b/noncore/apps/opie-console/procctl.cpp
@@ -62,25 +62,24 @@ void ProcCtl::remove( ProcContainer con ) {
remove( con.pid );
}
int ProcCtl::status(pid_t pid )const{
ProcContainer *con = m_last;
while (con) {
if (con->pid == pid )
return con->status;
con = con->prev;
}
return -1;
}
void ProcCtl::signal_handler(int) {
- qWarning("signal handler in ProcCtl");
int status;
signal( SIGCHLD, signal_handler );
pid_t pi = waitpid( -1, &status, WNOHANG );
/*
* find the container for pid
*
*/
if ( pi < 0 ) {
return;
}
diff --git a/noncore/apps/opie-console/profile.cpp b/noncore/apps/opie-console/profile.cpp
index ffd672e..1a94619 100644
--- a/noncore/apps/opie-console/profile.cpp
+++ b/noncore/apps/opie-console/profile.cpp
@@ -69,29 +69,27 @@ void Profile::setBackground( int back ) {
}
void Profile::setForeground( int fore ) {
m_fore = fore;
}
void Profile::setTerminal( int term ) {
m_terminal = term;
}
/* config stuff */
void Profile::clearConf() {
m_conf.clear();
}
void Profile::writeEntry( const QString& key, const QString& value ) {
- qWarning("key %s value %s", key.latin1(), value.latin1() );
m_conf.replace( key, value );
}
void Profile::writeEntry( const QString& key, int num ) {
- qWarning("num");
writeEntry( key, QString::number( num ) );
}
void Profile::writeEntry( const QString& key, bool b ) {
writeEntry( key, QString::number(b) );
}
void Profile::writeEntry( const QString& key, const QStringList& lis, const QChar& sep ) {
writeEntry( key, lis.join(sep) );
}
QString Profile::readEntry( const QString& key, const QString& deflt )const {
QMap<QString, QString>::ConstIterator it;
it = m_conf.find( key );
diff --git a/noncore/apps/opie-console/profileconfig.cpp b/noncore/apps/opie-console/profileconfig.cpp
index 732fae7..bd089c8 100644
--- a/noncore/apps/opie-console/profileconfig.cpp
+++ b/noncore/apps/opie-console/profileconfig.cpp
@@ -3,25 +3,24 @@
ProfileConfig::ProfileConfig( const QString& prof )
: Config( prof )
{
}
ProfileConfig::~ProfileConfig() {
}
QStringList ProfileConfig::groups()const {
QStringList list;
QMap<QString, ConfigGroup>::ConstIterator it;
it= Config::groups.begin();
- qWarning("config %d", Config::groups.count() );
for (; it != Config::groups.end(); ++it )
list << it.key();
return list;
}
void ProfileConfig::clearAll() {
QMap<QString, ConfigGroup>::ConstIterator it;
it = Config::groups.begin();
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 094c871..b709cf3 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -106,28 +106,24 @@ void ProfileEditorDialog::initUI()
list = m_fact->terminalWidgets();
for (it =list.begin(); it != list.end(); ++it ) {
m_termCmb->insertItem( (*it) );
}
// load profile values
m_name->setText(m_prof.name());
slotConActivated( m_fact->external(m_prof.ioLayerName() ) );
slotTermActivated( m_fact->external(m_prof.terminalName() ) );
setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb );
setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb );
- qWarning("Layer: %s %s", m_prof.ioLayerName().data(),
- m_fact->external(m_prof.ioLayerName() ).latin1() );
- qWarning("Term: %s %s", m_prof.terminalName().data(),
- m_fact->external(m_prof.terminalName() ).latin1() );
// signal and slots
connect(m_conCmb, SIGNAL(activated(const QString& ) ),
this, SLOT(slotConActivated(const QString&) ) );
connect(m_termCmb, SIGNAL(activated(const QString& ) ),
this, SLOT(slotTermActivated(const QString& ) ) );
}
ProfileEditorDialog::~ProfileEditorDialog() {
}
@@ -138,26 +134,24 @@ void ProfileEditorDialog::accept()
QMessageBox::information(this,
QObject::tr("Invalid profile"),
QObject::tr("Please enter a profile name."));
return;
}
// Save profile and plugin profile
//if(plugin_plugin) plugin_plugin->save();
// Save general values
m_prof.setName(profName());
m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) );
m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) );
- qWarning("Term %s %s", m_fact->internal(m_termCmb->currentText() ).data(),
- m_termCmb->currentText().latin1() );
if (m_con )
m_con->save( m_prof );
if (m_term )
m_term->save( m_prof );
QDialog::accept();
}
QString ProfileEditorDialog::profName()const
{
@@ -181,20 +175,19 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
if (m_con ) {
m_con->load( m_prof );
m_layCon->addWidget( m_con );
}
}
/*
* we need to switch the widget
*/
void ProfileEditorDialog::slotTermActivated( const QString& str ) {
delete m_term;
m_term = m_fact->newTerminalPlugin( str, m_tabTerm );
- qWarning("past");
if (m_term) {
m_term->load(m_prof );
m_layTerm->addWidget( m_term );
}
}
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index 95a46f9..e5aedb6 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -15,40 +15,37 @@
#include "profilemanager.h"
ProfileManager::ProfileManager( MetaFactory* fact )
: m_fact( fact )
{
}
ProfileManager::~ProfileManager() {
}
void ProfileManager::load() {
m_list.clear();
- qWarning("load");
ProfileConfig conf("opie-console-profiles");
QStringList groups = conf.groups();
QStringList::Iterator it;
/*
* for each profile
*/
for ( it = groups.begin(); it != groups.end(); ++it ) {
- qWarning("group " + (*it) );
conf.setGroup( (*it) );
Profile prof;
prof.setName( conf.readEntry("name") );
prof.setIOLayer( conf.readEntry("iolayer").utf8() );
prof.setTerminalName( conf.readEntry("term").utf8() );
- qWarning(" %s %s", conf.readEntry("iolayer").latin1(), prof.ioLayerName().data() );
prof.setBackground( conf.readNumEntry("back") );
prof.setForeground( conf.readNumEntry("fore") );
prof.setTerminal( conf.readNumEntry("terminal") );
// THIS is evil because all data get's reset
prof.setConf( conf.items( (*it) ) );
/* now add it */
m_list.append( prof );
}
}
@@ -112,25 +109,24 @@ void ProfileManager::save( ) {
for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) {
conf.setGroup( (*it2).name() );
/* now the config stuff */
QMap<QString, QString> map = (*it2).conf();
QMap<QString, QString>::Iterator confIt;
for ( confIt = map.begin(); confIt != map.end(); ++confIt ) {
conf.writeEntry( confIt.key(), confIt.data() );
}
conf.writeEntry( "name", (*it2).name() );
QString str = QString::fromUtf8( (*it2).ioLayerName() );
- qWarning("IOLayerName " + str );
conf.writeEntry( "iolayer", str );
conf.writeEntry( "term", QString::fromUtf8( (*it2).terminalName() ) );
conf.writeEntry( "back", (*it2).background() );
conf.writeEntry( "fore", (*it2).foreground() );
conf.writeEntry( "terminal", (*it2).terminal() );
}
}
void ProfileManager::setProfiles( const Profile::ValueList& list ) {
m_list = list;
};
Profile ProfileManager::profile( const QString& name )const {
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp
index d0ace6c..e53dbc4 100644
--- a/noncore/apps/opie-console/session.cpp
+++ b/noncore/apps/opie-console/session.cpp
@@ -38,25 +38,24 @@ EmulationHandler* Session::emulationHandler() {
}
/*
WidgetLayer* Session::emulationWidget() {
return m_widLay;
}
*/
void Session::connect() {
if ( !m_layer || !m_emu )
return;
m_connected = true;
- qWarning("connection in session");
QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ),
m_emu, SLOT(recv(const QByteArray&) ) );
QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ),
m_layer, SLOT(send(const QByteArray&) ) );
}
void Session::disconnect() {
if ( !m_layer || !m_emu )
return;
m_connected = false;
diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp
index 466b536..8a691f9 100644
--- a/noncore/apps/opie-console/tabwidget.cpp
+++ b/noncore/apps/opie-console/tabwidget.cpp
@@ -3,25 +3,24 @@
TabWidget::TabWidget( QWidget* parent, const char* name )
: OTabWidget( parent, name ) {
connect(this, SIGNAL( currentChanged(QWidget*) ),
this, SLOT( slotCurChanged(QWidget*) ) );
}
TabWidget::~TabWidget() {
}
void TabWidget::add( Session* ses ) {
if ( !ses->widgetStack() ) return;
- qWarning("going to add it");
//reparent( ses->widgetStack(), QPoint() );
addTab( ses->widgetStack(), "console/konsole", ses->name() );
//addTab( ses->widgetStack(), ses->name() );
m_map.insert( ses->widgetStack(), ses );
}
void TabWidget::remove( Session* ses ) {
m_map.remove( ses->widgetStack() );
removePage( ses->widgetStack() );
}
void TabWidget::slotCurChanged( QWidget* wid ) {