Fix Clazy returning-data-from-temporary warnings
This commit is contained in:
parent
d484ec3ac8
commit
b732b58807
1 changed files with 10 additions and 10 deletions
|
|
@ -33,19 +33,19 @@ class GfeHttpResponseException : public std::exception
|
||||||
public:
|
public:
|
||||||
GfeHttpResponseException(int statusCode, QString message) :
|
GfeHttpResponseException(int statusCode, QString message) :
|
||||||
m_StatusCode(statusCode),
|
m_StatusCode(statusCode),
|
||||||
m_StatusMessage(message)
|
m_StatusMessage(message.toUtf8())
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* what() const throw()
|
const char* what() const throw()
|
||||||
{
|
{
|
||||||
return m_StatusMessage.toLatin1();
|
return m_StatusMessage.constData();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* getStatusMessage() const
|
const char* getStatusMessage() const
|
||||||
{
|
{
|
||||||
return m_StatusMessage.toLatin1();
|
return m_StatusMessage.constData();
|
||||||
}
|
}
|
||||||
|
|
||||||
int getStatusCode() const
|
int getStatusCode() const
|
||||||
|
|
@ -55,12 +55,12 @@ public:
|
||||||
|
|
||||||
QString toQString() const
|
QString toQString() const
|
||||||
{
|
{
|
||||||
return m_StatusMessage + " (Error " + QString::number(m_StatusCode) + ")";
|
return QString::fromUtf8(m_StatusMessage) + " (Error " + QString::number(m_StatusCode) + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_StatusCode;
|
int m_StatusCode;
|
||||||
QString m_StatusMessage;
|
QByteArray m_StatusMessage;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QtNetworkReplyException : public std::exception
|
class QtNetworkReplyException : public std::exception
|
||||||
|
|
@ -68,19 +68,19 @@ class QtNetworkReplyException : public std::exception
|
||||||
public:
|
public:
|
||||||
QtNetworkReplyException(QNetworkReply::NetworkError error, QString errorText) :
|
QtNetworkReplyException(QNetworkReply::NetworkError error, QString errorText) :
|
||||||
m_Error(error),
|
m_Error(error),
|
||||||
m_ErrorText(errorText)
|
m_ErrorText(errorText.toUtf8())
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* what() const throw()
|
const char* what() const throw()
|
||||||
{
|
{
|
||||||
return m_ErrorText.toLatin1();
|
return m_ErrorText.constData();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* getErrorText() const
|
const char* getErrorText() const
|
||||||
{
|
{
|
||||||
return m_ErrorText.toLatin1();
|
return m_ErrorText.constData();
|
||||||
}
|
}
|
||||||
|
|
||||||
QNetworkReply::NetworkError getError() const
|
QNetworkReply::NetworkError getError() const
|
||||||
|
|
@ -90,12 +90,12 @@ public:
|
||||||
|
|
||||||
QString toQString() const
|
QString toQString() const
|
||||||
{
|
{
|
||||||
return m_ErrorText + " (Error " + QString::number(m_Error) + ")";
|
return QString::fromUtf8(m_ErrorText) + " (Error " + QString::number(m_Error) + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkReply::NetworkError m_Error;
|
QNetworkReply::NetworkError m_Error;
|
||||||
QString m_ErrorText;
|
QByteArray m_ErrorText;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NvHTTP : public QObject
|
class NvHTTP : public QObject
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue