channelDestroyed hadling, TPSESSION_DEBUG env
[tpsession] / tpsession-0.1 / tpsession / tpsession.cpp
index 20a69cd..93a2989 100644 (file)
@@ -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);