Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
1cea8a67
Commit
1cea8a67
authored
Jun 22, 2021
by
Mufeed Ali
Committed by
Christoph Cullmann
Jul 01, 2021
Browse files
Remove anon session option in sessions applet
parent
2daa151d
Changes
3
Hide whitespace changes
Inline
Side-by-side
addons/sessionapplet/applet/contents/ui/katesessions.qml
View file @
1cea8a67
...
...
@@ -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
service
Action
(
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
.
service
Action
(
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
.
service
Action
(
uuid
,
"
invoke
"
)
plasmoid
.
expanded
=
false
;
}
onRemove
:
sessionsSource
.
service
(
uuid
,
"
remove
"
)
onRemove
:
sessionsSource
.
service
Action
(
uuid
,
"
remove
"
)
onNewSession
:
sessionsSource
.
newSession
(
sessionName
)
}
}
...
...
addons/sessionapplet/katesessionsjob.cpp
View file @
1cea8a67
...
...
@@ -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
());
...
...
addons/sessionapplet/katesessionsmodel.cpp
View file @
1cea8a67
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment