Commit 26158e29 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

mobile console: Implement replacing input with what we clicked

parent 8d14ad73
......@@ -115,6 +115,10 @@ Kirigami.ScrollablePage {
delegate: Kirigami.Card {
contentItem: QQC2.Label {
text: model.result
onLinkActivated: {
input.remove(input.selectionStart, input.selectionEnd)
input.insert(input.cursorPosition, consoleModel.readContent(link))
}
}
actions: [
......
......@@ -24,6 +24,7 @@
#include <KLocalizedString>
#include <QGuiApplication>
#include <QPalette>
#include <QUrlQuery>
Q_GLOBAL_STATIC_WITH_ARGS(QByteArray, s_css, (
"<style type=\"text/css\">\n"
......@@ -179,3 +180,8 @@ QByteArray ConsoleModel::css() const
{
return *s_css;
}
QString ConsoleModel::readContent(const QUrl &url)
{
return QUrlQuery(url).queryItemValue("func");
}
......@@ -46,6 +46,8 @@ public:
Q_SCRIPTABLE void clear();
Q_SCRIPTABLE bool saveLog(const QUrl& path) const;
Q_SCRIPTABLE static QString readContent(const QUrl &url);
QByteArray css() const;
ConsoleMode mode() const { return m_mode; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment