summaryrefslogtreecommitdiffstats
path: root/api/logic/launch/LaunchTask.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-08-08 00:00:11 +0200
committerPetr Mrázek <peterix@gmail.com>2016-08-10 00:28:33 +0200
commitfc198dd3085a2cd33fbaa7a3d2c95c2c8d3ee31a (patch)
tree26d0c907fcfdbf93da37d19f731962609c65464f /api/logic/launch/LaunchTask.cpp
parent74b4343c43cb0f3fc85cf27d1159349d0b3f32e6 (diff)
downloadMultiMC-fc198dd3085a2cd33fbaa7a3d2c95c2c8d3ee31a.tar
MultiMC-fc198dd3085a2cd33fbaa7a3d2c95c2c8d3ee31a.tar.gz
MultiMC-fc198dd3085a2cd33fbaa7a3d2c95c2c8d3ee31a.tar.lz
MultiMC-fc198dd3085a2cd33fbaa7a3d2c95c2c8d3ee31a.tar.xz
MultiMC-fc198dd3085a2cd33fbaa7a3d2c95c2c8d3ee31a.zip
NOISSUE rework of minecraft log
Now uses a model and a list view instead of text This lets mmc keep track of the contents regardless of whether the instance windows are open This is currently missing a way to select and copy text from the log.
Diffstat (limited to 'api/logic/launch/LaunchTask.cpp')
-rw-r--r--api/logic/launch/LaunchTask.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/api/logic/launch/LaunchTask.cpp b/api/logic/launch/LaunchTask.cpp
index 5b7ff182..9c09caf4 100644
--- a/api/logic/launch/LaunchTask.cpp
+++ b/api/logic/launch/LaunchTask.cpp
@@ -167,6 +167,15 @@ bool LaunchTask::abort()
return false;
}
+shared_qobject_ptr<LogModel> LaunchTask::getLogModel()
+{
+ if(!m_logModel)
+ {
+ m_logModel.reset(new LogModel());
+ }
+ return m_logModel;
+}
+
void LaunchTask::onLogLines(const QStringList &lines, MessageLevel::Enum defaultLevel)
{
for (auto & line: lines)
@@ -193,7 +202,8 @@ void LaunchTask::onLogLine(QString line, MessageLevel::Enum level)
// censor private user info
line = censorPrivateInfo(line);
- emit log(line, level);
+ auto &model = *getLogModel();
+ model.append(level, line);
}
void LaunchTask::emitSucceeded()