From 587e0ad9271301ec47297342ef7b82fc1c7a75dd Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Sat, 5 Jan 2013 07:16:41 +0100 Subject: [PATCH] qt5: use to/fromLatin1 instead of to/fromAscii --- src/TomahawkApp.cpp | 2 +- src/accounts/zeroconf/TomahawkZeroconf.h | 8 ++++---- src/infoplugins/linux/mpris/MprisPlugin.cpp | 2 +- src/libtomahawk/network/ControlConnection.cpp | 6 +++--- src/libtomahawk/playlist/FlexibleHeader.cpp | 2 +- src/libtomahawk/sip/SipInfo.cpp | 4 ++-- src/libtomahawk/utils/Logger.cpp | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/TomahawkApp.cpp b/src/TomahawkApp.cpp index 964641f74..5e8c30583 100644 --- a/src/TomahawkApp.cpp +++ b/src/TomahawkApp.cpp @@ -383,7 +383,7 @@ TomahawkApp::instance() void 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( "Options are:" ); diff --git a/src/accounts/zeroconf/TomahawkZeroconf.h b/src/accounts/zeroconf/TomahawkZeroconf.h index 76bf8c003..c1d362fb4 100644 --- a/src/accounts/zeroconf/TomahawkZeroconf.h +++ b/src/accounts/zeroconf/TomahawkZeroconf.h @@ -104,13 +104,13 @@ public slots: .arg( m_port ) .arg( Database::instance()->impl()->dbid() ) .arg( QHostInfo::localHostName() ) - .toAscii(); + .toLatin1(); m_sock.writeDatagram( advert.data(), advert.size(), QHostAddress::Broadcast, ZCONF_PORT ); advert = QString( "TOMAHAWKADVERT:%1:%2" ) .arg( m_port ) .arg( Database::instance()->impl()->dbid() ) - .toAscii(); + .toLatin1(); m_sock.writeDatagram( advert.data(), advert.size(), QHostAddress::Broadcast, ZCONF_PORT ); } @@ -129,13 +129,13 @@ private slots: QHostAddress sender; quint16 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: if ( datagram.startsWith( "TOMAHAWKADVERT:" ) && Servent::isIPWhitelisted( sender ) ) { - QStringList parts = QString::fromAscii( datagram ).split( ':' ); + QStringList parts = QString::fromLatin1( datagram ).split( ':' ); if ( parts.length() == 4 ) { bool ok; diff --git a/src/infoplugins/linux/mpris/MprisPlugin.cpp b/src/infoplugins/linux/mpris/MprisPlugin.cpp index d86e4a399..926a00d58 100644 --- a/src/infoplugins/linux/mpris/MprisPlugin.cpp +++ b/src/infoplugins/linux/mpris/MprisPlugin.cpp @@ -588,7 +588,7 @@ MprisPlugin::notifyPropertyChanged( const QString& interface, const QString& pro "PropertiesChanged" ); signal << interface; QVariantMap changedProps; - changedProps.insert(propertyName, property(propertyName.toAscii())); + changedProps.insert(propertyName, property(propertyName.toLatin1())); signal << changedProps; signal << QStringList(); QDBusConnection::sessionBus().send(signal); diff --git a/src/libtomahawk/network/ControlConnection.cpp b/src/libtomahawk/network/ControlConnection.cpp index a3f069c8e..4aa0e8113 100644 --- a/src/libtomahawk/network/ControlConnection.cpp +++ b/src/libtomahawk/network/ControlConnection.cpp @@ -255,7 +255,7 @@ ControlConnection::handleMsg( msg_ptr msg ) // if small and not compresed, print it out for debug 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 @@ -289,13 +289,13 @@ ControlConnection::handleMsg( msg_ptr msg ) } else { - tDebug() << id() << "Unhandled msg:" << QString::fromAscii( msg->payload() ); + tDebug() << id() << "Unhandled msg:" << QString::fromLatin1( msg->payload() ); } return; } - tDebug() << id() << "Invalid msg:" << QString::fromAscii( msg->payload() ); + tDebug() << id() << "Invalid msg:" << QString::fromLatin1( msg->payload() ); } diff --git a/src/libtomahawk/playlist/FlexibleHeader.cpp b/src/libtomahawk/playlist/FlexibleHeader.cpp index 7c574fa08..c5fb772a1 100644 --- a/src/libtomahawk/playlist/FlexibleHeader.cpp +++ b/src/libtomahawk/playlist/FlexibleHeader.cpp @@ -45,7 +45,7 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent ) { QFile f( RESPATH "stylesheets/topbar-radiobuttons.css" ); f.open( QFile::ReadOnly ); - QString css = QString::fromAscii( f.readAll() ); + QString css = QString::fromLatin1( f.readAll() ); f.close(); QHBoxLayout* outerModeLayout = new QHBoxLayout; diff --git a/src/libtomahawk/sip/SipInfo.cpp b/src/libtomahawk/sip/SipInfo.cpp index b0a39001a..03596305d 100644 --- a/src/libtomahawk/sip/SipInfo.cpp +++ b/src/libtomahawk/sip/SipInfo.cpp @@ -205,7 +205,7 @@ SipInfo::toJson() const QJson::Serializer serializer; QByteArray ba = serializer.serialize( m ); - return QString::fromAscii( ba ); + return QString::fromLatin1( ba ); } @@ -216,7 +216,7 @@ SipInfo::fromJson( QString json ) QJson::Parser parser; bool ok; - QVariant v = parser.parse( json.toAscii(), &ok ); + QVariant v = parser.parse( json.toLatin1(), &ok ); if ( !ok || v.type() != QVariant::Map ) { qDebug() << Q_FUNC_INFO << "Invalid JSON: " << json; diff --git a/src/libtomahawk/utils/Logger.cpp b/src/libtomahawk/utils/Logger.cpp index def5f8409..a560e6971 100644 --- a/src/libtomahawk/utils/Logger.cpp +++ b/src/libtomahawk/utils/Logger.cpp @@ -82,7 +82,7 @@ log( const char *msg, unsigned int debugLevel, bool toDisk = true ) logfile << "TSQLQUERY: "; #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(); } @@ -170,6 +170,6 @@ TLog::TLog( unsigned int debugLevel ) TLog::~TLog() { - log( m_msg.toAscii().data(), m_debugLevel ); + log( m_msg.toLatin1().data(), m_debugLevel ); }