Commit a583b833 authored by Mufeed Ali's avatar Mufeed Ali Committed by Christoph Cullmann
Browse files

Rename wrongly named objects

parent c9e9a011
......@@ -33,17 +33,17 @@ Item {
}
PlasmaCore.DataSource {
id: clipboardSource
id: sessionsSource
property bool editing: false;
engine: "org.kde.plasma.katesessions"
connectedSources: "katesessions"
function service(uuid, op) {
var service = clipboardSource.serviceForSource(uuid);
var service = sessionsSource.serviceForSource(uuid);
var operation = service.operationDescription(op);
return service.startOperationCall(operation);
}
function newSession(sessionName) {
var service = clipboardSource.serviceForSource("");
var service = sessionsSource.serviceForSource("");
var operation = service.operationDescription("newSession");
operation.sessionName=sessionName;
return service.startOperationCall(operation);
......@@ -71,22 +71,22 @@ Item {
Keys.onPressed: {
switch(event.key) {
case Qt.Key_Up: {
clipboardMenu.view.decrementCurrentIndex();
sessionsMenu.view.decrementCurrentIndex();
event.accepted = true;
break;
}
case Qt.Key_Down: {
clipboardMenu.view.incrementCurrentIndex();
sessionsMenu.view.incrementCurrentIndex();
event.accepted = true;
break;
}
case Qt.Key_Enter:
case Qt.Key_Return: {
if (clipboardMenu.view.currentIndex >= 0) {
var uuid = clipboardMenu.model.get(clipboardMenu.view.currentIndex).UuidRole
if (sessionsMenu.view.currentIndex >= 0) {
var uuid = sessionsMenu.model.get(sessionsMenu.view.currentIndex).UuidRole
if (uuid) {
clipboardSource.service(uuid, "invoke")
clipboardMenu.view.currentIndex = 0
sessionsSource.service(uuid, "invoke")
sessionsMenu.view.currentIndex = 0
}
}
break;
......@@ -106,7 +106,7 @@ Item {
return;
}
if (event.text != "" && !filter.activeFocus) {
clipboardMenu.view.currentIndex = -1
sessionsMenu.view.currentIndex = -1
if (event.text == "v" && event.modifiers & Qt.ControlModifier) {
filter.paste();
} else {
......@@ -121,34 +121,21 @@ Item {
}
ColumnLayout {
anchors.fill: parent
RowLayout {
Layout.fillWidth: true
Item {
width: units.gridUnit / 2 - parent.spacing
height: 1
}
PlasmaComponents.TextField {
id: filter
placeholderText: i18n("Search")
clearButtonShown: true
Layout.fillWidth: true
}
}
Menu {
id: clipboardMenu
id: sessionsMenu
model: PlasmaCore.SortFilterModel {
sourceModel: clipboardSource.models.katesessions
sourceModel: sessionsSource.models.katesessions
filterRole: "DisplayRole"
filterRegExp: filter.text
}
Layout.fillWidth: true
Layout.fillHeight: true
onItemSelected: {
clipboardSource.service(uuid, "invoke")
sessionsSource.service(uuid, "invoke")
plasmoid.expanded = false;
}
onRemove: clipboardSource.service(uuid, "remove")
onNewSession:clipboardSource.newSession(sessionName)
onRemove: sessionsSource.service(uuid, "remove")
onNewSession: sessionsSource.newSession(sessionName)
}
//NewSessionDialog {
// id: newsessiondialog
......
......@@ -12,13 +12,13 @@ SPDX-License-Identifier: GPL-2.0-or-later
#include "katesessionsservice.h"
#include <QDebug>
static const QString s_clipboardSourceName = QStringLiteral("katesessions");
static const QString s_sessionsSourceName = QStringLiteral("katesessions");
KateSessionsEngine::KateSessionsEngine(QObject *parent, const QVariantList &args)
: Plasma::DataEngine(parent, args)
{
setData(s_clipboardSourceName, QStringLiteral("test_data"), QLatin1String("This is just for testing"));
setModel(s_clipboardSourceName, new KateSessionsModel(this));
setData(s_sessionsSourceName, QStringLiteral("test_data"), QLatin1String("This is just for testing"));
setModel(s_sessionsSourceName, new KateSessionsModel(this));
}
KateSessionsEngine::~KateSessionsEngine()
......
......@@ -15,7 +15,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
#include <QDebug>
#include <QUrl>
static const QString s_clipboardSourceName = QStringLiteral("katesessions");
static const QString s_sessionsSourceName = QStringLiteral("katesessions");
KateSessionsJob::KateSessionsJob(KateSessionsEngine *engine,
const QString &destination,
......
......@@ -109,7 +109,7 @@ Type=Service
Icon=kate
X-KDE-ServiceTypes=Plasma/DataEngine
X-KDE-Library=plasma_engine_clipboard
X-KDE-Library=plasma_engine_katesessions
X-KDE-PluginInfo-Author=Joseph Wenninger
......
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