Skip to content

Commit

Permalink
Fix the usage of qFatal
Browse files Browse the repository at this point in the history
For Qt 6.2
  • Loading branch information
aalex committed Dec 11, 2024
1 parent 4447b84 commit b8ddf58
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Pico/BasicSourcePrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <Pico/LibossiaGenerator.hpp>
#include <Pico/SourcePrinter.hpp>

#include <QTextStream>

namespace Pico
{
static const std::string error_string = ":*:ERROR:*:";
Expand Down Expand Up @@ -65,8 +67,12 @@ QString BasicSourcePrinter::printTask(
}
else
{
qFatal() << "Process:" << p->metadata().getName() << typeid(*p).name()
<< " does not have a code writer";
QString fatalMessage;
QTextStream outputStream(&fatalMessage);
outputStream << "Process:" << p->metadata().getName() << typeid(*p).name()
<< " does not have a code writer";
outputStream.flush();
qFatal(qPrintable(fatalMessage));
}
}

Expand Down
8 changes: 7 additions & 1 deletion Pico/ESPSourcePrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <ossia/detail/fmt.hpp>

#include <Pico/SourcePrinter.hpp>
#include <QDebug>
#include <QTextStream>

namespace Pico
{
Expand Down Expand Up @@ -97,8 +99,12 @@ QString ESPSourcePrinter::printTask(
}
else
{
qFatal() << "Process:" << p->metadata().getName() << typeid(*p).name()
QString fatalMessage;
QTextStream outputStream(&fatalMessage);
outputStream << "Process:" << p->metadata().getName() << typeid(*p).name()
<< " does not have a code writer";
outputStream.flush();
qFatal(qPrintable(fatalMessage));
}
}

Expand Down

0 comments on commit b8ddf58

Please sign in to comment.