1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 07:36:48 +02:00

Some whitespace cleaning

This commit is contained in:
Jeff Mitchell
2012-02-02 14:02:38 -05:00
parent 7efceebb1c
commit 07a9486e4d
2 changed files with 51 additions and 51 deletions

View File

@@ -38,15 +38,15 @@
#include <qjson/parser.h> #include <qjson/parser.h>
#include <qjson/serializer.h> #include <qjson/serializer.h>
#include <QtPlugin> #include <QtCore/QtPlugin>
#include <QStringList> #include <QtCore/QStringList>
#include <QDateTime> #include <QtCore/QDateTime>
#include <QTimer> #include <QtCore/QTimer>
#ifndef ENABLE_HEADLESS #ifndef ENABLE_HEADLESS
#include <QInputDialog> #include <QtGui/QInputDialog>
#include <QLineEdit> #include <QtGui/QLineEdit>
#include <QMessageBox> #include <QtGui/QMessageBox>
#endif #endif
#include <utils/tomahawkutilsgui.h> #include <utils/tomahawkutilsgui.h>
@@ -410,7 +410,7 @@ JabberPlugin::errorMessage( Jreen::Client::DisconnectReason reason )
void void
JabberPlugin::sendMsg(const QString& to, const QString& msg) JabberPlugin::sendMsg( const QString& to, const QString& msg )
{ {
qDebug() << Q_FUNC_INFO << to << msg; qDebug() << Q_FUNC_INFO << to << msg;
@@ -435,11 +435,11 @@ JabberPlugin::sendMsg(const QString& to, const QString& msg)
TomahawkSipMessage *sipMessage; TomahawkSipMessage *sipMessage;
if(m["visible"].toBool()) if(m["visible"].toBool())
{ {
sipMessage = new TomahawkSipMessage(m["ip"].toString(), sipMessage = new TomahawkSipMessage( m["ip"].toString(),
m["port"].toInt(), m["port"].toInt(),
m["uniqname"].toString(), m["uniqname"].toString(),
m["key"].toString() m["key"].toString()
); );
} }
else else
{ {
@@ -449,14 +449,14 @@ JabberPlugin::sendMsg(const QString& to, const QString& msg)
qDebug() << "Send sip messsage to " << to; qDebug() << "Send sip messsage to " << to;
Jreen::IQ iq( Jreen::IQ::Set, to ); Jreen::IQ iq( Jreen::IQ::Set, to );
iq.addExtension( sipMessage ); iq.addExtension( sipMessage );
Jreen::IQReply *reply = m_client->send(iq); Jreen::IQReply *reply = m_client->send( iq );
reply->setData(SipMessageSent); reply->setData( SipMessageSent );
connect(reply, SIGNAL(received(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ))); connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
} }
void void
JabberPlugin::broadcastMsg(const QString& msg) JabberPlugin::broadcastMsg( const QString& msg )
{ {
qDebug() << Q_FUNC_INFO; qDebug() << Q_FUNC_INFO;
@@ -471,7 +471,7 @@ JabberPlugin::broadcastMsg(const QString& msg)
void void
JabberPlugin::addContact(const QString& jid, const QString& msg) JabberPlugin::addContact( const QString& jid, const QString& msg )
{ {
// Add contact to the Tomahawk group on the roster // Add contact to the Tomahawk group on the roster
@@ -627,7 +627,7 @@ void JabberPlugin::removeMenuHelper()
} }
void JabberPlugin::onNewMessage(const Jreen::Message& message) void JabberPlugin::onNewMessage( const Jreen::Message& message )
{ {
if ( m_state != Connected ) if ( m_state != Connected )
return; return;
@@ -699,9 +699,9 @@ void JabberPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, const
Jreen::IQ featuresIq( Jreen::IQ::Get, jid ); Jreen::IQ featuresIq( Jreen::IQ::Get, jid );
featuresIq.addExtension( new Jreen::Disco::Info( node ) ); featuresIq.addExtension( new Jreen::Disco::Info( node ) );
Jreen::IQReply *reply = m_client->send(featuresIq); Jreen::IQReply *reply = m_client->send( featuresIq );
reply->setData(RequestDisco); reply->setData( RequestDisco );
connect(reply, SIGNAL(received(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ))); connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
} }
else if( !caps ) else if( !caps )
{ {
@@ -712,7 +712,7 @@ void JabberPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, const
} }
void JabberPlugin::onSubscriptionReceived(const Jreen::RosterItem::Ptr& item, const Jreen::Presence& presence) void JabberPlugin::onSubscriptionReceived( const Jreen::RosterItem::Ptr& item, const Jreen::Presence& presence )
{ {
if ( m_state != Connected ) if ( m_state != Connected )
return; return;
@@ -774,9 +774,9 @@ JabberPlugin::onSubscriptionRequestConfirmed( int result )
QList< QMessageBox* > confirmBoxes = m_subscriptionConfirmBoxes.values(); QList< QMessageBox* > confirmBoxes = m_subscriptionConfirmBoxes.values();
Jreen::JID jid; Jreen::JID jid;
foreach( QMessageBox* currentBox, confirmBoxes ) foreach ( QMessageBox* currentBox, confirmBoxes )
{ {
if( currentBox == sender() ) if ( currentBox == sender() )
{ {
jid = m_subscriptionConfirmBoxes.key( currentBox ); jid = m_subscriptionConfirmBoxes.key( currentBox );
} }
@@ -786,7 +786,7 @@ JabberPlugin::onSubscriptionRequestConfirmed( int result )
m_subscriptionConfirmBoxes.remove( jid ); m_subscriptionConfirmBoxes.remove( jid );
sender()->deleteLater(); sender()->deleteLater();
QMessageBox::StandardButton allowSubscription = static_cast<QMessageBox::StandardButton>( result ); QMessageBox::StandardButton allowSubscription = static_cast< QMessageBox::StandardButton >( result );
if ( allowSubscription == QMessageBox::Yes ) if ( allowSubscription == QMessageBox::Yes )
{ {
@@ -803,19 +803,19 @@ JabberPlugin::onSubscriptionRequestConfirmed( int result )
} }
void JabberPlugin::onNewIq(const Jreen::IQ& iq) void JabberPlugin::onNewIq( const Jreen::IQ& iq )
{ {
if ( m_state != Connected ) if ( m_state != Connected )
return; return;
Jreen::IQReply *reply = qobject_cast<Jreen::IQReply*>(sender()); Jreen::IQReply *reply = qobject_cast< Jreen::IQReply* >( sender() );
int context = reply ? reply->data().toInt() : NoContext; int context = reply ? reply->data().toInt() : NoContext;
if( context == RequestDisco ) if ( context == RequestDisco )
{ {
// qDebug() << Q_FUNC_INFO << "Received disco IQ..."; // qDebug() << Q_FUNC_INFO << "Received disco IQ...";
Jreen::Disco::Info *discoInfo = iq.payload<Jreen::Disco::Info>().data(); Jreen::Disco::Info *discoInfo = iq.payload< Jreen::Disco::Info >().data();
if(!discoInfo) if ( !discoInfo )
return; return;
iq.accept(); iq.accept();
@@ -823,7 +823,7 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq)
Jreen::DataForm::Ptr form = discoInfo->form(); Jreen::DataForm::Ptr form = discoInfo->form();
if(discoInfo->features().contains( TOMAHAWK_FEATURE )) if ( discoInfo->features().contains( TOMAHAWK_FEATURE ) )
{ {
qDebug() << Q_FUNC_INFO << jid.full() << "Running tomahawk/feature enabled: yes"; qDebug() << Q_FUNC_INFO << jid.full() << "Running tomahawk/feature enabled: yes";
@@ -831,17 +831,17 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq)
handlePeerStatus( jid, Jreen::Presence::Available ); handlePeerStatus( jid, Jreen::Presence::Available );
} }
} }
else if(context == RequestVersion) else if ( context == RequestVersion)
{ {
Jreen::SoftwareVersion::Ptr softwareVersion = iq.payload<Jreen::SoftwareVersion>(); Jreen::SoftwareVersion::Ptr softwareVersion = iq.payload<Jreen::SoftwareVersion>();
if( softwareVersion ) if ( softwareVersion )
{ {
QString versionString = QString("%1 %2 %3").arg( softwareVersion->name(), softwareVersion->os(), softwareVersion->version() ); QString versionString = QString("%1 %2 %3").arg( softwareVersion->name(), softwareVersion->os(), softwareVersion->version() );
qDebug() << Q_FUNC_INFO << "Received software version for " << iq.from().full() << ":" << versionString; qDebug() << Q_FUNC_INFO << "Received software version for " << iq.from().full() << ":" << versionString;
emit softwareVersionReceived( iq.from().full(), versionString ); emit softwareVersionReceived( iq.from().full(), versionString );
} }
} }
else if(context == RequestedDisco) else if ( context == RequestedDisco )
{ {
qDebug() << "Sent IQ(Set), what should be happening here?"; qDebug() << "Sent IQ(Set), what should be happening here?";
} }
@@ -855,7 +855,7 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq)
}*/ }*/
else else
{ {
TomahawkSipMessage::Ptr sipMessage = iq.payload<TomahawkSipMessage>(); TomahawkSipMessage::Ptr sipMessage = iq.payload< TomahawkSipMessage >();
if(sipMessage) if(sipMessage)
{ {
iq.accept(); iq.accept();
@@ -885,9 +885,9 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq)
} }
bool JabberPlugin::presenceMeansOnline(Jreen::Presence::Type p) bool JabberPlugin::presenceMeansOnline( Jreen::Presence::Type p )
{ {
switch(p) switch( p )
{ {
case Jreen::Presence::Invalid: case Jreen::Presence::Invalid:
case Jreen::Presence::Unavailable: case Jreen::Presence::Unavailable:
@@ -900,7 +900,7 @@ bool JabberPlugin::presenceMeansOnline(Jreen::Presence::Type p)
} }
void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type presenceType) void JabberPlugin::handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Type presenceType )
{ {
QString fulljid = jid.full(); QString fulljid = jid.full();
@@ -919,7 +919,7 @@ void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type
} }
// "coming online" event // "coming online" event
if( presenceMeansOnline( presenceType ) && if ( presenceMeansOnline( presenceType ) &&
( !m_peers.contains( jid ) || ( !m_peers.contains( jid ) ||
!presenceMeansOnline( m_peers.value( jid ) ) !presenceMeansOnline( m_peers.value( jid ) )
) )
@@ -931,16 +931,16 @@ void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type
emit peerOnline( fulljid ); emit peerOnline( fulljid );
#ifndef ENABLE_HEADLESS #ifndef ENABLE_HEADLESS
if(!m_avatarManager->avatar(jid.bare()).isNull()) if ( !m_avatarManager->avatar( jid.bare() ).isNull() )
onNewAvatar( jid.bare() ); onNewAvatar( jid.bare() );
#endif #endif
// request software version // request software version
Jreen::IQ versionIq( Jreen::IQ::Get, jid ); Jreen::IQ versionIq( Jreen::IQ::Get, jid );
versionIq.addExtension( new Jreen::SoftwareVersion() ); versionIq.addExtension( new Jreen::SoftwareVersion() );
Jreen::IQReply *reply = m_client->send(versionIq); Jreen::IQReply *reply = m_client->send( versionIq );
reply->setData(RequestVersion); reply->setData( RequestVersion );
connect(reply, SIGNAL(received(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ))); connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
return; return;
} }
@@ -950,18 +950,18 @@ void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type
} }
void JabberPlugin::onNewAvatar(const QString& jid) void JabberPlugin::onNewAvatar( const QString& jid )
{ {
#ifndef ENABLE_HEADLESS #ifndef ENABLE_HEADLESS
// qDebug() << Q_FUNC_INFO << jid; // qDebug() << Q_FUNC_INFO << jid;
if ( m_state != Connected ) if ( m_state != Connected )
return; return;
Q_ASSERT(!m_avatarManager->avatar( jid ).isNull()); Q_ASSERT( !m_avatarManager->avatar( jid ).isNull() );
// find peers for the jid // find peers for the jid
QList<Jreen::JID> peers = m_peers.keys(); QList< Jreen::JID > peers = m_peers.keys();
foreach(const Jreen::JID &peer, peers) foreach ( const Jreen::JID &peer, peers )
{ {
if( peer.bare() == jid ) if( peer.bare() == jid )
{ {
@@ -969,7 +969,7 @@ void JabberPlugin::onNewAvatar(const QString& jid)
} }
} }
if( jid == m_client->jid().bare() ) if ( jid == m_client->jid().bare() )
// own avatar // own avatar
emit avatarReceived ( m_avatarManager->avatar( jid ) ); emit avatarReceived ( m_avatarManager->avatar( jid ) );
else else

View File

@@ -42,7 +42,7 @@
#include <jreen/mucroom.h> #include <jreen/mucroom.h>
#ifndef ENABLE_HEADLESS #ifndef ENABLE_HEADLESS
#include <QMessageBox> #include <QtGui/QMessageBox>
#endif #endif
#define MYNAME "SIPJREEN" #define MYNAME "SIPJREEN"
@@ -112,7 +112,7 @@ protected:
private slots: private slots:
void showXmlConsole(); void showXmlConsole();
void onConnect(); void onConnect();
void onDisconnect(Jreen::Client::DisconnectReason reason); void onDisconnect( Jreen::Client::DisconnectReason reason );
void onPresenceReceived( const Jreen::RosterItem::Ptr &item, const Jreen::Presence& presence ); void onPresenceReceived( const Jreen::RosterItem::Ptr &item, const Jreen::Presence& presence );
void onSubscriptionReceived( const Jreen::RosterItem::Ptr &item, const Jreen::Presence& presence ); void onSubscriptionReceived( const Jreen::RosterItem::Ptr &item, const Jreen::Presence& presence );