Enable QT_NO_CAST_FROM_ASCII & QT_NO_CAST_TO_ASCII

* Added a couple of utility macros to help with the conversion. lit() is
  paired with tr() for untranslated text.
* QFormatStr is more explicitly for non-textual formatting strings.
* Both are just #define'd to QStringLiteral()
This commit is contained in:
baldurk
2017-05-02 16:20:37 +01:00
parent 474ba91d8b
commit 0ecc6ca877
50 changed files with 2076 additions and 1921 deletions
+7 -7
View File
@@ -36,10 +36,10 @@ RemoteHost::RemoteHost()
RemoteHost::RemoteHost(const QVariant &var)
{
QVariantMap map = var.toMap();
if(map.contains("Hostname"))
Hostname = map["Hostname"].toString();
if(map.contains("RunCommand"))
RunCommand = map["RunCommand"].toString();
if(map.contains(lit("Hostname")))
Hostname = map[lit("Hostname")].toString();
if(map.contains(lit("RunCommand")))
RunCommand = map[lit("RunCommand")].toString();
ServerRunning = Connected = Busy = VersionMismatch = false;
}
@@ -47,15 +47,15 @@ RemoteHost::RemoteHost(const QVariant &var)
RemoteHost::operator QVariant() const
{
QVariantMap map;
map["Hostname"] = Hostname;
map["RunCommand"] = RunCommand;
map[lit("Hostname")] = Hostname;
map[lit("RunCommand")] = RunCommand;
return map;
}
void RemoteHost::CheckStatus()
{
// special case - this is the local context
if(Hostname == "localhost")
if(Hostname == lit("localhost"))
{
ServerRunning = false;
VersionMismatch = Busy = false;