1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 07:36:48 +02:00

qt5: use to/fromLatin1 instead of to/fromAscii

This commit is contained in:
Dominik Schmidt
2013-01-05 07:16:41 +01:00
parent 29e73ad47c
commit 587e0ad927
7 changed files with 14 additions and 14 deletions

View File

@@ -383,7 +383,7 @@ TomahawkApp::instance()
void void
TomahawkApp::printHelp() TomahawkApp::printHelp()
{ {
#define echo( X ) std::cout << QString( X ).toAscii().data() << "\n" #define echo( X ) std::cout << QString( X ).toLatin1().data() << "\n"
echo( "Usage: " + arguments().at( 0 ) + " [options] [url]" ); echo( "Usage: " + arguments().at( 0 ) + " [options] [url]" );
echo( "Options are:" ); echo( "Options are:" );

View File

@@ -104,13 +104,13 @@ public slots:
.arg( m_port ) .arg( m_port )
.arg( Database::instance()->impl()->dbid() ) .arg( Database::instance()->impl()->dbid() )
.arg( QHostInfo::localHostName() ) .arg( QHostInfo::localHostName() )
.toAscii(); .toLatin1();
m_sock.writeDatagram( advert.data(), advert.size(), QHostAddress::Broadcast, ZCONF_PORT ); m_sock.writeDatagram( advert.data(), advert.size(), QHostAddress::Broadcast, ZCONF_PORT );
advert = QString( "TOMAHAWKADVERT:%1:%2" ) advert = QString( "TOMAHAWKADVERT:%1:%2" )
.arg( m_port ) .arg( m_port )
.arg( Database::instance()->impl()->dbid() ) .arg( Database::instance()->impl()->dbid() )
.toAscii(); .toLatin1();
m_sock.writeDatagram( advert.data(), advert.size(), QHostAddress::Broadcast, ZCONF_PORT ); m_sock.writeDatagram( advert.data(), advert.size(), QHostAddress::Broadcast, ZCONF_PORT );
} }
@@ -129,13 +129,13 @@ private slots:
QHostAddress sender; QHostAddress sender;
quint16 senderPort; quint16 senderPort;
m_sock.readDatagram( datagram.data(), datagram.size(), &sender, &senderPort ); m_sock.readDatagram( datagram.data(), datagram.size(), &sender, &senderPort );
qDebug() << "DATAGRAM RCVD" << QString::fromAscii( datagram ) << sender; qDebug() << "DATAGRAM RCVD" << QString::fromLatin1( datagram ) << sender;
// only process msgs originating on the LAN: // only process msgs originating on the LAN:
if ( datagram.startsWith( "TOMAHAWKADVERT:" ) && if ( datagram.startsWith( "TOMAHAWKADVERT:" ) &&
Servent::isIPWhitelisted( sender ) ) Servent::isIPWhitelisted( sender ) )
{ {
QStringList parts = QString::fromAscii( datagram ).split( ':' ); QStringList parts = QString::fromLatin1( datagram ).split( ':' );
if ( parts.length() == 4 ) if ( parts.length() == 4 )
{ {
bool ok; bool ok;

View File

@@ -588,7 +588,7 @@ MprisPlugin::notifyPropertyChanged( const QString& interface, const QString& pro
"PropertiesChanged" ); "PropertiesChanged" );
signal << interface; signal << interface;
QVariantMap changedProps; QVariantMap changedProps;
changedProps.insert(propertyName, property(propertyName.toAscii())); changedProps.insert(propertyName, property(propertyName.toLatin1()));
signal << changedProps; signal << changedProps;
signal << QStringList(); signal << QStringList();
QDBusConnection::sessionBus().send(signal); QDBusConnection::sessionBus().send(signal);

View File

@@ -255,7 +255,7 @@ ControlConnection::handleMsg( msg_ptr msg )
// if small and not compresed, print it out for debug // if small and not compresed, print it out for debug
if ( msg->length() < 1024 && !msg->is( Msg::COMPRESSED ) ) if ( msg->length() < 1024 && !msg->is( Msg::COMPRESSED ) )
{ {
qDebug() << id() << "got msg:" << QString::fromAscii( msg->payload() ); qDebug() << id() << "got msg:" << QString::fromLatin1( msg->payload() );
} }
// All control connection msgs are JSON // All control connection msgs are JSON
@@ -289,13 +289,13 @@ ControlConnection::handleMsg( msg_ptr msg )
} }
else else
{ {
tDebug() << id() << "Unhandled msg:" << QString::fromAscii( msg->payload() ); tDebug() << id() << "Unhandled msg:" << QString::fromLatin1( msg->payload() );
} }
return; return;
} }
tDebug() << id() << "Invalid msg:" << QString::fromAscii( msg->payload() ); tDebug() << id() << "Invalid msg:" << QString::fromLatin1( msg->payload() );
} }

View File

@@ -45,7 +45,7 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent )
{ {
QFile f( RESPATH "stylesheets/topbar-radiobuttons.css" ); QFile f( RESPATH "stylesheets/topbar-radiobuttons.css" );
f.open( QFile::ReadOnly ); f.open( QFile::ReadOnly );
QString css = QString::fromAscii( f.readAll() ); QString css = QString::fromLatin1( f.readAll() );
f.close(); f.close();
QHBoxLayout* outerModeLayout = new QHBoxLayout; QHBoxLayout* outerModeLayout = new QHBoxLayout;

View File

@@ -205,7 +205,7 @@ SipInfo::toJson() const
QJson::Serializer serializer; QJson::Serializer serializer;
QByteArray ba = serializer.serialize( m ); QByteArray ba = serializer.serialize( m );
return QString::fromAscii( ba ); return QString::fromLatin1( ba );
} }
@@ -216,7 +216,7 @@ SipInfo::fromJson( QString json )
QJson::Parser parser; QJson::Parser parser;
bool ok; bool ok;
QVariant v = parser.parse( json.toAscii(), &ok ); QVariant v = parser.parse( json.toLatin1(), &ok );
if ( !ok || v.type() != QVariant::Map ) if ( !ok || v.type() != QVariant::Map )
{ {
qDebug() << Q_FUNC_INFO << "Invalid JSON: " << json; qDebug() << Q_FUNC_INFO << "Invalid JSON: " << json;

View File

@@ -82,7 +82,7 @@ log( const char *msg, unsigned int debugLevel, bool toDisk = true )
logfile << "TSQLQUERY: "; logfile << "TSQLQUERY: ";
#endif #endif
logfile << QTime::currentTime().toString().toAscii().data() << " [" << QString::number( debugLevel ).toAscii().data() << "]: " << msg << endl; logfile << QTime::currentTime().toString().toLatin1().data() << " [" << QString::number( debugLevel ).toLatin1().data() << "]: " << msg << endl;
logfile.flush(); logfile.flush();
} }
@@ -170,6 +170,6 @@ TLog::TLog( unsigned int debugLevel )
TLog::~TLog() TLog::~TLog()
{ {
log( m_msg.toAscii().data(), m_debugLevel ); log( m_msg.toLatin1().data(), m_debugLevel );
} }