From: Kate Alhola Date: Wed, 2 Jun 2010 13:55:55 +0000 (+0300) Subject: channelDestroyed hadling, TPSESSION_DEBUG env X-Git-Url: http://vcs.maemo.org/git/?p=tpsession;a=commitdiff_plain channelDestroyed hadling, TPSESSION_DEBUG env --- diff --git a/tpsession-0.1/Makefile b/tpsession-0.1/Makefile index 6a5fac0..3124845 100644 --- a/tpsession-0.1/Makefile +++ b/tpsession-0.1/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: tpsession -# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:19 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Jun 2 16:52:09 2010 # Project: tpsession.pro # Template: subdirs # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile tpsession.pro diff --git a/tpsession-0.1/debian/changelog b/tpsession-0.1/debian/changelog index 56b9b28..27ce7a5 100644 --- a/tpsession-0.1/debian/changelog +++ b/tpsession-0.1/debian/changelog @@ -1,12 +1,18 @@ +tpsession (0.1-4) unstable; urgency=low + + * Added proper handling for destroyed channels, TPSESSION_DEBUG environmentvariable to enable debug printouts + + -- Kate Alhola Mon, 2 Jun 2010 16:51:00 +0300 + tpsession (0.1-3) unstable; urgency=low - * Extra debug printouts removed + * Extra debug printouts removed, emits messageUeued signal -- Kate Alhola Mon, 10 May 2010 13:20:00 +0300 tpsession (0.1-2) unstable; urgency=low - * Some bug fixes in sync constructor, getAccoint now accepts also uniqueIdentifier, PR1.2 compatible + * Some bug fixes in sync constructor, getAccount now accepts also uniqueIdentifier, PR1.2 compatible -- Kate Alhola Thu, 25 Mar 2010 11:20:48 +0200 diff --git a/tpsession-0.1/debian/files b/tpsession-0.1/debian/files index ece1021..487ef2f 100644 --- a/tpsession-0.1/debian/files +++ b/tpsession-0.1/debian/files @@ -1,3 +1,3 @@ -libtpsession_0.1-3_armel.deb libs extra -libtpsession-dev_0.1-3_armel.deb libdevel extra -libtpsession-dbg_0.1-3_armel.deb libdevel extra +libtpsession_0.1-4_armel.deb libs extra +libtpsession-dev_0.1-4_armel.deb libdevel extra +libtpsession-dbg_0.1-4_armel.deb libdevel extra diff --git a/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/control b/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/control index 2ea089c..1363625 100644 --- a/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/control +++ b/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/control @@ -1,10 +1,10 @@ Package: libtpsession-dbg -Version: 0.1-3 +Version: 0.1-4 Section: libdevel Priority: extra Architecture: armel Depends: tpsession -Installed-Size: 900 +Installed-Size: 926 Maintainer: Kate Alhola Source: tpsession Description: Easy to use API to Telepathy-Qt4 debug symbols diff --git a/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/md5sums b/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/md5sums index c16fd04..bcef410 100644 --- a/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/md5sums +++ b/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/md5sums @@ -1,3 +1,3 @@ -279d55edf2dbbaa8a9ef9e80e6afa950 usr/lib/debug/usr/lib/libtpsession.so.0.1.0 -7db70a8516956741d44ddbd4ab9e664a usr/share/doc/libtpsession-dbg/changelog.Debian.gz +94f6a232afe46e49e2151cc55b7db2a1 usr/lib/debug/usr/lib/libtpsession.so.0.1.0 +7378fe57886d6f2411cdcfc622669632 usr/share/doc/libtpsession-dbg/changelog.Debian.gz 707f20563222a064607acf41d3e5c7b2 usr/share/doc/libtpsession-dbg/copyright diff --git a/tpsession-0.1/debian/libtpsession-dbg/usr/share/doc/libtpsession-dbg/changelog.Debian.gz b/tpsession-0.1/debian/libtpsession-dbg/usr/share/doc/libtpsession-dbg/changelog.Debian.gz index a6b6899..fceada6 100644 Binary files a/tpsession-0.1/debian/libtpsession-dbg/usr/share/doc/libtpsession-dbg/changelog.Debian.gz and b/tpsession-0.1/debian/libtpsession-dbg/usr/share/doc/libtpsession-dbg/changelog.Debian.gz differ diff --git a/tpsession-0.1/debian/libtpsession-dev/DEBIAN/control b/tpsession-0.1/debian/libtpsession-dev/DEBIAN/control index 3933fc5..de53d35 100644 --- a/tpsession-0.1/debian/libtpsession-dev/DEBIAN/control +++ b/tpsession-0.1/debian/libtpsession-dev/DEBIAN/control @@ -1,10 +1,10 @@ Package: libtpsession-dev -Version: 0.1-3 +Version: 0.1-4 Section: libdevel Priority: extra Architecture: armel Depends: libtpsession -Installed-Size: 13 +Installed-Size: 14 Maintainer: Kate Alhola Source: tpsession Description: Easy to use API to Telepathy-Qt4 dev files diff --git a/tpsession-0.1/debian/libtpsession-dev/DEBIAN/md5sums b/tpsession-0.1/debian/libtpsession-dev/DEBIAN/md5sums index d0934ee..d65f4e1 100644 --- a/tpsession-0.1/debian/libtpsession-dev/DEBIAN/md5sums +++ b/tpsession-0.1/debian/libtpsession-dev/DEBIAN/md5sums @@ -1,7 +1,7 @@ -f5dc0a769f2e6fb59be9c66b55b738ad usr/include/telepathy-1.0/tpsession/tpsession.h -91a79511e7fde9bf828b69f2479a8c10 usr/include/telepathy-1.0/tpsession/tpsessionaccount.h -1db2a0ee688a22591395915a69840c00 usr/include/telepathy-1.0/tpsession/tpsessionchannel.h +21ccbde64fe646c424b560759bd2c766 usr/include/telepathy-1.0/tpsession/tpsession.h +729b7162ae9d47151ff2a2427cc735e4 usr/include/telepathy-1.0/tpsession/tpsessionaccount.h +07eaf94dc62455e25d29646e2b9a7548 usr/include/telepathy-1.0/tpsession/tpsessionchannel.h da668240e6a6465d26576272ecb52b48 usr/include/telepathy-1.0/tpsession/tpsessionobserver.h 4987dc18c04e1e486b0c518dcd0ef913 usr/lib/pkgconfig/TpSession.pc -7db70a8516956741d44ddbd4ab9e664a usr/share/doc/libtpsession-dev/changelog.Debian.gz +7378fe57886d6f2411cdcfc622669632 usr/share/doc/libtpsession-dev/changelog.Debian.gz 707f20563222a064607acf41d3e5c7b2 usr/share/doc/libtpsession-dev/copyright diff --git a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsession.h b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsession.h index 281310a..bc0d77e 100644 --- a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsession.h +++ b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsession.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,7 @@ #include "tpsessionaccount.h" #include "tpsessionobserver.h" + class TpSession:public QObject { Q_OBJECT @@ -50,6 +52,7 @@ public: static TpSession* instance(bool synchronous=TRUE); + static bool tpsDebug(); void sendMessageToAddress(QString connectionMgr,QString address,QString message); TpSessionAccount* getAccount(const QString cm, const QString protocol=QString()); void createChannelListener(const QString &channelType, @@ -74,6 +77,7 @@ public: private: static TpSession *instancePtr; + static bool tpsdebug; //TpSession *instancePtr; QString reqCm; QString reqAddress; diff --git a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h index 598aab9..7f9fe4b 100644 --- a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h +++ b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h @@ -37,6 +37,9 @@ #include #include +class TpSessionAccount; + +#include "tpsession.h" #include "tpsessionchannel.h" class TpSessionAccount:public QObject @@ -63,6 +66,7 @@ signals: private slots: void onReady(Tp::PendingOperation *op); void onOutgoingChannelReady(TpSessionChannel *ch); + void onChannelDestroyed(TpSessionChannel *ch); void onContactsConnectionReady(Tp::PendingOperation *op); void onNewContactRetrieved(Tp::PendingOperation *op); void onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *); diff --git a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h index 44db8ea..3ae18cb 100644 --- a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h +++ b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h @@ -33,6 +33,10 @@ #include #include +class TpSessionChannel; + +#include "tpsession.h" + class TpSessionChannel : public QObject { Q_OBJECT @@ -51,7 +55,7 @@ signals: public slots: void onChannelCreated(Tp::PendingOperation *op); void onChannelReady(Tp::PendingOperation *op); - void onChannelDestroyed(QObject *); + void onChannelDestroyed(); void onMessageReceived(const Tp::ReceivedMessage &); void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &); public: diff --git a/tpsession-0.1/debian/libtpsession-dev/usr/share/doc/libtpsession-dev/changelog.Debian.gz b/tpsession-0.1/debian/libtpsession-dev/usr/share/doc/libtpsession-dev/changelog.Debian.gz index a6b6899..fceada6 100644 Binary files a/tpsession-0.1/debian/libtpsession-dev/usr/share/doc/libtpsession-dev/changelog.Debian.gz and b/tpsession-0.1/debian/libtpsession-dev/usr/share/doc/libtpsession-dev/changelog.Debian.gz differ diff --git a/tpsession-0.1/debian/libtpsession/DEBIAN/control b/tpsession-0.1/debian/libtpsession/DEBIAN/control index fd0f4c9..4af6a12 100644 --- a/tpsession-0.1/debian/libtpsession/DEBIAN/control +++ b/tpsession-0.1/debian/libtpsession/DEBIAN/control @@ -1,10 +1,10 @@ Package: libtpsession -Version: 0.1-3 +Version: 0.1-4 Section: libs Priority: extra Architecture: armel Depends: libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libqt4-core (>= 4.6.2~git20100310), libqt4-dbus (>= 4.6.2~git20100310), libqt4-network (>= 4.6.2~git20100310), libqt4-xml (>= 4.6.2~git20100310), libstdc++6 (>= 4.2.1) -Installed-Size: 64 +Installed-Size: 74 Maintainer: Kate Alhola Source: tpsession Description: Easy to use API to Telepathy-Qt4 diff --git a/tpsession-0.1/debian/libtpsession/DEBIAN/md5sums b/tpsession-0.1/debian/libtpsession/DEBIAN/md5sums index 81508bd..615b206 100644 --- a/tpsession-0.1/debian/libtpsession/DEBIAN/md5sums +++ b/tpsession-0.1/debian/libtpsession/DEBIAN/md5sums @@ -1,4 +1,4 @@ -3550dafd99a7f78a42d7822e2bf13c6c usr/lib/libtpsession.so.0.1.0 -7db70a8516956741d44ddbd4ab9e664a usr/share/doc/libtpsession/changelog.Debian.gz +0189b84c1882bdb6cb6f6af6a001bd74 usr/lib/libtpsession.so.0.1.0 +7378fe57886d6f2411cdcfc622669632 usr/share/doc/libtpsession/changelog.Debian.gz 707f20563222a064607acf41d3e5c7b2 usr/share/doc/libtpsession/copyright 566711be92c93313ec96c77fe9477c68 usr/share/doc/libtpsession/README.Debian diff --git a/tpsession-0.1/debian/libtpsession/usr/share/doc/libtpsession/changelog.Debian.gz b/tpsession-0.1/debian/libtpsession/usr/share/doc/libtpsession/changelog.Debian.gz index a6b6899..fceada6 100644 Binary files a/tpsession-0.1/debian/libtpsession/usr/share/doc/libtpsession/changelog.Debian.gz and b/tpsession-0.1/debian/libtpsession/usr/share/doc/libtpsession/changelog.Debian.gz differ diff --git a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsession.h b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsession.h index 281310a..bc0d77e 100644 --- a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsession.h +++ b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsession.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,7 @@ #include "tpsessionaccount.h" #include "tpsessionobserver.h" + class TpSession:public QObject { Q_OBJECT @@ -50,6 +52,7 @@ public: static TpSession* instance(bool synchronous=TRUE); + static bool tpsDebug(); void sendMessageToAddress(QString connectionMgr,QString address,QString message); TpSessionAccount* getAccount(const QString cm, const QString protocol=QString()); void createChannelListener(const QString &channelType, @@ -74,6 +77,7 @@ public: private: static TpSession *instancePtr; + static bool tpsdebug; //TpSession *instancePtr; QString reqCm; QString reqAddress; diff --git a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h index 598aab9..7f9fe4b 100644 --- a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h +++ b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h @@ -37,6 +37,9 @@ #include #include +class TpSessionAccount; + +#include "tpsession.h" #include "tpsessionchannel.h" class TpSessionAccount:public QObject @@ -63,6 +66,7 @@ signals: private slots: void onReady(Tp::PendingOperation *op); void onOutgoingChannelReady(TpSessionChannel *ch); + void onChannelDestroyed(TpSessionChannel *ch); void onContactsConnectionReady(Tp::PendingOperation *op); void onNewContactRetrieved(Tp::PendingOperation *op); void onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *); diff --git a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h index 44db8ea..3ae18cb 100644 --- a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h +++ b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h @@ -33,6 +33,10 @@ #include #include +class TpSessionChannel; + +#include "tpsession.h" + class TpSessionChannel : public QObject { Q_OBJECT @@ -51,7 +55,7 @@ signals: public slots: void onChannelCreated(Tp::PendingOperation *op); void onChannelReady(Tp::PendingOperation *op); - void onChannelDestroyed(QObject *); + void onChannelDestroyed(); void onMessageReceived(const Tp::ReceivedMessage &); void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &); public: diff --git a/tpsession-0.1/tests/Makefile b/tpsession-0.1/tests/Makefile index ef018eb..dfe951d 100644 --- a/tpsession-0.1/tests/Makefile +++ b/tpsession-0.1/tests/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: tests -# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:25 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Jun 2 16:52:22 2010 # Project: tests.pro # Template: subdirs # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile tests.pro diff --git a/tpsession-0.1/tests/showaccounts/Makefile b/tpsession-0.1/tests/showaccounts/Makefile index c2a76f0..0ebb79d 100644 --- a/tpsession-0.1/tests/showaccounts/Makefile +++ b/tpsession-0.1/tests/showaccounts/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: showaccounts -# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:46 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Jun 2 16:52:42 2010 # Project: showaccounts.pro # Template: app # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile showaccounts.pro diff --git a/tpsession-0.1/tests/showaccounts/showaccounts b/tpsession-0.1/tests/showaccounts/showaccounts index d9ffdbe..f1b294d 100755 Binary files a/tpsession-0.1/tests/showaccounts/showaccounts and b/tpsession-0.1/tests/showaccounts/showaccounts differ diff --git a/tpsession-0.1/tests/smstest/Makefile b/tpsession-0.1/tests/smstest/Makefile index 89e1864..401ddb7 100644 --- a/tpsession-0.1/tests/smstest/Makefile +++ b/tpsession-0.1/tests/smstest/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: smstest -# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:25 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Jun 2 16:52:22 2010 # Project: smstest.pro # Template: app # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile smstest.pro diff --git a/tpsession-0.1/tests/smstest/smstest b/tpsession-0.1/tests/smstest/smstest index 56c9865..0bcbf7d 100755 Binary files a/tpsession-0.1/tests/smstest/smstest and b/tpsession-0.1/tests/smstest/smstest differ diff --git a/tpsession-0.1/tests/syncsms/Makefile b/tpsession-0.1/tests/syncsms/Makefile index dfbc87a..8d54ef3 100644 --- a/tpsession-0.1/tests/syncsms/Makefile +++ b/tpsession-0.1/tests/syncsms/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: syncsms -# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:36 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Jun 2 16:52:33 2010 # Project: syncsms.pro # Template: app # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile syncsms.pro diff --git a/tpsession-0.1/tests/syncsms/syncsms b/tpsession-0.1/tests/syncsms/syncsms index c08b51b..c117d58 100755 Binary files a/tpsession-0.1/tests/syncsms/syncsms and b/tpsession-0.1/tests/syncsms/syncsms differ diff --git a/tpsession-0.1/tpsession/Makefile b/tpsession-0.1/tpsession/Makefile index b7a7809..cb1fa79 100644 --- a/tpsession-0.1/tpsession/Makefile +++ b/tpsession-0.1/tpsession/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: libtpsession.so.0.1.0 -# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:20 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Jun 2 16:52:09 2010 # Project: tpsession.pro # Template: lib # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile tpsession.pro @@ -205,16 +205,24 @@ compiler_moc_header_make_all: moc_tpsession.cpp moc_tpsessionaccount.cpp moc_tps compiler_moc_header_clean: -$(DEL_FILE) moc_tpsession.cpp moc_tpsessionaccount.cpp moc_tpsessionchannel.cpp moc_tpsessionobserver.cpp moc_tpsession.cpp: tpsessionaccount.h \ - tpsessionchannel.h \ + tpsession.h \ tpsessionobserver.h \ + tpsessionchannel.h \ tpsession.h /usr/bin/moc $(DEFINES) $(INCPATH) tpsession.h -o moc_tpsession.cpp -moc_tpsessionaccount.cpp: tpsessionchannel.h \ +moc_tpsessionaccount.cpp: tpsession.h \ + tpsessionaccount.h \ + tpsessionchannel.h \ + tpsessionobserver.h \ tpsessionaccount.h /usr/bin/moc $(DEFINES) $(INCPATH) tpsessionaccount.h -o moc_tpsessionaccount.cpp -moc_tpsessionchannel.cpp: tpsessionchannel.h +moc_tpsessionchannel.cpp: tpsession.h \ + tpsessionaccount.h \ + tpsessionchannel.h \ + tpsessionobserver.h \ + tpsessionchannel.h /usr/bin/moc $(DEFINES) $(INCPATH) tpsessionchannel.h -o moc_tpsessionchannel.cpp moc_tpsessionobserver.cpp: tpsessionobserver.h @@ -258,10 +266,15 @@ tpsession.o: tpsession.cpp tpsession.h \ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tpsession.o tpsession.cpp tpsessionaccount.o: tpsessionaccount.cpp tpsessionaccount.h \ + tpsession.h \ + tpsessionobserver.h \ tpsessionchannel.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tpsessionaccount.o tpsessionaccount.cpp -tpsessionchannel.o: tpsessionchannel.cpp tpsessionchannel.h +tpsessionchannel.o: tpsessionchannel.cpp tpsessionchannel.h \ + tpsession.h \ + tpsessionaccount.h \ + tpsessionobserver.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tpsessionchannel.o tpsessionchannel.cpp tpsessionobserver.o: tpsessionobserver.cpp tpsessionobserver.h \ diff --git a/tpsession-0.1/tpsession/libtpsession.so.0.1.0 b/tpsession-0.1/tpsession/libtpsession.so.0.1.0 index f0ee294..281b80c 100755 Binary files a/tpsession-0.1/tpsession/libtpsession.so.0.1.0 and b/tpsession-0.1/tpsession/libtpsession.so.0.1.0 differ diff --git a/tpsession-0.1/tpsession/tpsession.cpp b/tpsession-0.1/tpsession/tpsession.cpp index 20a69cd..93a2989 100644 --- a/tpsession-0.1/tpsession/tpsession.cpp +++ b/tpsession-0.1/tpsession/tpsession.cpp @@ -71,6 +71,10 @@ TpSession::TpSession(QString cmname,bool synchronous) Tp::enableDebug(false); Tp::enableWarnings(false); + QProcessEnvironment env; + tpsdebug=env.systemEnvironment().contains("TPSESSION_DEBUG"); + if(tpsdebug) qDebug() << "Tpsession debug:" << tpsDebug(); + mAM = Tp::AccountManager::create(); reqCm=cmname; sync=synchronous; @@ -87,6 +91,7 @@ TpSession::TpSession(QString cmname,bool synchronous) } TpSession* TpSession::instancePtr=NULL; +bool TpSession::tpsdebug=false; /** * Returns pointer to TpSession singleton. If there is not yet TpSession Object, creates it with "Ring" connection manager as default * @@ -99,6 +104,11 @@ TpSession* TpSession::instance(bool synchronous) return instancePtr; }; +bool TpSession::tpsDebug() +{ + return tpsdebug; +} + void TpSession::onAMReady(Tp::PendingOperation *op) { Q_UNUSED(op); diff --git a/tpsession-0.1/tpsession/tpsession.h b/tpsession-0.1/tpsession/tpsession.h index 281310a..bc0d77e 100644 --- a/tpsession-0.1/tpsession/tpsession.h +++ b/tpsession-0.1/tpsession/tpsession.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,7 @@ #include "tpsessionaccount.h" #include "tpsessionobserver.h" + class TpSession:public QObject { Q_OBJECT @@ -50,6 +52,7 @@ public: static TpSession* instance(bool synchronous=TRUE); + static bool tpsDebug(); void sendMessageToAddress(QString connectionMgr,QString address,QString message); TpSessionAccount* getAccount(const QString cm, const QString protocol=QString()); void createChannelListener(const QString &channelType, @@ -74,6 +77,7 @@ public: private: static TpSession *instancePtr; + static bool tpsdebug; //TpSession *instancePtr; QString reqCm; QString reqAddress; diff --git a/tpsession-0.1/tpsession/tpsessionaccount.cpp b/tpsession-0.1/tpsession/tpsessionaccount.cpp index 657e4ba..ab8d8fe 100644 --- a/tpsession-0.1/tpsession/tpsessionaccount.cpp +++ b/tpsession-0.1/tpsession/tpsessionaccount.cpp @@ -234,7 +234,7 @@ void TpSessionAccount::sendMessageToAddress(QString address,QString message) Tp::ContactPtr p; TpSessionChannel* channel=getChannelFromPeerAddress(address); if(channel) { - // qDebug() << "TpSessionAccount::sendMessageToAddress peer:" << channel->peerId() << "queuing:" << message; + if(TpSession::tpsDebug()) qDebug() << "TpSessionAccount::sendMessageToAddress peer:" << channel->peerId() << "queuing:" << message; channel->sendMessage(message); // We have already channel emit messageQueued(this,true); } @@ -252,7 +252,7 @@ void TpSessionAccount::addOutgoingChannel(const Tp::ContactPtr &contact) { - // qDebug() << "TpSessionAccount::addOutgoingChannel"; + if(TpSession::tpsDebug()) qDebug() << "TpSessionAccount::addOutgoingChannel"; TpSessionChannel* newChannel=new TpSessionChannel(contact->manager()->connection(),contact); connect(newChannel,SIGNAL(messageReceived(const Tp::ReceivedMessage &,TpSessionChannel *)), @@ -261,16 +261,18 @@ void TpSessionAccount::addOutgoingChannel(const Tp::ContactPtr &contact) SLOT(onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *))); connect(newChannel,SIGNAL(channelReady(TpSessionChannel *)), SLOT(onOutgoingChannelReady(TpSessionChannel*))); + connect(newChannel,SIGNAL(channelDestroyed(TpSessionChannel *)), + SLOT(onChannelDestroyed(TpSessionChannel*))); myChannels+=newChannel; } void TpSessionAccount::onOutgoingChannelReady(TpSessionChannel *ch) { - // qDebug() << "TpSessionAccount::onOutgoingChannelReady"; + if(TpSession::tpsDebug()) qDebug() << "TpSessionAccount::onOutgoingChannelReady"; emit channelReady(this); if(!reqMessage.isEmpty()) { - // qDebug() << "TpSessionAccount::onOutgoingChannelReady peer:" << ch->peerId() << "queuing:" << reqMessage; + if(TpSession::tpsDebug()) qDebug() << "TpSessionAccount::onOutgoingChannelReady peer:" << ch->peerId() << "queuing:" << reqMessage; ch->sendMessage(reqMessage); emit messageQueued(this,true); }; @@ -281,7 +283,7 @@ void TpSessionAccount::onOutgoingChannelReady(TpSessionChannel *ch) void TpSessionAccount::onMessageSent(const Tp::Message &msg,Tp::MessageSendingFlags, const QString &flags,TpSessionChannel *ch) { Q_UNUSED(flags); - // qDebug() << "TpSessionAccount::onMessageSent peer:" << ch->peerId() <<"txt:" << msg.text(); + if(TpSession::tpsDebug()) qDebug() << "TpSessionAccount::onMessageSent peer:" << ch->peerId() <<"txt:" << msg.text(); emit messageSent(msg,this); }; @@ -314,6 +316,8 @@ void TpSessionAccount::onNewChannels(const Tp::ChannelDetailsList &channels) SLOT(onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *))); connect(newChannel,SIGNAL(messageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *)), SLOT(onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *))); + connect(newChannel,SIGNAL(channelDestroyed(TpSessionChannel *)), + SLOT(onChannelDestroyed(TpSessionChannel*))); myChannels+=newChannel; } if (channelType == TELEPATHY_INTERFACE_CHANNEL_TYPE_STREAMED_MEDIA && !requested) { @@ -321,3 +325,9 @@ void TpSessionAccount::onNewChannels(const Tp::ChannelDetailsList &channels) } } } + +void TpSessionAccount::onChannelDestroyed(TpSessionChannel *ch) +{ + if(TpSession::tpsDebug()) qDebug() << "TpSessionAccount::onMessageSent peer:" << ch->peerId(); + myChannels.remove(ch); +}; diff --git a/tpsession-0.1/tpsession/tpsessionaccount.h b/tpsession-0.1/tpsession/tpsessionaccount.h index 598aab9..7f9fe4b 100644 --- a/tpsession-0.1/tpsession/tpsessionaccount.h +++ b/tpsession-0.1/tpsession/tpsessionaccount.h @@ -37,6 +37,9 @@ #include #include +class TpSessionAccount; + +#include "tpsession.h" #include "tpsessionchannel.h" class TpSessionAccount:public QObject @@ -63,6 +66,7 @@ signals: private slots: void onReady(Tp::PendingOperation *op); void onOutgoingChannelReady(TpSessionChannel *ch); + void onChannelDestroyed(TpSessionChannel *ch); void onContactsConnectionReady(Tp::PendingOperation *op); void onNewContactRetrieved(Tp::PendingOperation *op); void onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *); diff --git a/tpsession-0.1/tpsession/tpsessionchannel.cpp b/tpsession-0.1/tpsession/tpsessionchannel.cpp index 96a4972..c4ca403 100644 --- a/tpsession-0.1/tpsession/tpsessionchannel.cpp +++ b/tpsession-0.1/tpsession/tpsessionchannel.cpp @@ -100,17 +100,20 @@ TpSessionChannel::TpSessionChannel(Tp::ConnectionPtr conn,const Tp::ContactPtr & TpSessionChannel::TpSessionChannel(Tp::TextChannelPtr ch) { - // qDebug() << "TpSessionChannel::TpSessionChannel" <<"path " << ch->objectPath(); + if(TpSession::tpsDebug()) qDebug() << "TpSessionChannel::TpSessionChannel" <<"path " << ch->objectPath(); channel=ch; connect(channel->becomeReady(Tp::TextChannel::FeatureMessageQueue|Tp::TextChannel::FeatureMessageSentSignal), SIGNAL(finished(Tp::PendingOperation *)), SLOT(onChannelReady(Tp::PendingOperation *))); + connect(channel.data(), + SIGNAL(invalidated(Tp::DBusProxy *, const QString &, const QString &)), + SLOT(onChannelDestroyed())); } void TpSessionChannel::onChannelCreated(Tp::PendingOperation *op) { - // qDebug() << "TpSessionChannel::onOutgoingChannelCreated" ; + if(TpSession::tpsDebug())qDebug() << "TpSessionChannel::onOutgoingChannelCreated" ; if (op->isError()) { qWarning() << "Connection cannot become connected" ; return; @@ -122,6 +125,9 @@ void TpSessionChannel::onChannelCreated(Tp::PendingOperation *op) connect(channel->becomeReady(Tp::TextChannel::FeatureMessageQueue | Tp::TextChannel::FeatureMessageSentSignal), SIGNAL(finished(Tp::PendingOperation*)), SLOT(onChannelReady(Tp::PendingOperation*))); + connect(channel.data(), + SIGNAL(invalidated(Tp::DBusProxy *, const QString &, const QString &)), + SLOT(onChannelDestroyed())); } QString TpSessionChannel::objectPath() @@ -135,8 +141,8 @@ QString TpSessionChannel::type() void TpSessionChannel::onChannelReady(Tp::PendingOperation *op) { Q_UNUSED(op); - //qDebug() << "TpSessionChannel::onChannelReady type=" << channel->channelType() <<"path " << channel->objectPath() << - // "initiatorContact=" << (channel->initiatorContact() ? channel->initiatorContact()->id():"NULL"); + if(TpSession::tpsDebug()) qDebug() << "TpSessionChannel::onChannelReady type=" << channel->channelType() <<"path " << channel->objectPath() << + "initiatorContact=" << (channel->initiatorContact() ? channel->initiatorContact()->id():"NULL"); ; connect(channel.data(), SIGNAL(messageReceived(const Tp::ReceivedMessage &)), @@ -144,7 +150,7 @@ void TpSessionChannel::onChannelReady(Tp::PendingOperation *op) connect(channel.data(), SIGNAL(messageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &)), SLOT(onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &))); - connect(channel.data(),SIGNAL(destroyed(QObject *)),SLOT(onChannelDestroyed(QObject *))); + connect(channel.data(),SIGNAL(destroyed(QObject *)),SLOT(onChannelDestroyed())); if(peerId().isEmpty()) peerContact=channel->initiatorContact(); // If this is incoming channel emit channelReady(this); QList queuedMessages = channel->messageQueue(); @@ -185,10 +191,9 @@ QString TpSessionChannel::peerId() return peerContact ? peerContact->id():QString(); } -void TpSessionChannel::onChannelDestroyed(QObject *obj) +void TpSessionChannel::onChannelDestroyed() { - Q_UNUSED(obj); - qDebug() << "TpSessionChannel::onChannelDestroyed"; + if(TpSession::tpsDebug()) qDebug() << "TpSessionChannel::onChannelDestroyed" << peerId() << objectPath(); //TpSessionChannel *call = (TpSessionChannel *) obj; emit channelDestroyed(this); } diff --git a/tpsession-0.1/tpsession/tpsessionchannel.h b/tpsession-0.1/tpsession/tpsessionchannel.h index 44db8ea..3ae18cb 100644 --- a/tpsession-0.1/tpsession/tpsessionchannel.h +++ b/tpsession-0.1/tpsession/tpsessionchannel.h @@ -33,6 +33,10 @@ #include #include +class TpSessionChannel; + +#include "tpsession.h" + class TpSessionChannel : public QObject { Q_OBJECT @@ -51,7 +55,7 @@ signals: public slots: void onChannelCreated(Tp::PendingOperation *op); void onChannelReady(Tp::PendingOperation *op); - void onChannelDestroyed(QObject *); + void onChannelDestroyed(); void onMessageReceived(const Tp::ReceivedMessage &); void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &); public: diff --git a/www/index.html b/www/index.html index 56b52d1..153e4e5 100644 --- a/www/index.html +++ b/www/index.html @@ -39,7 +39,8 @@ News:
11 Feb 2010 - Internal release for review
- 26 May 2010 0.1.3 version, lot of bug fixes for QtMobility 10.0.1
+ 26 May 2010 0.1.3 version, lot of bug fixes for QtMobility 1.0.1
+ 02 Jun 2010 0.1.4 channelDestroyed signal, environment var TPSESSIONDEBUG to enable debug prints