1
0
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:
Frank Osterfeld
2011-04-14 21:14:13 +08:00
committed by Christian Muehlhaeuser
parent f16277ac5f
commit df8a333aee
2 changed files with 6 additions and 9 deletions

View File

@@ -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;
}

View File

@@ -78,7 +78,7 @@ private slots:
private:
TomahawkZeroconf* m_zeroconf;
bool m_isOnline;
QSet< QStringList* > m_cachedNodes;
QVector<QStringList> m_cachedNodes;
};
#endif