Mantid
Loading...
Searching...
No Matches
Message.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7//-------------------------------------------
8// Includes
9//-------------------------------------------
10#include <utility>
11
13
15//-----------------------------------------------------------------------------------
16// Public member functions
17//-----------------------------------------------------------------------------------
22Message::Message() : QObject(), m_text(), m_priority(Priority::PRIO_NOTICE), m_scriptPath("") {}
23
30Message::Message(QString text, Priority priority, const QString &scriptPath)
31 : QObject(), m_text(std::move(text)), m_priority(priority), m_scriptPath(scriptPath) {}
32
39Message::Message(const std::string &text, Priority priority, const QString &scriptPath)
40 : QObject(), m_text(QString::fromStdString(text)), m_priority(priority), m_scriptPath(scriptPath) {}
41
48Message::Message(const char *text, Priority priority, const QString &scriptPath)
49 : QObject(), m_text(text), m_priority(priority), m_scriptPath(scriptPath) {}
50
55 : QObject(), m_text(msg.text()), m_priority(msg.priority()), m_scriptPath(msg.scriptPath()) {}
56
61 m_text = msg.text();
62 m_priority = msg.priority();
64 return *this;
65}
66} // namespace MantidQt::MantidWidgets
Provides a simple binding of a text message with a priority.
Definition: Message.h:28
Mantid::Kernel::Logger::Priority Priority
Priority matches Mantid Logger priority.
Definition: Message.h:33
Priority priority() const
Definition: Message.h:54
Message()
Default constuctor required by Qt meta-type system.
Definition: Message.cpp:22
QString scriptPath() const
Definition: Message.h:56
Message & operator=(const Message &msg)
Copy assignment.
Definition: Message.cpp:60
STL namespace.