Skip to content

Commit

Permalink
Fix Exception::what()
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Mar 2, 2019
1 parent 3b84768 commit cd99525
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/utils/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
#define _EXCEPTION_H_

#include <QException>
#include <QByteArray>
#include <QString>

namespace Utils {

class Exception : public QException {
private:
QString what_;
QByteArray what_;
public:
explicit Exception(const QString& what);

Expand Down
4 changes: 2 additions & 2 deletions src/utils/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace Utils {

Exception::Exception(const QString& what): what_(what) {
Exception::Exception(const QString& what): what_(what.toLatin1()) {
}

void Exception::raise() const {
Expand All @@ -32,7 +32,7 @@ QException* Exception::clone() const {
}

const char* Exception::what() const noexcept {
return what_.toLatin1().constData();
return what_.constData();
}

} //Utils

0 comments on commit cd99525

Please sign in to comment.