1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-08 23:26:40 +02:00

* Style cleanup.

This commit is contained in:
Christian Muehlhaeuser
2012-06-24 23:55:00 +02:00
parent 746914844e
commit f2101c2986
2 changed files with 31 additions and 22 deletions

View File

@@ -369,13 +369,15 @@ NetworkProxyFactory::setNoProxyHosts( const QStringList& hosts )
{ {
QStringList newList; QStringList newList;
tDebug() << Q_FUNC_INFO << "No-proxy hosts:" << hosts; tDebug() << Q_FUNC_INFO << "No-proxy hosts:" << hosts;
foreach( QString host, hosts ) foreach ( const QString& host, hosts )
{ {
QString munge = host.simplified(); QString munge = host.simplified();
newList << munge; newList << munge;
//TODO: wildcard support //TODO: wildcard support
} }
tDebug() << Q_FUNC_INFO << "New no-proxy hosts:" << newList; tDebug() << Q_FUNC_INFO << "New no-proxy hosts:" << newList;
s_noProxyHostsMutex.lock(); s_noProxyHostsMutex.lock();
s_noProxyHosts = newList; s_noProxyHosts = newList;
s_noProxyHostsMutex.unlock(); s_noProxyHostsMutex.unlock();
@@ -636,19 +638,26 @@ removeDirectory( const QString& dir )
tLog() << "Deleting DIR:" << dir; tLog() << "Deleting DIR:" << dir;
bool has_err = false; bool has_err = false;
if (aDir.exists()) { if ( aDir.exists() )
foreach(const QFileInfo& entry, aDir.entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::NoSymLinks)) { {
foreach ( const QFileInfo& entry, aDir.entryInfoList( QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::NoSymLinks ) )
{
QString path = entry.absoluteFilePath(); QString path = entry.absoluteFilePath();
if (entry.isDir()) { if ( entry.isDir() )
{
has_err = !removeDirectory( path ) || has_err; has_err = !removeDirectory( path ) || has_err;
} else if (!QFile::remove(path)) { }
else if ( !QFile::remove( path ) )
{
has_err = true; has_err = true;
} }
} }
if (!aDir.rmdir(aDir.absolutePath())) { if ( !aDir.rmdir( aDir.absolutePath() ) )
{
has_err = true; has_err = true;
} }
} }
return !has_err; return !has_err;
} }