summaryrefslogtreecommitdiff
path: root/core/obex/obexsend.cpp
authormickeyl <mickeyl>2006-05-02 08:57:25 (UTC)
committer mickeyl <mickeyl>2006-05-02 08:57:25 (UTC)
commitd5b6868cb4f99d2c3dc3587115cd37c09e4610eb (patch) (side-by-side diff)
tree1397f12f885c849419e511ad203d19696c4ae07e /core/obex/obexsend.cpp
parent1295db77f2ab7e9125183e4240de0b92f72940e4 (diff)
downloadopie-d5b6868cb4f99d2c3dc3587115cd37c09e4610eb.zip
opie-d5b6868cb4f99d2c3dc3587115cd37c09e4610eb.tar.gz
opie-d5b6868cb4f99d2c3dc3587115cd37c09e4610eb.tar.bz2
bluetooth patches courtesy Dmitriy Korovkin (thanks!):
* When sending data to a device, do service discovery in order to get port number. * Switched to ussp-push for sending. * Clear receivers list on rescan. * Changed the way of window closing in order to shut down IRDA and bluetooth correctly.
Diffstat (limited to 'core/obex/obexsend.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/obexsend.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp
index 9cd9972..dbbb7b3 100644
--- a/core/obex/obexsend.cpp
+++ b/core/obex/obexsend.cpp
@@ -21,6 +21,6 @@ using namespace Opie::Core;
#include <qpixmap.h>
#include <qlistview.h>
-#include <qtimer.h>
+#include <unistd.h>
/* TRANSLATOR OpieObex::SendWidget */
@@ -84,5 +84,5 @@ int SendWidget::addReceiver(const char *r, const char *icon)
bool SendWidget::receiverSelected(int id)
{
- return receivers[id]->pixmap(2);
+ return (bool)(receivers[id]->pixmap(2) != NULL);
}
@@ -142,5 +142,5 @@ void SendWidget::slotStartIrda() {
if ( !m_irDa.count() ) return;
if ( m_irDaIt == m_irDa.end() ) {
- irdaStatus->setText(tr("complete."));
+ irdaStatus->setText(tr("complete."));
return;
}
@@ -174,5 +174,5 @@ void SendWidget::slotStartBt() {
++m_btIt;
if (m_btIt == m_bt.end() ) {
- btStatus->setText(tr("complete."));
+ btStatus->setText(tr("complete."));
return;
}
@@ -188,5 +188,6 @@ void SendWidget::send_to_receivers() {
void SendWidget::scan_for_receivers()
{
- //FIXME: Clean ListBox prior to (re)scan
+ receiverList->clear();
+ receivers.clear();
sendButton->setDisabled( true );
@@ -220,19 +221,20 @@ void SendWidget::toggle_receiver(QListViewItem* item)
// toggle the state of an individual receiver.
if(item->pixmap(2))
- item->setPixmap(2,QPixmap());
+ item->setPixmap(2,QPixmap());
else
- item->setPixmap(2,Resource::loadPixmap("backup/check.png"));
+ item->setPixmap(2,Resource::loadPixmap("backup/check.png"));
}
void SendWidget::closeEvent( QCloseEvent* e) {
- e->accept(); // make sure
- QTimer::singleShot(0, this, SLOT(userDone() ) );
-}
-void SendWidget::userDone() {
+ obexSendBase::closeEvent(e);
QCopEnvelope e0("QPE/IrDaApplet", "disableIrda()");
QCopEnvelope e1("QPE/Bluetooth", "disableBluetooth()");
- emit done();
}
+
+void SendWidget::userDone() {
+ close();
+}
+
QString SendWidget::file()const {
return m_file;