summaryrefslogtreecommitdiff
path: root/core/applets/obex/obeximpl.cc
authorharlekin <harlekin>2002-06-14 10:30:25 (UTC)
committer harlekin <harlekin>2002-06-14 10:30:25 (UTC)
commita014866573fc86bf63544d1f692ccdd94c0d104f (patch) (side-by-side diff)
tree26c91e69d84aed959b8163bb853966f67041063b /core/applets/obex/obeximpl.cc
parentcf54bc85d0e9846d64ca2a2af55fffc3d4e2f4ad (diff)
downloadopie-a014866573fc86bf63544d1f692ccdd94c0d104f.zip
opie-a014866573fc86bf63544d1f692ccdd94c0d104f.tar.gz
opie-a014866573fc86bf63544d1f692ccdd94c0d104f.tar.bz2
fixed type and getting closer to finish
Diffstat (limited to 'core/applets/obex/obeximpl.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/obex/obeximpl.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/applets/obex/obeximpl.cc b/core/applets/obex/obeximpl.cc
index 1a1c922..7df933a 100644
--- a/core/applets/obex/obeximpl.cc
+++ b/core/applets/obex/obeximpl.cc
@@ -25,30 +25,32 @@ ObexImpl::ObexImpl( )
m_chan = new QCopChannel("QPE/Obex" );
connect(m_chan, SIGNAL(received(const QCString&, const QByteArray& ) ),
this, SLOT(slotMessage(const QCString&, const QByteArray&) ) );
connect(m_obex, SIGNAL(receivedFile(const QString& ) ),
this, SLOT(slotReceivedFile(const QString& ) ) );
}
+
ObexImpl::~ObexImpl() {
delete m_obex;
delete m_chan;
delete m_sendgui;
}
+
QRESULT ObexImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
*iface = 0;
if( uuid == IID_QUnknown )
*iface = this;
else if( uuid == IID_ObexInterface )
*iface = this;
qWarning("query" );
if(*iface )
(*iface)->addRef();
return QS_OK;
-
}
+
void ObexImpl::slotMessage( const QCString& msg, const QByteArray&data ) {
QDataStream stream( data, IO_ReadOnly );
qWarning("Message %s", msg.data() );
if(msg == "send(QString,QString,QString)" ) {
QString desc;
stream >> desc;
@@ -61,13 +63,13 @@ void ObexImpl::slotMessage( const QCString& msg, const QByteArray&data ) {
m_obex->send(m_name );
connect( (QObject*)m_obex, SIGNAL( sent() ), this,
SLOT( slotSent() ) );
connect( (QObject*)m_obex, SIGNAL( error(int) ), this,
SLOT( slotSent() ) );
}else if(msg == "receive(int)" ) { // open a GUI
- m_recvgui->showMaximized();
+ //m_recvgui->showMaximized();
int receiveD = 0;
stream >> receiveD;
if ( receiveD == 1)
m_obex->receive();
else
m_obex->setReceiveEnabled( false );
@@ -102,12 +104,13 @@ void ObexImpl::slotError( int errorCode) {
if (errorCode == -1) {
errorString = "test";
}
qDebug("Error: " + errorString);
m_sendgui->hide();
}
+
// Received a file via beam
// check for mime type and then either
// add to App via setDocument
void ObexImpl::slotReceivedFile( const QString &fileName ) {
qWarning("filename %s", fileName.latin1() );
DocLnk lnk( fileName );
@@ -118,12 +121,17 @@ void ObexImpl::slotReceivedFile( const QString &fileName ) {
if ( fileName.right(4) == ".vcf" )
exec = "addressbook";
else if ( fileName.right(4) == ".vcs" ) {
exec = "datebook";
}
} // now prompt and then add it
+
+ m_recvgui->PixmapLabel->setPixmap(lnk.pixmap());
+ m_recvgui->TextLabel1_2->setText(lnk.name());
+ m_recvgui->showMaximized();
+
QCString str= "QPE/Application/";
str += exec.latin1();
qWarning("channel %s", str.data() );
QCopEnvelope e(str , "setDocument(QString)" );
e << fileName;