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
Plasma
KWayland Server
Commits
410c5968
Commit
410c5968
authored
Mar 22, 2021
by
Vlad Zahorodnii
Browse files
Simplify QHash lookups
QHash provides a convenience helper to lookup a value, use it. It makes the code simpler.
parent
3743f0cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server/xdgforeign_v2_interface.cpp
View file @
410c5968
...
...
@@ -52,11 +52,7 @@ XdgExporterV2Interface::XdgExporterV2Interface(Display *display, XdgForeignV2Int
XdgExportedV2Interface
*
XdgExporterV2Interface
::
exportedSurface
(
const
QString
&
handle
)
{
auto
it
=
m_exportedSurfaces
.
constFind
(
handle
);
if
(
it
!=
m_exportedSurfaces
.
constEnd
())
{
return
it
.
value
();
}
return
nullptr
;
return
m_exportedSurfaces
.
value
(
handle
);
}
void
XdgExporterV2Interface
::
zxdg_exporter_v2_destroy
(
Resource
*
resource
)
...
...
@@ -102,11 +98,7 @@ XdgImporterV2Interface::XdgImporterV2Interface(Display *display, XdgForeignV2Int
XdgImportedV2Interface
*
XdgImporterV2Interface
::
importedSurface
(
const
QString
&
handle
)
{
auto
it
=
m_importedSurfaces
.
constFind
(
handle
);
if
(
it
!=
m_importedSurfaces
.
constEnd
())
{
return
it
.
value
();
}
return
nullptr
;
return
m_importedSurfaces
.
value
(
handle
);
}
SurfaceInterface
*
XdgImporterV2Interface
::
transientFor
(
SurfaceInterface
*
surface
)
...
...
Write
Preview
Supports
Markdown
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