mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Cleanup: consistently use toUtf8() instead of toLocal8Bit()
These do the same, since the text-codex is set to UTF-8 on startup. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d1572a8d95
commit
2105d3c7d0
5 changed files with 8 additions and 8 deletions
|
@ -592,7 +592,7 @@ void GpsLocation::downloadFromServer()
|
||||||
timer.stop();
|
timer.stop();
|
||||||
if (!reply->error()) {
|
if (!reply->error()) {
|
||||||
QString response = reply->readAll();
|
QString response = reply->readAll();
|
||||||
QJsonDocument json = QJsonDocument::fromJson(response.toLocal8Bit());
|
QJsonDocument json = QJsonDocument::fromJson(response.toUtf8());
|
||||||
QJsonObject object = json.object();
|
QJsonObject object = json.object();
|
||||||
if (object.value("download").toString() != "ok") {
|
if (object.value("download").toString() != "ok") {
|
||||||
qDebug() << "problems downloading GPS fixes";
|
qDebug() << "problems downloading GPS fixes";
|
||||||
|
|
|
@ -326,7 +326,7 @@ void ColumnDropCSVView::mousePressEvent(QMouseEvent *press)
|
||||||
QDrag *drag = new QDrag(this);
|
QDrag *drag = new QDrag(this);
|
||||||
QMimeData *mimeData = new QMimeData;
|
QMimeData *mimeData = new QMimeData;
|
||||||
mimeData->setData(subsurface_mimedata, atClick.data().toByteArray());
|
mimeData->setData(subsurface_mimedata, atClick.data().toByteArray());
|
||||||
mimeData->setData(subsurface_index, QString::number(atClick.column()).toLocal8Bit());
|
mimeData->setData(subsurface_index, QString::number(atClick.column()).toUtf8());
|
||||||
drag->setPixmap(pix);
|
drag->setPixmap(pix);
|
||||||
drag->setMimeData(mimeData);
|
drag->setMimeData(mimeData);
|
||||||
if (drag->exec() != Qt::IgnoreAction){
|
if (drag->exec() != Qt::IgnoreAction){
|
||||||
|
|
|
@ -144,7 +144,7 @@ void FacebookManager::createFacebookAlbum()
|
||||||
QNetworkRequest request(albumListUrl());
|
QNetworkRequest request(albumListUrl());
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/octet-stream");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/octet-stream");
|
||||||
|
|
||||||
QNetworkReply *reply = manager->post(request, params.query().toLocal8Bit());
|
QNetworkReply *reply = manager->post(request, params.query().toUtf8());
|
||||||
connect(reply, &QNetworkReply::finished, this, &FacebookManager::facebookAlbumCreated);
|
connect(reply, &QNetworkReply::finished, this, &FacebookManager::facebookAlbumCreated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ void FacebookManager::sendDiveToAlbum(const QString& albumId)
|
||||||
QString bound="margin";
|
QString bound="margin";
|
||||||
|
|
||||||
//according to rfc 1867 we need to put this string here:
|
//according to rfc 1867 we need to put this string here:
|
||||||
QByteArray data(QString("--" + bound + "\r\n").toLocal8Bit());
|
QByteArray data(QString("--" + bound + "\r\n").toUtf8());
|
||||||
data.append("Content-Disposition: form-data; name=\"action\"\r\n\r\n");
|
data.append("Content-Disposition: form-data; name=\"action\"\r\n\r\n");
|
||||||
data.append(graphApi + "\r\n");
|
data.append(graphApi + "\r\n");
|
||||||
data.append("--" + bound + "\r\n"); //according to rfc 1867
|
data.append("--" + bound + "\r\n"); //according to rfc 1867
|
||||||
|
@ -273,8 +273,8 @@ void FacebookManager::sendDiveToAlbum(const QString& albumId)
|
||||||
data.append("\r\n");
|
data.append("\r\n");
|
||||||
data.append("--" + bound + "--\r\n"); //closing boundary according to rfc 1867
|
data.append("--" + bound + "--\r\n"); //closing boundary according to rfc 1867
|
||||||
|
|
||||||
request.setRawHeader(QByteArray("Content-Type"),QString("multipart/form-data; boundary=" + bound).toLocal8Bit());
|
request.setRawHeader(QByteArray("Content-Type"),QString("multipart/form-data; boundary=" + bound).toUtf8());
|
||||||
request.setRawHeader(QByteArray("Content-Length"), QString::number(data.length()).toLocal8Bit());
|
request.setRawHeader(QByteArray("Content-Length"), QString::number(data.length()).toUtf8());
|
||||||
QNetworkReply *reply = manager->post(request,data);
|
QNetworkReply *reply = manager->post(request,data);
|
||||||
|
|
||||||
connect(reply, &QNetworkReply::finished, this, &FacebookManager::uploadFinished);
|
connect(reply, &QNetworkReply::finished, this, &FacebookManager::uploadFinished);
|
||||||
|
|
|
@ -305,7 +305,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button)
|
||||||
memset(&gps_location_table, 0, sizeof(dive_table));
|
memset(&gps_location_table, 0, sizeof(dive_table));
|
||||||
(void)changed;
|
(void)changed;
|
||||||
clear_table(&gps_location_table);
|
clear_table(&gps_location_table);
|
||||||
QByteArray url = tr("Webservice").toLocal8Bit();
|
QByteArray url = tr("Webservice").toUtf8();
|
||||||
parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL);
|
parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL);
|
||||||
// make sure we mark all the dive sites that were created
|
// make sure we mark all the dive sites that were created
|
||||||
for (i = 0; i < gps_location_table.nr; i++) {
|
for (i = 0; i < gps_location_table.nr; i++) {
|
||||||
|
|
|
@ -224,7 +224,7 @@ exit:
|
||||||
void messageHandler(QtMsgType type, const QMessageLogContext &ctx, const QString &msg)
|
void messageHandler(QtMsgType type, const QMessageLogContext &ctx, const QString &msg)
|
||||||
{
|
{
|
||||||
Q_UNUSED(ctx);
|
Q_UNUSED(ctx);
|
||||||
QByteArray localMsg = msg.toLocal8Bit();
|
QByteArray localMsg = msg.toUtf8();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QtDebugMsg:
|
case QtDebugMsg:
|
||||||
fprintf(stdout, "%s\n", localMsg.constData());
|
fprintf(stdout, "%s\n", localMsg.constData());
|
||||||
|
|
Loading…
Reference in a new issue