forked from qt-creator/qt-creator
MessageManager: Remove old API for writing messages
In favor of the more evocative method names. Fixes: QTCREATORBUG-24430 Change-Id: Iec9bcd4436807bfbf10f8dfa24d09c132706fe62 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -100,7 +100,6 @@ MessageManager::MessageManager()
|
||||
{
|
||||
m_instance = this;
|
||||
m_messageOutputWindow = nullptr;
|
||||
qRegisterMetaType<MessageManager::PrintToOutputPaneFlags>();
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -215,51 +214,4 @@ void MessageManager::writeDisrupting(const QStringList &messages)
|
||||
writeDisrupting(messages.join('\n'));
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
static void showOutputPaneOld(Core::MessageManager::PrintToOutputPaneFlags flags)
|
||||
{
|
||||
QTC_ASSERT(m_messageOutputWindow, return);
|
||||
|
||||
if (flags & MessageManager::Flash) {
|
||||
m_messageOutputWindow->flash();
|
||||
} else if (flags & MessageManager::Silent) {
|
||||
// Do nothing
|
||||
} else {
|
||||
m_messageOutputWindow->popup(IOutputPane::Flag(int(flags)));
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
static void doWriteOld(const QString &text, MessageManager::PrintToOutputPaneFlags flags)
|
||||
{
|
||||
QTC_ASSERT(m_messageOutputWindow, return);
|
||||
|
||||
showOutputPaneOld(flags);
|
||||
m_messageOutputWindow->append(text + '\n');
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
void MessageManager::write(const QString &text, PrintToOutputPaneFlags flags)
|
||||
{
|
||||
if (QThread::currentThread() == instance()->thread())
|
||||
doWriteOld(text, flags);
|
||||
else
|
||||
QTimer::singleShot(0, instance(), [text, flags] { doWriteOld(text, flags); });
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
void MessageManager::writeWithTime(const QString &text, PrintToOutputPaneFlags flags)
|
||||
{
|
||||
const QString timeStamp = QTime::currentTime().toString("HH:mm:ss ");
|
||||
write(timeStamp + text, flags);
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
||||
@@ -46,17 +46,6 @@ class CORE_EXPORT MessageManager : public QObject
|
||||
public:
|
||||
static MessageManager *instance();
|
||||
|
||||
enum PrintToOutputPaneFlag {
|
||||
NoModeSwitch = IOutputPane::NoModeSwitch,
|
||||
ModeSwitch = IOutputPane::ModeSwitch,
|
||||
WithFocus = IOutputPane::WithFocus,
|
||||
EnsureSizeHint = IOutputPane::EnsureSizeHint,
|
||||
Silent = 256,
|
||||
Flash = 512
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS(PrintToOutputPaneFlags, PrintToOutputPaneFlag)
|
||||
|
||||
static void setFont(const QFont &font);
|
||||
static void setWheelZoomEnabled(bool enabled);
|
||||
|
||||
@@ -68,9 +57,6 @@ public:
|
||||
static void writeFlashing(const QStringList &messages);
|
||||
static void writeDisrupting(const QStringList &messages);
|
||||
|
||||
static void write(const QString &text, PrintToOutputPaneFlags flags = NoModeSwitch);
|
||||
static void writeWithTime(const QString &text, PrintToOutputPaneFlags flags = NoModeSwitch);
|
||||
|
||||
private:
|
||||
MessageManager();
|
||||
~MessageManager() override;
|
||||
@@ -80,5 +66,3 @@ private:
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
Q_DECLARE_METATYPE(Core::MessageManager::PrintToOutputPaneFlags)
|
||||
|
||||
Reference in New Issue
Block a user