summaryrefslogtreecommitdiff
path: root/library/qcopenvelope_qws.cpp
authorzecke <zecke>2002-09-10 12:09:49 (UTC)
committer zecke <zecke>2002-09-10 12:09:49 (UTC)
commit6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (side-by-side diff)
tree6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/qcopenvelope_qws.cpp
parentd10cddb3c9ce75bc90b14add14bc133737fe35aa (diff)
downloadopie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip
opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz
opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2
Qtopia1-6 merge
still to test bic changes to be resolved more changes to be made?
Diffstat (limited to 'library/qcopenvelope_qws.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qcopenvelope_qws.cpp51
1 files changed, 31 insertions, 20 deletions
diff --git a/library/qcopenvelope_qws.cpp b/library/qcopenvelope_qws.cpp
index 10d1567..81bb0f5 100644
--- a/library/qcopenvelope_qws.cpp
+++ b/library/qcopenvelope_qws.cpp
@@ -1,5 +1,5 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
@@ -20,3 +20,5 @@
+#ifndef QT_NO_COP
#include "qcopenvelope_qws.h"
+#endif
#include "global.h"
@@ -36,6 +38,7 @@
\class QCopEnvelope qcopenvelope_qws.h
- \brief The QCopEnvelope class encapsulates QCop message sending.
+ \brief The QCopEnvelope class encapsulates and sends QCop messages
+ over QCopChannels.
QCop messages allow applications to communicate with each other.
- These messages are send using QCopEnvelope, and received by connecting
+ These messages are sent using QCopEnvelope, and received by connecting
to a QCopChannel.
@@ -49,19 +52,19 @@
- For messages without parameters, you can simply use:
+ For messages without parameters, simply use:
\code
- QCopEnvelope (channelname, messagename);
+ QCopEnvelope e(channelname, messagename);
\endcode
- Do not try to simplify further as some compilers may not do
- as you expect.
+ (Do not try to simplify this further as it may confuse some
+ compilers.)
- The <tt>channelname</tt> of channels within Qtopia all start with "QPE/".
- The <tt>messagename</tt> is a function identifier followed by a list of types
- in parentheses. There are no spaces in the message name.
+ The \c{channelname} of channels within Qtopia all start with "QPE/".
+ The \c{messagename} is a function identifier followed by a list of types
+ in parentheses. There is no whitespace in the message name.
- To receive a message, you will generally just use your applications
- predefined QPE/Application/<i>appname</i> channel
+ To receive a message, you will generally just use your application's
+ predefined QPE/Application/\e{appname} channel
(see QPEApplication::appMessage()), but you can make another channel
- and connect it to a slot with:
+ and connect it to a slot like this:
@@ -78,4 +81,4 @@
Constructs a QCopEnvelope that will write \a message to \a channel.
- If \a message has parameters, you must then user operator<<() to
- write the parameters.
+ If \a message has parameters, you must then use operator<<() to
+ add these parameters to the envelope.
*/
@@ -89,3 +92,3 @@ QCopEnvelope::QCopEnvelope( const QCString& channel, const QCString& message ) :
/*!
- Writes the completed message and destroys the QCopEnvelope.
+ Writes the message and then destroys the QCopEnvelope.
*/
@@ -113,3 +116,3 @@ QCopEnvelope::~QCopEnvelope()
// success on fstat, lets compare times
- if (buf.st_mtime + 60 < t) {
+ if (buf.st_ctime + 60 < t) {
qWarning("stale file " + qcopfn + " found. Truncating");
@@ -131,4 +134,3 @@ QCopEnvelope::~QCopEnvelope()
QString cmd = ch.mid(pref);
- cmd += " -qcop " + qcopfn;
- Global::invoke(cmd);
+ Global::execute(cmd);
}
@@ -156,2 +158,11 @@ QCopEnvelope::~QCopEnvelope()
}
+ else if (qstrncmp(ch.data(), "QPE/SOAP/", 9) == 0) {
+ // If this is a message that should go along the SOAP channel, we move the
+ // endpoint URL to the data section.
+ QString endpoint = ch.mid(9);
+
+ ch = "QPE/SOAP";
+ // Since byte arrays are explicitly shared, this is appended to the data variable..
+ *this << endpoint;
+ }
QCopChannel::send(ch,msg,data);