mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 16:14:40 +02:00
Convert QSet<QStringList*> to QVector<QStringList>.
This one possibly leaked, there is no need to use pointers here.
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
f16277ac5f
commit
df8a333aee
@@ -49,15 +49,12 @@ ZeroconfPlugin::connectPlugin( bool /*startup*/ )
|
||||
m_zeroconf->advertise();
|
||||
m_isOnline = true;
|
||||
|
||||
foreach( QStringList *currNode, m_cachedNodes )
|
||||
foreach( const QStringList& nodeSet, m_cachedNodes )
|
||||
{
|
||||
QStringList nodeSet = *currNode;
|
||||
if ( !Servent::instance()->connectedToSession( nodeSet[3] ) )
|
||||
Servent::instance()->connectToPeer( nodeSet[0], nodeSet[1].toInt(), "whitelist", nodeSet[2], nodeSet[3] );
|
||||
|
||||
delete currNode;
|
||||
}
|
||||
|
||||
m_cachedNodes.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -81,9 +78,9 @@ ZeroconfPlugin::lanHostFound( const QString& host, int port, const QString& name
|
||||
if ( !m_isOnline )
|
||||
{
|
||||
qDebug() << "Not online, so not connecting.";
|
||||
QStringList *nodeSet = new QStringList();
|
||||
*nodeSet << host << QString::number( port ) << name << nodeid;
|
||||
m_cachedNodes.insert( nodeSet );
|
||||
QStringList nodeSet;
|
||||
nodeSet << host << QString::number( port ) << name << nodeid;
|
||||
m_cachedNodes.append( nodeSet );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -78,7 +78,7 @@ private slots:
|
||||
private:
|
||||
TomahawkZeroconf* m_zeroconf;
|
||||
bool m_isOnline;
|
||||
QSet< QStringList* > m_cachedNodes;
|
||||
QVector<QStringList> m_cachedNodes;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user