author | korovkin <korovkin> | 2006-04-30 08:54:54 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-04-30 08:54:54 (UTC) |
commit | 2f32b6d589d389848c5c73ba2e5ad13117c1da9e (patch) (side-by-side diff) | |
tree | ec8a086ad17e3fa9014baa9476ab9cc77c5c29dc | |
parent | b91d3399fbd3178085e9d0fc5faeefbe31c674b7 (diff) | |
download | opie-2f32b6d589d389848c5c73ba2e5ad13117c1da9e.zip opie-2f32b6d589d389848c5c73ba2e5ad13117c1da9e.tar.gz opie-2f32b6d589d389848c5c73ba2e5ad13117c1da9e.tar.bz2 |
Fixed bug with suspend reenabling.
Made some minor formatting.
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 39 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/obexftpdialog.cpp | 2 |
2 files changed, 29 insertions, 12 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 58f97fa..85385d8 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -689,18 +689,21 @@ void BlueBase::setInfo() /** * Decontructor */ BlueBase::~BlueBase() { writeSavedDevices(); if (forwarder) { #if defined(Q_WS_QWS) && !defined(QT_NO_COP) - QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) - << QPEApplication::Enable; + { + odebug << "SUSP: Enable suspend mode" << oendl; + QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); + e << QPEApplication::Enable; + } #endif delete forwarder; forwarder = NULL; } delete m_iconLoader; } @@ -733,49 +736,63 @@ bool BlueBase::find( const RemoteDevice& rem ) */ void BlueBase::doForward() { if (forwarder && forwarder->isRunning()) { runButton->setText("start gateway"); forwarder->stop(); delete forwarder; forwarder = NULL; +#if defined(Q_WS_QWS) && !defined(QT_NO_COP) + { + odebug << "SUSP: Enable suspend mode" << oendl; + QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); + e << QPEApplication::Enable; + } +#endif return; } QString str = serDevName->text(); forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val); - connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), - this, SLOT(forwardExited(Opie::Core::OProcess*))); if (forwarder->start(OProcess::NotifyOnExit) < 0) { QMessageBox::critical(this, tr("Forwarder Error"), tr("Forwarder start error:") + tr(strerror(errno))); return; } + connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), + this, SLOT(forwardExited(Opie::Core::OProcess*))); runButton->setText("stop gateway"); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) - QCopEnvelope("QPE/System", "setScreenSaverMode(int)") - << QPEApplication::DisableSuspend; + { + odebug << "SUSP: Disable suspend mode" << oendl; + QCopEnvelope e("QPE/System", "setScreenSaverMode(int)"); + e << QPEApplication::DisableSuspend; + } #endif } /** * React on the process end */ void BlueBase::forwardExit(Opie::Core::OProcess* proc) { + odebug << "Process exited" << oendl; #if defined(Q_WS_QWS) && !defined(QT_NO_COP) - QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) - << QPEApplication::Enable; + if (forwarder) { + delete forwarder; + forwarder = NULL; + runButton->setText("start gateway"); + odebug << "SUSP: Enable suspend mode" << oendl; + QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); + e << QPEApplication::Enable; + } #endif if (proc->exitStatus() != 0) QMessageBox::critical(this, tr("Forwarder Error"), tr("Forwarder start error")); - delete proc; - forwarder = NULL; - runButton->setText("start gateway"); } /** * Encrypt entered passkey * doit - do encryption of the key */ void BlueBase::doEncrypt(bool doit) { diff --git a/noncore/net/opietooth/manager/obexftpdialog.cpp b/noncore/net/opietooth/manager/obexftpdialog.cpp index fd2015e..2f04ecf 100644 --- a/noncore/net/opietooth/manager/obexftpdialog.cpp +++ b/noncore/net/opietooth/manager/obexftpdialog.cpp @@ -273,17 +273,17 @@ void ObexFtpDialog::getFile() local += file->text(0); odebug << "Copy " << file2get << " to " << local << oendl; progressStatus = 0; fileProgress->setTotalSteps(file->getsize() / 1024); fileProgress->reset(); status(tr("Receiving file ") + file2get); result = obexftp_get(client, local, file2get); if (result < 0) { - log(file2get + QString(" receive ERROR:\n") + tr(strerror(errno))); + log(file2get + QString(" receive ERROR:\n") + tr(strerror(errno))); errBox(file2get + QString(" receive ERROR")); status(file2get + QString(" receive ERROR")); } else { log(file2get + QString(" received")); status(file2get + QString(" received")); destFile->reread(); } |