[X2Go-Commits] [x2godesktopsharing] 01/01: sharetray.cpp: fix type issues while calculating time difference. Fixes: #993.

git-admin at x2go.org git-admin at x2go.org
Sun Feb 7 17:56:42 CET 2016


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2godesktopsharing.

commit e470e7117439f978593e3a732c85b45d3d755b2e
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sun Feb 7 17:56:27 2016 +0100

    sharetray.cpp: fix type issues while calculating time difference. Fixes: #993.
---
 debian/changelog |    2 ++
 sharetray.cpp    |    8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4e21389..86c668d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ x2godesktopsharing (3.1.1.3-0x2go1) UNRELEASED; urgency=low
     - x2godesktopsharing.pro: also rename x2godesktopsharing_zh_tw in project
       file.
     - misc: fix X2GO => X2Go and add "Desktop" where missing. Fixes: #936.
+    - sharetray.cpp: fix type issues while calculating time difference. Fixes:
+      #993.
   * debian/control:
     - Drop libqt4-gui Depends. Already handled by shlibs and misc Depends.
       Fixes: #905.
diff --git a/sharetray.cpp b/sharetray.cpp
index 16aa101..4424f9a 100644
--- a/sharetray.cpp
+++ b/sharetray.cpp
@@ -93,10 +93,10 @@ ShareTray::ShareTray()
 			{
 				QString line = in.readLine();
 				file.close();
-				if ( abs ( line.toUInt() -
-					QDateTime::currentDateTime().toTime_t() ) <5 )
-					{
-
+				uint32_t fetch_time = line.toUInt ();
+				uint32_t cur_time = QDateTime::currentDateTime ().toTime_t ();
+				int64_t time_diff = static_cast<int64_t> (fetch_time) - static_cast<int64_t> (cur_time);
+				if (abs (time_diff) < 5) {
 					QString message=QString (
 					                tr (
 					                    "X2Go desktop sharing application "

--
Alioth's /srv/git/code.x2go.org/x2godesktopsharing.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2godesktopsharing.git


More information about the x2go-commits mailing list