mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 23:26:40 +02:00
Some whitespace cleaning
This commit is contained in:
@@ -38,15 +38,15 @@
|
||||
#include <qjson/parser.h>
|
||||
#include <qjson/serializer.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QStringList>
|
||||
#include <QDateTime>
|
||||
#include <QTimer>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
#include <QInputDialog>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QtGui/QInputDialog>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QMessageBox>
|
||||
#endif
|
||||
|
||||
#include <utils/tomahawkutilsgui.h>
|
||||
@@ -410,7 +410,7 @@ JabberPlugin::errorMessage( Jreen::Client::DisconnectReason reason )
|
||||
|
||||
|
||||
void
|
||||
JabberPlugin::sendMsg(const QString& to, const QString& msg)
|
||||
JabberPlugin::sendMsg( const QString& to, const QString& msg )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << to << msg;
|
||||
|
||||
@@ -435,11 +435,11 @@ JabberPlugin::sendMsg(const QString& to, const QString& msg)
|
||||
TomahawkSipMessage *sipMessage;
|
||||
if(m["visible"].toBool())
|
||||
{
|
||||
sipMessage = new TomahawkSipMessage(m["ip"].toString(),
|
||||
m["port"].toInt(),
|
||||
m["uniqname"].toString(),
|
||||
m["key"].toString()
|
||||
);
|
||||
sipMessage = new TomahawkSipMessage( m["ip"].toString(),
|
||||
m["port"].toInt(),
|
||||
m["uniqname"].toString(),
|
||||
m["key"].toString()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -449,14 +449,14 @@ JabberPlugin::sendMsg(const QString& to, const QString& msg)
|
||||
qDebug() << "Send sip messsage to " << to;
|
||||
Jreen::IQ iq( Jreen::IQ::Set, to );
|
||||
iq.addExtension( sipMessage );
|
||||
Jreen::IQReply *reply = m_client->send(iq);
|
||||
reply->setData(SipMessageSent);
|
||||
connect(reply, SIGNAL(received(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ)));
|
||||
Jreen::IQReply *reply = m_client->send( iq );
|
||||
reply->setData( SipMessageSent );
|
||||
connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
JabberPlugin::broadcastMsg(const QString& msg)
|
||||
JabberPlugin::broadcastMsg( const QString& msg )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
@@ -471,7 +471,7 @@ JabberPlugin::broadcastMsg(const QString& msg)
|
||||
|
||||
|
||||
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
|
||||
|
||||
@@ -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 )
|
||||
return;
|
||||
@@ -699,9 +699,9 @@ void JabberPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, const
|
||||
Jreen::IQ featuresIq( Jreen::IQ::Get, jid );
|
||||
featuresIq.addExtension( new Jreen::Disco::Info( node ) );
|
||||
|
||||
Jreen::IQReply *reply = m_client->send(featuresIq);
|
||||
reply->setData(RequestDisco);
|
||||
connect(reply, SIGNAL(received(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ)));
|
||||
Jreen::IQReply *reply = m_client->send( featuresIq );
|
||||
reply->setData( RequestDisco );
|
||||
connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
|
||||
}
|
||||
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 )
|
||||
return;
|
||||
@@ -774,9 +774,9 @@ JabberPlugin::onSubscriptionRequestConfirmed( int result )
|
||||
QList< QMessageBox* > confirmBoxes = m_subscriptionConfirmBoxes.values();
|
||||
Jreen::JID jid;
|
||||
|
||||
foreach( QMessageBox* currentBox, confirmBoxes )
|
||||
foreach ( QMessageBox* currentBox, confirmBoxes )
|
||||
{
|
||||
if( currentBox == sender() )
|
||||
if ( currentBox == sender() )
|
||||
{
|
||||
jid = m_subscriptionConfirmBoxes.key( currentBox );
|
||||
}
|
||||
@@ -786,7 +786,7 @@ JabberPlugin::onSubscriptionRequestConfirmed( int result )
|
||||
m_subscriptionConfirmBoxes.remove( jid );
|
||||
sender()->deleteLater();
|
||||
|
||||
QMessageBox::StandardButton allowSubscription = static_cast<QMessageBox::StandardButton>( result );
|
||||
QMessageBox::StandardButton allowSubscription = static_cast< QMessageBox::StandardButton >( result );
|
||||
|
||||
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 )
|
||||
return;
|
||||
|
||||
Jreen::IQReply *reply = qobject_cast<Jreen::IQReply*>(sender());
|
||||
Jreen::IQReply *reply = qobject_cast< Jreen::IQReply* >( sender() );
|
||||
int context = reply ? reply->data().toInt() : NoContext;
|
||||
|
||||
if( context == RequestDisco )
|
||||
if ( context == RequestDisco )
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO << "Received disco IQ...";
|
||||
Jreen::Disco::Info *discoInfo = iq.payload<Jreen::Disco::Info>().data();
|
||||
if(!discoInfo)
|
||||
Jreen::Disco::Info *discoInfo = iq.payload< Jreen::Disco::Info >().data();
|
||||
if ( !discoInfo )
|
||||
return;
|
||||
iq.accept();
|
||||
|
||||
@@ -823,7 +823,7 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq)
|
||||
|
||||
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";
|
||||
|
||||
@@ -831,17 +831,17 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq)
|
||||
handlePeerStatus( jid, Jreen::Presence::Available );
|
||||
}
|
||||
}
|
||||
else if(context == RequestVersion)
|
||||
else if ( context == RequestVersion)
|
||||
{
|
||||
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() );
|
||||
qDebug() << Q_FUNC_INFO << "Received software version for " << 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?";
|
||||
}
|
||||
@@ -855,7 +855,7 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq)
|
||||
}*/
|
||||
else
|
||||
{
|
||||
TomahawkSipMessage::Ptr sipMessage = iq.payload<TomahawkSipMessage>();
|
||||
TomahawkSipMessage::Ptr sipMessage = iq.payload< TomahawkSipMessage >();
|
||||
if(sipMessage)
|
||||
{
|
||||
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::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();
|
||||
|
||||
@@ -919,7 +919,7 @@ void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type
|
||||
}
|
||||
|
||||
// "coming online" event
|
||||
if( presenceMeansOnline( presenceType ) &&
|
||||
if ( presenceMeansOnline( presenceType ) &&
|
||||
( !m_peers.contains( jid ) ||
|
||||
!presenceMeansOnline( m_peers.value( jid ) )
|
||||
)
|
||||
@@ -931,16 +931,16 @@ void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type
|
||||
emit peerOnline( fulljid );
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
if(!m_avatarManager->avatar(jid.bare()).isNull())
|
||||
if ( !m_avatarManager->avatar( jid.bare() ).isNull() )
|
||||
onNewAvatar( jid.bare() );
|
||||
#endif
|
||||
|
||||
// request software version
|
||||
Jreen::IQ versionIq( Jreen::IQ::Get, jid );
|
||||
versionIq.addExtension( new Jreen::SoftwareVersion() );
|
||||
Jreen::IQReply *reply = m_client->send(versionIq);
|
||||
reply->setData(RequestVersion);
|
||||
connect(reply, SIGNAL(received(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ)));
|
||||
Jreen::IQReply *reply = m_client->send( versionIq );
|
||||
reply->setData( RequestVersion );
|
||||
connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
|
||||
|
||||
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
|
||||
// qDebug() << Q_FUNC_INFO << jid;
|
||||
if ( m_state != Connected )
|
||||
return;
|
||||
|
||||
Q_ASSERT(!m_avatarManager->avatar( jid ).isNull());
|
||||
Q_ASSERT( !m_avatarManager->avatar( jid ).isNull() );
|
||||
|
||||
// find peers for the jid
|
||||
QList<Jreen::JID> peers = m_peers.keys();
|
||||
foreach(const Jreen::JID &peer, peers)
|
||||
QList< Jreen::JID > peers = m_peers.keys();
|
||||
foreach ( const Jreen::JID &peer, peers )
|
||||
{
|
||||
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
|
||||
emit avatarReceived ( m_avatarManager->avatar( jid ) );
|
||||
else
|
||||
|
@@ -42,7 +42,7 @@
|
||||
#include <jreen/mucroom.h>
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
#include <QMessageBox>
|
||||
#include <QtGui/QMessageBox>
|
||||
#endif
|
||||
|
||||
#define MYNAME "SIPJREEN"
|
||||
@@ -112,7 +112,7 @@ protected:
|
||||
private slots:
|
||||
void showXmlConsole();
|
||||
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 onSubscriptionReceived( const Jreen::RosterItem::Ptr &item, const Jreen::Presence& presence );
|
||||
|
Reference in New Issue
Block a user