Skip to content

Commit

Permalink
Emit Messages not strings. Refs #6202
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Apr 15, 2013
1 parent a58a33f commit ed80b40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ namespace MantidQt
{
namespace API
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
class Message;

/**
Provides a translation layer that takes a Poco::Message and converts it
to a Qt signal.
Expand Down Expand Up @@ -53,7 +58,7 @@ namespace MantidQt

signals:
// Emitted when a Poco log message is received in this channel
void messageReceived(const QString & msg);
void messageReceived(const Message & msg);

private:
Q_DISABLE_COPY(QtSignalChannel);
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidQt/API/src/MessageDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace MantidQt
Poco::Logger::setChannel(rootLogger.name(), m_logChannel);
}

connect(m_logChannel, SIGNAL(messageReceived(const QString&)),
connect(m_logChannel, SIGNAL(messageReceived(const API::Message&)),
this, SLOT(append(const QString &)));
}

Expand Down
5 changes: 2 additions & 3 deletions Code/Mantid/MantidQt/API/src/QtSignalChannel.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#include "MantidQtAPI/QtSignalChannel.h"
#include "MantidQtAPI/Message.h"
#include "MantidKernel/Logger.h"

#include <Poco/Message.h>

#include <sstream>

namespace MantidQt
{
namespace API
Expand All @@ -29,7 +28,7 @@ namespace MantidQt
*/
void QtSignalChannel::log(const Poco::Message& msg)
{
emit messageReceived(QString::fromStdString(msg.getText()));
emit messageReceived(API::Message(QString::fromStdString(msg.getText()), msg.getPriority()));
}

/*
Expand Down

0 comments on commit ed80b40

Please sign in to comment.