aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Saraiva <[email protected]>2015-09-18 14:20:11 -0300
committerFilipe Saraiva <[email protected]>2015-09-18 15:27:06 -0300
commit0765bc8b3589fd1b2b23ddd40220dd847d7e22a5 (patch)
tree23a613961bff0280e4351dba52866ba3541fb71e
parent3480a3692745c7cd7db64bd74c92b72507778d4b (diff)
Port QString::(from|to)Ascii to QString::(from|to)Latin1
QString::(from|to)Ascii deprecated in Qt5.
-rw-r--r--src/backends/python/pythonutils.h2
-rw-r--r--src/backends/python3/python3server/main.cpp2
-rw-r--r--src/backends/python3/python3session.cpp14
-rw-r--r--src/backends/qalculate/qalculatehighlighter.cpp2
4 files changed, 10 insertions, 10 deletions
diff --git a/src/backends/python/pythonutils.h b/src/backends/python/pythonutils.h
index 2874344..89b965f 100644
--- a/src/backends/python/pythonutils.h
+++ b/src/backends/python/pythonutils.h
@@ -27,7 +27,7 @@ inline QString fromSource(const QString& resourceName)
{
QFile text(resourceName);
text.open(QIODevice::ReadOnly);
- return QString::fromAscii(text.readAll());
+ return QString::fromLatin1(text.readAll());
}
#endif
diff --git a/src/backends/python3/python3server/main.cpp b/src/backends/python3/python3server/main.cpp
index 8fca868..9f4bf68 100644
--- a/src/backends/python3/python3server/main.cpp
+++ b/src/backends/python3/python3server/main.cpp
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
}
Python3Server server;
- QDBusConnection::sessionBus().registerObject(QString::fromAscii("/"), &server, QDBusConnection::ExportAllSlots);
+ QDBusConnection::sessionBus().registerObject(QString::fromLatin1("/"), &server, QDBusConnection::ExportAllSlots);
QTextStream(stdout) << "ready" << endl;
diff --git a/src/backends/python3/python3session.cpp b/src/backends/python3/python3session.cpp
index ca5127b..12e5f10 100644
--- a/src/backends/python3/python3session.cpp
+++ b/src/backends/python3/python3session.cpp
@@ -52,7 +52,7 @@ void Python3Session::login()
m_pProcess->waitForReadyRead();
QTextStream stream(m_pProcess->readAllStandardOutput());
- const QString& readyStatus = QString::fromAscii("ready");
+ const QString& readyStatus = QString::fromLatin1("ready");
while (m_pProcess->state() == QProcess::Running)
{
const QString& rl = stream.readLine();
@@ -70,14 +70,14 @@ void Python3Session::login()
const QString& serviceName = QString::fromLatin1("org.kde.Cantor.Python3-%1").arg(m_pProcess->pid());
m_pIface = new QDBusInterface(serviceName,
- QString::fromAscii("/"), QString(), QDBusConnection::sessionBus());
+ QString::fromLatin1("/"), QString(), QDBusConnection::sessionBus());
if (!m_pIface->isValid())
{
qWarning() << QDBusConnection::sessionBus().lastError().message();
return;
}
- m_pIface->call(QString::fromAscii("login"));
+ m_pIface->call(QString::fromLatin1("login"));
PythonSession::login();
}
@@ -98,12 +98,12 @@ void Python3Session::interrupt()
void Python3Session::runPythonCommand(const QString& command) const
{
- m_pIface->call(QString::fromAscii("runPythonCommand"), command);
+ m_pIface->call(QString::fromLatin1("runPythonCommand"), command);
}
void Python3Session::runPythonCommandAsync(const QString& command)
{
- m_pIface->callWithCallback(QString::fromAscii("runPythonCommand"), {command},
+ m_pIface->callWithCallback(QString::fromLatin1("runPythonCommand"), {command},
(Python3Session*)this,
SLOT(onResultReady()));
}
@@ -125,7 +125,7 @@ void Python3Session::onResultReady()
QString Python3Session::getOutput() const
{
- const QDBusReply<QString>& reply = m_pIface->call(QString::fromAscii("getOutput"));
+ const QDBusReply<QString>& reply = m_pIface->call(QString::fromLatin1("getOutput"));
if (reply.isValid())
return reply.value();
@@ -134,7 +134,7 @@ QString Python3Session::getOutput() const
QString Python3Session::getError() const
{
- const QDBusReply<QString>& reply = m_pIface->call(QString::fromAscii("getError"));
+ const QDBusReply<QString>& reply = m_pIface->call(QString::fromLatin1("getError"));
if (reply.isValid())
return reply.value();
diff --git a/src/backends/qalculate/qalculatehighlighter.cpp b/src/backends/qalculate/qalculatehighlighter.cpp
index 12d448a..90b218e 100644
--- a/src/backends/qalculate/qalculatehighlighter.cpp
+++ b/src/backends/qalculate/qalculatehighlighter.cpp
@@ -102,7 +102,7 @@ void QalculateHighlighter::highlightBlock(const QString& text)
format = numberFormat();
}
} else {
- MathStructure expr = CALCULATOR->parse(words[i].toAscii().constData());
+ MathStructure expr = CALCULATOR->parse(words[i].toLatin1().constData());
if ( expr.isNumber() || expr.isNumber_exp() ) {
qDebug() << "number";
format = numberFormat();