author | korovkin <korovkin> | 2006-04-30 08:54:54 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-04-30 08:54:54 (UTC) |
commit | 2f32b6d589d389848c5c73ba2e5ad13117c1da9e (patch) (unidiff) | |
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 | 0 |
2 files changed, 28 insertions, 11 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 | |||
@@ -694,8 +694,11 @@ BlueBase::~BlueBase() | |||
694 | writeSavedDevices(); | 694 | writeSavedDevices(); |
695 | if (forwarder) { | 695 | if (forwarder) { |
696 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 696 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
697 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) | 697 | { |
698 | << QPEApplication::Enable; | 698 | odebug << "SUSP: Enable suspend mode" << oendl; |
699 | QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); | ||
700 | e << QPEApplication::Enable; | ||
701 | } | ||
699 | #endif | 702 | #endif |
700 | delete forwarder; | 703 | delete forwarder; |
701 | forwarder = NULL; | 704 | forwarder = NULL; |
@@ -738,21 +741,31 @@ void BlueBase::doForward() | |||
738 | forwarder->stop(); | 741 | forwarder->stop(); |
739 | delete forwarder; | 742 | delete forwarder; |
740 | forwarder = NULL; | 743 | forwarder = NULL; |
744 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | ||
745 | { | ||
746 | odebug << "SUSP: Enable suspend mode" << oendl; | ||
747 | QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); | ||
748 | e << QPEApplication::Enable; | ||
749 | } | ||
750 | #endif | ||
741 | return; | 751 | return; |
742 | } | 752 | } |
743 | QString str = serDevName->text(); | 753 | QString str = serDevName->text(); |
744 | forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val); | 754 | forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val); |
745 | connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), | ||
746 | this, SLOT(forwardExited(Opie::Core::OProcess*))); | ||
747 | if (forwarder->start(OProcess::NotifyOnExit) < 0) { | 755 | if (forwarder->start(OProcess::NotifyOnExit) < 0) { |
748 | QMessageBox::critical(this, tr("Forwarder Error"), | 756 | QMessageBox::critical(this, tr("Forwarder Error"), |
749 | tr("Forwarder start error:") + tr(strerror(errno))); | 757 | tr("Forwarder start error:") + tr(strerror(errno))); |
750 | return; | 758 | return; |
751 | } | 759 | } |
760 | connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), | ||
761 | this, SLOT(forwardExited(Opie::Core::OProcess*))); | ||
752 | runButton->setText("stop gateway"); | 762 | runButton->setText("stop gateway"); |
753 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 763 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
754 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)") | 764 | { |
755 | << QPEApplication::DisableSuspend; | 765 | odebug << "SUSP: Disable suspend mode" << oendl; |
766 | QCopEnvelope e("QPE/System", "setScreenSaverMode(int)"); | ||
767 | e << QPEApplication::DisableSuspend; | ||
768 | } | ||
756 | #endif | 769 | #endif |
757 | } | 770 | } |
758 | 771 | ||
@@ -761,16 +774,20 @@ void BlueBase::doForward() | |||
761 | */ | 774 | */ |
762 | void BlueBase::forwardExit(Opie::Core::OProcess* proc) | 775 | void BlueBase::forwardExit(Opie::Core::OProcess* proc) |
763 | { | 776 | { |
777 | odebug << "Process exited" << oendl; | ||
764 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 778 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
765 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) | 779 | if (forwarder) { |
766 | << QPEApplication::Enable; | 780 | delete forwarder; |
781 | forwarder = NULL; | ||
782 | runButton->setText("start gateway"); | ||
783 | odebug << "SUSP: Enable suspend mode" << oendl; | ||
784 | QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); | ||
785 | e << QPEApplication::Enable; | ||
786 | } | ||
767 | #endif | 787 | #endif |
768 | if (proc->exitStatus() != 0) | 788 | if (proc->exitStatus() != 0) |
769 | QMessageBox::critical(this, tr("Forwarder Error"), | 789 | QMessageBox::critical(this, tr("Forwarder Error"), |
770 | tr("Forwarder start error")); | 790 | tr("Forwarder start error")); |
771 | delete proc; | ||
772 | forwarder = NULL; | ||
773 | runButton->setText("start gateway"); | ||
774 | } | 791 | } |
775 | 792 | ||
776 | /** | 793 | /** |
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 | |||