summaryrefslogtreecommitdiffstats
path: root/src/core/services/qsysteminformationservice.cpp
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2019-12-12 13:53:57 +0000
committerMike Krus <mike.krus@kdab.com>2019-12-18 15:24:42 +0000
commit390982e5d62b76528ce345dfcac7325abc839935 (patch)
tree26615bb44fb304072bed6adb89c221a9d76befca /src/core/services/qsysteminformationservice.cpp
parent5aa183f8f50d9422cf6ed255b0a0c932508a7c04 (diff)
Expand System Information
Add methods to: - Reveal folder where trace files are saved in the file browser - Dump the output of commands to the console Change-Id: Iaad76b4db93dbf60df170aa53212a8f4df1b2283 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/services/qsysteminformationservice.cpp')
-rw-r--r--src/core/services/qsysteminformationservice.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/core/services/qsysteminformationservice.cpp b/src/core/services/qsysteminformationservice.cpp
index 564138b23..212038eea 100644
--- a/src/core/services/qsysteminformationservice.cpp
+++ b/src/core/services/qsysteminformationservice.cpp
@@ -48,10 +48,13 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
#include <QtCore/QDateTime>
-#include <QtCore/QCoreApplication>
+#include <QtCore/QUrl>
+#include <QtCore/QDir>
+#include <QtGui/QDesktopServices>
#include <Qt3DCore/QAspectEngine>
#include <Qt3DCore/QAbstractAspect>
+#include <Qt3DCore/private/qabstractaspect_p.h>
#include <Qt3DCore/private/qaspectengine_p.h>
#include <Qt3DCore/private/aspectcommanddebugger_p.h>
@@ -382,6 +385,11 @@ void QSystemInformationService::writePreviousFrameTraces()
d->writeFrameJobLogStats();
}
+void QSystemInformationService::revealLogFolder()
+{
+ QDesktopServices::openUrl(QUrl::fromLocalFile(QDir::currentPath()));
+}
+
QVariant QSystemInformationService::executeCommand(const QString &command)
{
Q_D(QSystemInformationService);
@@ -409,6 +417,22 @@ QVariant QSystemInformationService::executeCommand(const QString &command)
return d->m_aspectEngine->executeCommand(command);
}
+void QSystemInformationService::dumpCommand(const QString &command)
+{
+ QVariant res = executeCommand(command);
+ QObject *obj = res.value<QObject *>();
+ if (obj) {
+ auto reply = qobject_cast<Qt3DCore::Debug::AsynchronousCommandReply*>(obj);
+ if (reply) {
+ connect(reply, &Debug::AsynchronousCommandReply::finished, this, [reply]() {
+ qWarning() << qPrintable( QLatin1String(reply->data()) );
+ });
+ return;
+ }
+ }
+ qWarning() << res;
+}
+
}
QT_END_NAMESPACE