1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01: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
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:" );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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