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

Remove anon session option in sessions applet

parent 2daa151d
......@@ -38,31 +38,26 @@ Item {
property bool editing: false;
engine: "org.kde.plasma.katesessions"
connectedSources: "katesessions"
function service(uuid, op) {
var service = sessionsSource.serviceForSource(uuid);
function serviceAction(uuid, op) {
const service = sessionsSource.serviceForSource(uuid);
var operation = service.operationDescription(op);
return service.startOperationCall(operation);
}
function newSession(sessionName) {
var service = sessionsSource.serviceForSource("");
const service = sessionsSource.serviceForSource("");
var operation = service.operationDescription("newSession");
operation.sessionName=sessionName;
operation.sessionName = sessionName;
return service.startOperationCall(operation);
}
}
property var searchHeader: PlasmaExtras.PlasmoidHeading {
RowLayout {
PlasmaComponents3.TextField {
id: filter
placeholderText: i18n("Search…")
clearButtonShown: true
anchors.fill: parent
enabled: true
PlasmaComponents3.TextField {
id: filter
placeholderText: i18n("Search…")
clearButtonShown: true
Layout.fillWidth: true
}
}
}
......@@ -99,9 +94,9 @@ Item {
case Qt.Key_Enter:
case Qt.Key_Return: {
if (sessionsMenu.view.currentIndex >= 0) {
var uuid = sessionsMenu.model.get(sessionsMenu.view.currentIndex).UuidRole
const uuid = sessionsMenu.model.get(sessionsMenu.view.currentIndex).UuidRole
if (uuid) {
sessionsSource.service(uuid, "invoke")
sessionsSource.serviceAction(uuid, "invoke")
sessionsMenu.view.currentIndex = 0
}
}
......@@ -148,10 +143,10 @@ Item {
Layout.fillHeight: true
Layout.topMargin: PlasmaCore.Units.smallSpacing
onItemSelected: {
sessionsSource.service(uuid, "invoke")
sessionsSource.serviceAction(uuid, "invoke")
plasmoid.expanded = false;
}
onRemove: sessionsSource.service(uuid, "remove")
onRemove: sessionsSource.serviceAction(uuid, "remove")
onNewSession: sessionsSource.newSession(sessionName)
}
}
......
......@@ -52,11 +52,8 @@ void KateSessionsJob::start()
QStringList args;
if (dest == QLatin1String("_kate_noargs")) {
// do nothing
} else if (dest == QLatin1String("_kate_anon_newsession")) {
args << QStringLiteral("--startanon");
} else if (dest == QLatin1String("_kate_newsession")) {
args << QStringLiteral("--startanon");
qDebug() << "This should not be reached";
} else {
dest.chop(12); // .katesession
args << QStringLiteral("-n") << QStringLiteral("--start") << QUrl::fromPercentEncoding(dest.toLatin1());
......
......@@ -80,14 +80,6 @@ void KateSessionsModel::initSessionFiles()
m_fullList << item->data(Qt::DisplayRole).toString();
appendRow(item);
item = new QStandardItem();
item->setData(i18n("New Anonymous Session"), Qt::DisplayRole);
item->setData(QStringLiteral("_kate_anon_newsession"), Uuid);
item->setData(0, TypeRole);
item->setData(QIcon::fromTheme(QStringLiteral("document-new")), Qt::DecorationRole);
m_fullList << item->data(Qt::DisplayRole).toString();
appendRow(item);
QDir dir(m_sessionsDir, QStringLiteral("*.katesession"));
for (unsigned int i = 0; i < dir.count(); ++i) {
......
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