Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
9d2cfd12
Commit
9d2cfd12
authored
Nov 27, 2014
by
Martin Flöser
Browse files
pasteclient: read selection in thread
parent
b016765f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/wayland/tests/CMakeLists.txt
View file @
9d2cfd12
...
...
@@ -21,6 +21,9 @@ add_executable(copyClient copyclient.cpp)
target_link_libraries
(
copyClient KF5::WaylandClient
)
ecm_mark_as_test
(
copyClient
)
add_executable
(
pasteClient pasteclient.cpp
)
target_link_libraries
(
pasteClient KF5::WaylandClient
)
ecm_mark_as_test
(
pasteClient
)
find_package
(
Qt5Concurrent
${
QT_MIN_VERSION
}
CONFIG QUIET
)
if
(
Qt5Concurrent_FOUND
)
add_executable
(
pasteClient pasteclient.cpp
)
target_link_libraries
(
pasteClient Qt5::Concurrent KF5::WaylandClient
)
ecm_mark_as_test
(
pasteClient
)
endif
()
\ No newline at end of file
src/wayland/tests/pasteclient.cpp
View file @
9d2cfd12
...
...
@@ -37,6 +37,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
#include
<QImage>
#include
<QMimeType>
#include
<QThread>
#include
<QtConcurrent>
// system
#include
<unistd.h>
...
...
@@ -161,12 +162,16 @@ void PasteClient::setupRegistry(Registry *registry)
}
dataOffer
->
receive
((
*
it
).
name
(),
pipeFds
[
1
]);
close
(
pipeFds
[
1
]);
QFile
readPipe
;
if
(
readPipe
.
open
(
pipeFds
[
0
],
QIODevice
::
ReadOnly
))
{
qDebug
()
<<
"Pasted: "
<<
readPipe
.
readLine
();
}
close
(
pipeFds
[
0
]);
QCoreApplication
::
quit
();
QtConcurrent
::
run
(
[
pipeFds
]
{
QFile
readPipe
;
if
(
readPipe
.
open
(
pipeFds
[
0
],
QIODevice
::
ReadOnly
))
{
qDebug
()
<<
"Pasted: "
<<
readPipe
.
readLine
();
}
close
(
pipeFds
[
0
]);
QCoreApplication
::
quit
();
}
);
}
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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