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
a583b833
Commit
a583b833
authored
Jun 21, 2021
by
Mufeed Ali
Committed by
Christoph Cullmann
Jul 01, 2021
Browse files
Rename wrongly named objects
parent
c9e9a011
Changes
4
Hide whitespace changes
Inline
Side-by-side
addons/sessionapplet/applet/contents/ui/katesessions.qml
View file @
a583b833
...
...
@@ -33,17 +33,17 @@ Item {
}
PlasmaCore.DataSource
{
id
:
clipboard
Source
id
:
sessions
Source
property
bool
editing
:
false
;
engine
:
"
org.kde.plasma.katesessions
"
connectedSources
:
"
katesessions
"
function
service
(
uuid
,
op
)
{
var
service
=
clipboard
Source
.
serviceForSource
(
uuid
);
var
service
=
sessions
Source
.
serviceForSource
(
uuid
);
var
operation
=
service
.
operationDescription
(
op
);
return
service
.
startOperationCall
(
operation
);
}
function
newSession
(
sessionName
)
{
var
service
=
clipboard
Source
.
serviceForSource
(
""
);
var
service
=
sessions
Source
.
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
:
{
clipboard
Menu
.
view
.
decrementCurrentIndex
();
sessions
Menu
.
view
.
decrementCurrentIndex
();
event
.
accepted
=
true
;
break
;
}
case
Qt
.
Key_Down
:
{
clipboard
Menu
.
view
.
incrementCurrentIndex
();
sessions
Menu
.
view
.
incrementCurrentIndex
();
event
.
accepted
=
true
;
break
;
}
case
Qt
.
Key_Enter
:
case
Qt
.
Key_Return
:
{
if
(
clipboard
Menu
.
view
.
currentIndex
>=
0
)
{
var
uuid
=
clipboard
Menu
.
model
.
get
(
clipboard
Menu
.
view
.
currentIndex
).
UuidRole
if
(
sessions
Menu
.
view
.
currentIndex
>=
0
)
{
var
uuid
=
sessions
Menu
.
model
.
get
(
sessions
Menu
.
view
.
currentIndex
).
UuidRole
if
(
uuid
)
{
clipboard
Source
.
service
(
uuid
,
"
invoke
"
)
clipboard
Menu
.
view
.
currentIndex
=
0
sessions
Source
.
service
(
uuid
,
"
invoke
"
)
sessions
Menu
.
view
.
currentIndex
=
0
}
}
break
;
...
...
@@ -106,7 +106,7 @@ Item {
return
;
}
if
(
event
.
text
!=
""
&&
!
filter
.
activeFocus
)
{
clipboard
Menu
.
view
.
currentIndex
=
-
1
sessions
Menu
.
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
:
clipboard
Menu
id
:
sessions
Menu
model
:
PlasmaCore.SortFilterModel
{
sourceModel
:
clipboard
Source
.
models
.
katesessions
sourceModel
:
sessions
Source
.
models
.
katesessions
filterRole
:
"
DisplayRole
"
filterRegExp
:
filter
.
text
}
Layout.fillWidth
:
true
Layout.fillHeight
:
true
onItemSelected
:
{
clipboard
Source
.
service
(
uuid
,
"
invoke
"
)
sessions
Source
.
service
(
uuid
,
"
invoke
"
)
plasmoid
.
expanded
=
false
;
}
onRemove
:
clipboard
Source
.
service
(
uuid
,
"
remove
"
)
onNewSession
:
clipboard
Source
.
newSession
(
sessionName
)
onRemove
:
sessions
Source
.
service
(
uuid
,
"
remove
"
)
onNewSession
:
sessions
Source
.
newSession
(
sessionName
)
}
//NewSessionDialog {
// id: newsessiondialog
...
...
addons/sessionapplet/katesessionsengine.cpp
View file @
a583b833
...
...
@@ -12,13 +12,13 @@ SPDX-License-Identifier: GPL-2.0-or-later
#include "katesessionsservice.h"
#include <QDebug>
static
const
QString
s_
clipboard
SourceName
=
QStringLiteral
(
"katesessions"
);
static
const
QString
s_
sessions
SourceName
=
QStringLiteral
(
"katesessions"
);
KateSessionsEngine
::
KateSessionsEngine
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
DataEngine
(
parent
,
args
)
{
setData
(
s_
clipboard
SourceName
,
QStringLiteral
(
"test_data"
),
QLatin1String
(
"This is just for testing"
));
setModel
(
s_
clipboard
SourceName
,
new
KateSessionsModel
(
this
));
setData
(
s_
sessions
SourceName
,
QStringLiteral
(
"test_data"
),
QLatin1String
(
"This is just for testing"
));
setModel
(
s_
sessions
SourceName
,
new
KateSessionsModel
(
this
));
}
KateSessionsEngine
::~
KateSessionsEngine
()
...
...
addons/sessionapplet/katesessionsjob.cpp
View file @
a583b833
...
...
@@ -15,7 +15,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
#include <QDebug>
#include <QUrl>
static
const
QString
s_
clipboard
SourceName
=
QStringLiteral
(
"katesessions"
);
static
const
QString
s_
sessions
SourceName
=
QStringLiteral
(
"katesessions"
);
KateSessionsJob
::
KateSessionsJob
(
KateSessionsEngine
*
engine
,
const
QString
&
destination
,
...
...
addons/sessionapplet/plasma-dataengine-katesessions.desktop
View file @
a583b833
...
...
@@ -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
...
...
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