Skip to content

Instantly share code, notes, and snippets.

@Kirek
Created March 31, 2018 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kirek/d073372ab5e310b68abcfa0c2ee1c4b5 to your computer and use it in GitHub Desktop.
Save Kirek/d073372ab5e310b68abcfa0c2ee1c4b5 to your computer and use it in GitHub Desktop.
qt5boxit
diff --git a/boxit/src/boxit/main.cpp b/boxit/src/boxit/main.cpp
index 8ce90a0..60a33ab 100644
--- a/boxit/src/boxit/main.cpp
+++ b/boxit/src/boxit/main.cpp
@@ -40,6 +40,7 @@
#include <QFileInfo>
#include <QMap>
#include <QProcess>
+#include <QTimer>
#include <dbusclient.h>
#include "boxitsocket.h"
@@ -2160,7 +2161,20 @@ bool uploadData(const QString path, const int currentIndex, const int maxIndex)
bool listenOnStatus(bool exitOnSessionEnd) {
- TimeOutReset timeOutReset(&boxitSocket);
+
+
+ //TimeOutReset timeOutReset(&boxitSocket);
+ QTimer timer;
+ QObject::connect(&timer, &QTimer::timeout,
+ [=]( ) {
+ if (boxitSocket.state() != QAbstractSocket::ConnectedState) {
+ cerr << "info: timeout, everythin is fine";
+ return;
+ }
+ cerr << "info: timeout, is timing out!";
+ boxitSocket.sendData(MSG_RESET_TIMEOUT); }
+ );
+
QString host = "";
if (!connectAndLoginToHost(host))
@@ -2175,7 +2189,8 @@ bool listenOnStatus(bool exitOnSessionEnd) {
}
// Start our reset timeout timer
- timeOutReset.start();
+ //timeOutReset.start();
+ timer.start(10000);
bool firstBranch = true;
bool firstRepo = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment