These have been deprecated since Qt 5.0, and rather than use
{from,to}Local8Bit I've decided to match the original functionality.
18 files changed:
if (!mimeContainsBufferList(mimeData))
return bufferList;
if (!mimeContainsBufferList(mimeData))
return bufferList;
- QStringList rawBufferList = QString::fromAscii(mimeData->data("application/Quassel/BufferItemList")).split(",");
+ QStringList rawBufferList = QString::fromLatin1(mimeData->data("application/Quassel/BufferItemList")).split(",");
NetworkId networkId;
BufferId bufferUid;
foreach(QString rawBuffer, rawBufferList) {
NetworkId networkId;
BufferId bufferUid;
foreach(QString rawBuffer, rawBufferList) {
bufferlist << bufferid;
}
bufferlist << bufferid;
}
- mimeData->setData("application/Quassel/BufferItemList", bufferlist.join(",").toAscii());
+ mimeData->setData("application/Quassel/BufferItemList", bufferlist.join(",").toLatin1());
return toolTip(column);
case Qt::DisplayRole:
case TreeModel::SortRole: // fallthrough, since SortRole should default to DisplayRole
return toolTip(column);
case Qt::DisplayRole:
case TreeModel::SortRole: // fallthrough, since SortRole should default to DisplayRole
- return property(_propertyOrder[column].toAscii());
+ return property(_propertyOrder[column].toLatin1());
default:
return QVariant();
}
default:
return QVariant();
}
return false;
emit dataChanged(column);
return false;
emit dataChanged(column);
- return setProperty(_propertyOrder[column].toAscii(), value);
+ return setProperty(_propertyOrder[column].toLatin1(), value);
// if next arg is a short/long option/switch the current arg is one too
if (nextArg == argsRaw.constEnd() || nextArg->startsWith("-")) {
// switch
// if next arg is a short/long option/switch the current arg is one too
if (nextArg == argsRaw.constEnd() || nextArg->startsWith("-")) {
// switch
- for (int i = 0; i < currentArg->mid(1).toAscii().size(); i++) {
- name = currentArg->mid(1).toAscii().at(i);
+ for (int i = 0; i < currentArg->mid(1).toLatin1().size(); i++) {
+ name = currentArg->mid(1).toLatin1().at(i);
if (!addShortArg(CliParserArg::CliArgSwitch, name)) return false;
}
}
if (!addShortArg(CliParserArg::CliArgSwitch, name)) return false;
}
}
else {
// option
// short options are not freely mixable with other shortargs
else {
// option
// short options are not freely mixable with other shortargs
- if (currentArg->mid(1).toAscii().size() > 1) {
+ if (currentArg->mid(1).toLatin1().size() > 1) {
qWarning() << "Warning: Shortoptions may not be combined with other shortoptions or switches";
return false;
}
qWarning() << "Warning: Shortoptions may not be combined with other shortoptions or switches";
return false;
}
skipNext = true;
}
else value = currentArg->toLocal8Bit();
skipNext = true;
}
else value = currentArg->toLocal8Bit();
- name = currentArg->mid(1).toAscii().at(0);
+ name = currentArg->mid(1).toLatin1().at(0);
// we took one argument as argument to an option so skip it next time
if (skipNext) currentArg++;
if (!addShortArg(CliParserArg::CliArgOption, name, value)) return false;
// we took one argument as argument to an option so skip it next time
if (skipNext) currentArg++;
if (!addShortArg(CliParserArg::CliArgOption, name, value)) return false;
int num = methodSignature.right(3).toUInt();
if (num > 0) {
QString numericSig = methodSignature.left(methodSignature.length() - 3) + "Numeric";
int num = methodSignature.right(3).toUInt();
if (num > 0) {
QString numericSig = methodSignature.left(methodSignature.length() - 3) + "Numeric";
- eventType = eventEnum().keyToValue(numericSig.toAscii());
+ eventType = eventEnum().keyToValue(numericSig.toLatin1());
if (eventType < 0) {
qWarning() << Q_FUNC_INFO << "Could not find EventType" << numericSig << "for handling" << methodSignature;
return -1;
if (eventType < 0) {
qWarning() << Q_FUNC_INFO << "Could not find EventType" << numericSig << "for handling" << methodSignature;
return -1;
- eventType = eventEnum().keyToValue(methodSignature.toAscii());
+ eventType = eventEnum().keyToValue(methodSignature.toLatin1());
if (eventType < 0) {
qWarning() << Q_FUNC_INFO << "Could not find EventType" << methodSignature;
return -1;
if (eventType < 0) {
qWarning() << Q_FUNC_INFO << "Could not find EventType" << methodSignature;
return -1;
void IrcChannel::setCodecForEncoding(const QString &name)
{
void IrcChannel::setCodecForEncoding(const QString &name)
{
- setCodecForEncoding(QTextCodec::codecForName(name.toAscii()));
+ setCodecForEncoding(QTextCodec::codecForName(name.toLatin1()));
void IrcChannel::setCodecForDecoding(const QString &name)
{
void IrcChannel::setCodecForDecoding(const QString &name)
{
- setCodecForDecoding(QTextCodec::codecForName(name.toAscii()));
+ setCodecForDecoding(QTextCodec::codecForName(name.toLatin1()));
void IrcUser::setCodecForEncoding(const QString &name)
{
void IrcUser::setCodecForEncoding(const QString &name)
{
- setCodecForEncoding(QTextCodec::codecForName(name.toAscii()));
+ setCodecForEncoding(QTextCodec::codecForName(name.toLatin1()));
void IrcUser::setCodecForDecoding(const QString &name)
{
void IrcUser::setCodecForDecoding(const QString &name)
{
- setCodecForDecoding(QTextCodec::codecForName(name.toAscii()));
+ setCodecForDecoding(QTextCodec::codecForName(name.toLatin1()));
if (_defaultCodecForEncoding) {
return _defaultCodecForEncoding->fromUnicode(string);
}
if (_defaultCodecForEncoding) {
return _defaultCodecForEncoding->fromUnicode(string);
}
- return string.toAscii();
+ return string.toLatin1();
if (_defaultCodecForServer) {
return _defaultCodecForServer->fromUnicode(string);
}
if (_defaultCodecForServer) {
return _defaultCodecForServer->fromUnicode(string);
}
- return string.toAscii();
+ return string.toLatin1();
QVariant value(variantType, (const void *)0);
QGenericReturnArgument genericvalue = QGenericReturnArgument(method.typeName(), value.data());
QVariant value(variantType, (const void *)0);
QGenericReturnArgument genericvalue = QGenericReturnArgument(method.typeName(), value.data());
- QMetaObject::invokeMethod(this, methodname.toAscii(), genericvalue);
+ QMetaObject::invokeMethod(this, methodname.toLatin1(), genericvalue);
properties[SignalProxy::ExtendedMetaObject::methodBaseName(method)] = value;
}
properties[SignalProxy::ExtendedMetaObject::methodBaseName(method)] = value;
}
- int propertyIndex = meta->indexOfProperty(propName.toAscii());
+ int propertyIndex = meta->indexOfProperty(propName.toLatin1());
if (propertyIndex == -1 || !meta->property(propertyIndex).isWritable())
setInitValue(propName, iterator.value());
else
if (propertyIndex == -1 || !meta->property(propertyIndex).isWritable())
setInitValue(propName, iterator.value());
else
- setProperty(propName.toAscii(), iterator.value());
+ setProperty(propName.toLatin1(), iterator.value());
// qDebug() << "<<< SYNC:" << name << iterator.value();
iterator++;
}
// qDebug() << "<<< SYNC:" << name << iterator.value();
iterator++;
}
handlername[7] = handlername[7].toUpper();
QString methodSignature = QString("%1(%2)").arg(handlername).arg(value.typeName());
handlername[7] = handlername[7].toUpper();
QString methodSignature = QString("%1(%2)").arg(handlername).arg(value.typeName());
- int methodIdx = metaObject()->indexOfMethod(methodSignature.toAscii().constData());
+ int methodIdx = metaObject()->indexOfMethod(methodSignature.toLatin1().constData());
- QByteArray normedMethodName = QMetaObject::normalizedSignature(methodSignature.toAscii().constData());
+ QByteArray normedMethodName = QMetaObject::normalizedSignature(methodSignature.toLatin1().constData());
methodIdx = metaObject()->indexOfMethod(normedMethodName.constData());
}
if (methodIdx < 0) {
methodIdx = metaObject()->indexOfMethod(normedMethodName.constData());
}
if (methodIdx < 0) {
}
QGenericArgument param(value.typeName(), value.constData());
}
QGenericArgument param(value.typeName(), value.constData());
- return QMetaObject::invokeMethod(this, handlername.toAscii(), param);
+ return QMetaObject::invokeMethod(this, handlername.toLatin1(), param);
//qDebug() << "Detected utf8:" << s;
return s;
}
//qDebug() << "Detected utf8:" << s;
return s;
}
- //QTextCodec *codec = QTextCodec::codecForName(encoding.toAscii());
- if (!codec) return QString::fromAscii(input);
+ //QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1());
+ if (!codec) return QString::fromLatin1(input);
return codec->toUnicode(input);
}
return codec->toUnicode(input);
}
qWarning() << " bound Values:";
QList<QVariant> list = boundValues();
for (int i = 0; i < list.size(); ++i)
qWarning() << " bound Values:";
QList<QVariant> list = boundValues();
for (int i = 0; i < list.size(); ++i)
- qWarning() << i << ": " << list.at(i).toString().toAscii().data();
+ qWarning() << i << ": " << list.at(i).toString().toLatin1().data();
qWarning() << " Error Number:" << lastError().number();
qWarning() << " Error Message:" << lastError().text();
}
qWarning() << " Error Number:" << lastError().number();
qWarning() << " Error Message:" << lastError().text();
}
if (topic().isEmpty())
return;
if (topic().isEmpty())
return;
- QByteArray decrypted = cipher()->decryptTopic(topic().toAscii());
+ QByteArray decrypted = cipher()->decryptTopic(topic().toLatin1());
setTopic(decodeString(decrypted));
}
}
setTopic(decodeString(decrypted));
}
}
if (!prefix.isEmpty())
msg += ":" + prefix + " ";
if (!prefix.isEmpty())
msg += ":" + prefix + " ";
- msg += cmd.toUpper().toAscii();
+ msg += cmd.toUpper().toLatin1();
for (int i = 0; i < params.size(); i++) {
msg += " ";
for (int i = 0; i < params.size(); i++) {
msg += " ";
construct.append(net->saslAccount());
construct.append(QChar(QChar::Null));
construct.append(net->saslPassword());
construct.append(net->saslAccount());
construct.append(QChar(QChar::Null));
construct.append(net->saslPassword());
- QByteArray saslData = QByteArray(construct.toAscii().toBase64());
+ QByteArray saslData = QByteArray(construct.toLatin1().toBase64());
saslData.prepend("AUTHENTICATE ");
net->putRawLine(saslData);
#ifdef HAVE_SSL
saslData.prepend("AUTHENTICATE ");
net->putRawLine(saslData);
#ifdef HAVE_SSL
// that means that the last message can be as long as:
// 512 - nicklen - userlen - hostlen - commandlen - sum(param[0]..param[n-1])) - 2 (for CRLF) - 4 (":!@" + 1space between prefix and command) - max(paramcount - 1, 0) (space for simple params) - 2 (space and colon for last param)
IrcUser *me = network()->me();
// that means that the last message can be as long as:
// 512 - nicklen - userlen - hostlen - commandlen - sum(param[0]..param[n-1])) - 2 (for CRLF) - 4 (":!@" + 1space between prefix and command) - max(paramcount - 1, 0) (space for simple params) - 2 (space and colon for last param)
IrcUser *me = network()->me();
- int maxLen = 480 - cmd.toAscii().count(); // educated guess in case we don't know us (yet?)
+ int maxLen = 480 - cmd.toLatin1().count(); // educated guess in case we don't know us (yet?)
- maxLen = 512 - serverEncode(me->nick()).count() - serverEncode(me->user()).count() - serverEncode(me->host()).count() - cmd.toAscii().count() - 6;
+ maxLen = 512 - serverEncode(me->nick()).count() - serverEncode(me->user()).count() - serverEncode(me->host()).count() - cmd.toLatin1().count() - 6;
if (!params.isEmpty()) {
for (int i = 0; i < params.count() - 1; i++) {
if (!params.isEmpty()) {
for (int i = 0; i < params.count() - 1; i++) {
Q_UNUSED(localAddress) Q_UNUSED(peerAddress) Q_UNUSED(peerPort)
QString ident = identity->ident();
Q_UNUSED(localAddress) Q_UNUSED(peerAddress) Q_UNUSED(peerPort)
QString ident = identity->ident();
- _quasselConfig.append(_quasselStanzaTemplate.arg(localPort).arg(ident).arg(_configTag).toAscii());
+ _quasselConfig.append(_quasselStanzaTemplate.arg(localPort).arg(ident).arg(_configTag).toLatin1());
bool ret = writeConfig();
bool ret = writeConfig();
net.networkId = networksQuery.value(0).toInt();
net.networkName = networksQuery.value(1).toString();
net.identity = networksQuery.value(2).toInt();
net.networkId = networksQuery.value(0).toInt();
net.networkName = networksQuery.value(1).toString();
net.identity = networksQuery.value(2).toInt();
- net.codecForServer = networksQuery.value(3).toString().toAscii();
- net.codecForEncoding = networksQuery.value(4).toString().toAscii();
- net.codecForDecoding = networksQuery.value(5).toString().toAscii();
+ net.codecForServer = networksQuery.value(3).toString().toLatin1();
+ net.codecForEncoding = networksQuery.value(4).toString().toLatin1();
+ net.codecForDecoding = networksQuery.value(5).toString().toLatin1();
net.useRandomServer = networksQuery.value(6).toBool();
net.perform = networksQuery.value(7).toString().split("\n");
net.useAutoIdentify = networksQuery.value(8).toBool();
net.useRandomServer = networksQuery.value(6).toBool();
net.perform = networksQuery.value(7).toString().split("\n");
net.useAutoIdentify = networksQuery.value(8).toBool();
qCritical() << " bound Values:";
QList<QVariant> list = query.boundValues().values();
for (int i = 0; i < list.size(); ++i)
qCritical() << " bound Values:";
QList<QVariant> list = query.boundValues().values();
for (int i = 0; i < list.size(); ++i)
- qCritical() << i << ":" << list.at(i).toString().toAscii().data();
+ qCritical() << i << ":" << list.at(i).toString().toLatin1().data();
Q_ASSERT(false);
}
db.commit();
Q_ASSERT(false);
}
db.commit();
// qDebug() << " bound Values:";
// QList<QVariant> list = query.boundValues().values();
// for (int i = 0; i < list.size(); ++i)
// qDebug() << " bound Values:";
// QList<QVariant> list = query.boundValues().values();
// for (int i = 0; i < list.size(); ++i)
-// qCritical() << i << ": " << list.at(i).toString().toAscii().data();
+// qCritical() << i << ": " << list.at(i).toString().toLatin1().data();
net.networkId = networksQuery.value(0).toInt();
net.networkName = networksQuery.value(1).toString();
net.identity = networksQuery.value(2).toInt();
net.networkId = networksQuery.value(0).toInt();
net.networkName = networksQuery.value(1).toString();
net.identity = networksQuery.value(2).toInt();
- net.codecForServer = networksQuery.value(3).toString().toAscii();
- net.codecForEncoding = networksQuery.value(4).toString().toAscii();
- net.codecForDecoding = networksQuery.value(5).toString().toAscii();
+ net.codecForServer = networksQuery.value(3).toString().toLatin1();
+ net.codecForEncoding = networksQuery.value(4).toString().toLatin1();
+ net.codecForDecoding = networksQuery.value(5).toString().toLatin1();
net.useRandomServer = networksQuery.value(6).toInt() == 1 ? true : false;
net.perform = networksQuery.value(7).toString().split("\n");
net.useAutoIdentify = networksQuery.value(8).toInt() == 1 ? true : false;
net.useRandomServer = networksQuery.value(6).toInt() == 1 ? true : false;
net.perform = networksQuery.value(7).toString().split("\n");
net.useAutoIdentify = networksQuery.value(8).toInt() == 1 ? true : false;
qCritical() << " bound Values:";
QList<QVariant> list = query.boundValues().values();
for (int i = 0; i < list.size(); ++i)
qCritical() << " bound Values:";
QList<QVariant> list = query.boundValues().values();
for (int i = 0; i < list.size(); ++i)
- qCritical() << i << ":" << list.at(i).toString().toAscii().data();
+ qCritical() << i << ":" << list.at(i).toString().toLatin1().data();
if (chopCount < nick.size())
nick.chop(chopCount);
}
if (chopCount < nick.size())
nick.chop(chopCount);
}
- quint16 hash = qChecksum(nick.toAscii().data(), nick.toAscii().size());
+ quint16 hash = qChecksum(nick.toLatin1().data(), nick.toLatin1().size());
return (_senderHash = (hash & 0xf) + 1);
}
return (_senderHash = (hash & 0xf) + 1);
}