Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Weixuan Xiao
kdeconnect-kde
Commits
87513455
Commit
87513455
authored
Jul 23, 2013
by
Albert Vaca Cintora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some bugs fixed and sockets keepalive enabled
parent
30b920b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
daemon/announcers/avahitcpannouncer.cpp
daemon/announcers/avahitcpannouncer.cpp
+2
-1
daemon/networkpackage.cpp
daemon/networkpackage.cpp
+5
-4
daemon/packageinterfaces/clipboardpackageinterface.cpp
daemon/packageinterfaces/clipboardpackageinterface.cpp
+1
-2
No files found.
daemon/announcers/avahitcpannouncer.cpp
View file @
87513455
...
...
@@ -34,7 +34,7 @@ AvahiTcpAnnouncer::AvahiTcpAnnouncer()
service
=
new
DNSSD
::
PublicService
(
QHostInfo
::
localHostName
(),
serviceType
,
port
);
mServer
=
new
QTcpServer
();
mServer
=
new
QTcpServer
(
this
);
connect
(
mServer
,
SIGNAL
(
newConnection
()),
this
,
SLOT
(
newConnection
()));
mServer
->
listen
(
QHostAddress
::
Any
,
port
);
...
...
@@ -45,6 +45,7 @@ void AvahiTcpAnnouncer::newConnection()
qDebug
()
<<
"AvahiTcpAnnouncer newConnection"
;
QTcpSocket
*
socket
=
mServer
->
nextPendingConnection
();
socket
->
setSocketOption
(
QAbstractSocket
::
KeepAliveOption
,
1
);
connect
(
socket
,
SIGNAL
(
readyRead
()),
this
,
SLOT
(
dataReceived
()));
...
...
daemon/networkpackage.cpp
View file @
87513455
...
...
@@ -71,10 +71,6 @@ void NetworkPackage::unserialize(QByteArray a, NetworkPackage* np)
np
->
setVersion
(
-
1
);
}
if
(
np
->
version
()
>
CURRENT_PACKAGE_VERSION
)
{
qDebug
()
<<
"Warning: package version "
<<
np
->
version
()
<<
" greater than supported version "
<<
CURRENT_PACKAGE_VERSION
;
}
//QVariant -> Object
//NetworkPackage np;
//QJSon json(a);
...
...
@@ -82,6 +78,11 @@ void NetworkPackage::unserialize(QByteArray a, NetworkPackage* np)
//np.mType = json["type"];
//np.mBody = json["body"];
QJson
::
QObjectHelper
::
qvariant2qobject
(
variant
,
np
);
if
(
np
->
version
()
>
CURRENT_PACKAGE_VERSION
)
{
qDebug
()
<<
"Warning: package version "
<<
np
->
version
()
<<
" greater than supported version "
<<
CURRENT_PACKAGE_VERSION
;
}
}
void
NetworkPackage
::
createIdentityPackage
(
NetworkPackage
*
np
)
...
...
daemon/packageinterfaces/clipboardpackageinterface.cpp
View file @
87513455
...
...
@@ -25,7 +25,6 @@
#include <QApplication>
ClipboardPackageInterface
::
ClipboardPackageInterface
()
{
qDebug
()
<<
"ClipboardPackageInterface"
;
clipboard
=
QApplication
::
clipboard
();
ignore_next_clipboard_change
=
false
;
connect
(
clipboard
,
SIGNAL
(
changed
(
QClipboard
::
Mode
)),
this
,
SLOT
(
clipboardChanged
()));
...
...
@@ -37,7 +36,7 @@ void ClipboardPackageInterface::clipboardChanged()
ignore_next_clipboard_change
=
false
;
return
;
}
qDebug
()
<<
"ClipboardChanged"
;
//
qDebug() << "ClipboardChanged";
NetworkPackage
np
(
PACKAGE_TYPE_CLIPBOARD
);
np
.
set
(
"content"
,
clipboard
->
text
());
emit
sendPackage
(
np
);
...
...
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