1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 02:54:33 +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_zeroconf->advertise();
m_isOnline = true; m_isOnline = true;
foreach( QStringList *currNode, m_cachedNodes ) foreach( const QStringList& nodeSet, m_cachedNodes )
{ {
QStringList nodeSet = *currNode;
if ( !Servent::instance()->connectedToSession( nodeSet[3] ) ) if ( !Servent::instance()->connectedToSession( nodeSet[3] ) )
Servent::instance()->connectToPeer( nodeSet[0], nodeSet[1].toInt(), "whitelist", nodeSet[2], nodeSet[3] ); Servent::instance()->connectToPeer( nodeSet[0], nodeSet[1].toInt(), "whitelist", nodeSet[2], nodeSet[3] );
delete currNode;
} }
m_cachedNodes.clear();
return true; return true;
} }
@@ -81,9 +78,9 @@ ZeroconfPlugin::lanHostFound( const QString& host, int port, const QString& name
if ( !m_isOnline ) if ( !m_isOnline )
{ {
qDebug() << "Not online, so not connecting."; qDebug() << "Not online, so not connecting.";
QStringList *nodeSet = new QStringList(); QStringList nodeSet;
*nodeSet << host << QString::number( port ) << name << nodeid; nodeSet << host << QString::number( port ) << name << nodeid;
m_cachedNodes.insert( nodeSet ); m_cachedNodes.append( nodeSet );
return; return;
} }

View File

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