1 | /* |
---|---|
2 | SPDX-FileCopyrightText: 2017 Dominik Haumann <dhaumann@kde.org> |
3 | |
4 | SPDX-License-Identifier: LGPL-2.0-or-later |
5 | */ |
6 | |
7 | #include "katescripteditor.h" |
8 | |
9 | #include "kateglobal.h" |
10 | |
11 | #include <QApplication> |
12 | #include <QClipboard> |
13 | #include <QJSEngine> |
14 | |
15 | QString KateScriptEditor::clipboardText() const |
16 | { |
17 | return QApplication::clipboard()->text(); |
18 | } |
19 | |
20 | QStringList KateScriptEditor::clipboardHistory() const |
21 | { |
22 | const auto clipboardHistory = KTextEditor::EditorPrivate::self()->clipboardHistory(); |
23 | |
24 | QStringList res; |
25 | for (const auto &entry : clipboardHistory) { |
26 | res << entry.text; |
27 | } |
28 | |
29 | return res; |
30 | } |
31 | |
32 | void KateScriptEditor::setClipboardText(const QString &text) |
33 | { |
34 | KTextEditor::EditorPrivate::self()->copyToClipboard(text, fileName: QString()); |
35 | } |
36 | |
37 | #include "moc_katescripteditor.cpp" |
38 |