From kde-commits Sat Sep 13 12:24:52 2008 From: Volker Krause Date: Sat, 13 Sep 2008 12:24:52 +0000 To: kde-commits Subject: KDE/kdepim/akonadi/clients/akonadiconsole Message-Id: <1221308692.898611.24627.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=122130870217346 SVN commit 860586 by vkrause: Allow to enable/disable the server side protocol level debugging mode. M +6 -0 CMakeLists.txt M +18 -3 debugwidget.cpp M +4 -0 debugwidget.h A org.freedesktop.Akonadi.DebugInterface.xml --- trunk/KDE/kdepim/akonadi/clients/akonadiconsole/CMakeLists.txt #860585:860586 @@ -22,6 +22,12 @@ qt4_add_dbus_interfaces( akonadiconsole_bin_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.TracerNotification.xml ) +# Use intalled interface once we can depend on Akoandi 1.1 +set_source_files_properties( org.freedesktop.Akonadi.DebugInterface.xml PROPERTIES CLASSNAME DebugInterface ) +qt4_add_dbus_interface( akonadiconsole_bin_SRCS + org.freedesktop.Akonadi.DebugInterface.xml + debuginterface +) kde4_add_ui_files(akonadiconsole_bin_SRCS browserwidget_itemview.ui --- trunk/KDE/kdepim/akonadi/clients/akonadiconsole/debugwidget.cpp #860585:860586 @@ -21,20 +21,30 @@ #include "debugwidget.h" +#include "tracernotificationinterface.h" +#include "connectionpage.h" +#include "debuginterface.h" + +#include + #include #include #include #include #include +#include -#include "tracernotificationinterface.h" -#include "connectionpage.h" - DebugWidget::DebugWidget( QWidget *parent ) : QWidget( parent ) { QVBoxLayout *layout = new QVBoxLayout( this ); + mDebugInterface = new DebugInterface( "org.freedesktop.Akonadi", "/debug", QDBusConnection::sessionBus(), this ); + QCheckBox *cb = new QCheckBox( i18n("Enable Debugger"), this ); + cb->setChecked( mDebugInterface->tracer().value() == QLatin1String( "dbus" ) ); + connect( cb, SIGNAL(toggled(bool)), SLOT(enableDebugger(bool)) ); + layout->addWidget( cb ); + QSplitter *splitter = new QSplitter( Qt::Vertical, this ); splitter->setObjectName( "debugSplitter" ); layout->addWidget( splitter ); @@ -120,4 +130,9 @@ mGeneralView->append( QString( "%1: %2" ).arg( componentName, msg ) ); } +void DebugWidget::enableDebugger(bool enable) +{ + mDebugInterface->setTracer( enable ? QLatin1String( "dbus" ) : QLatin1String( "null" ) ); +} + #include "debugwidget.moc" --- trunk/KDE/kdepim/akonadi/clients/akonadiconsole/debugwidget.h #860585:860586 @@ -29,6 +29,7 @@ class QTabWidget; class ConnectionPage; +class DebugInterface; class DebugWidget : public QWidget { @@ -44,10 +45,13 @@ void warningEmitted( const QString&, const QString& ); void errorEmitted( const QString&, const QString& ); + void enableDebugger( bool enable ); + private: QTextEdit *mGeneralView; QTabWidget *mConnectionPages; QHash mPageHash; + DebugInterface *mDebugInterface; }; #endif