From 7ff46c0e5350f40f853342272411f05cd5f18029 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Mon, 20 Jul 2009 12:42:22 +0200
Subject: [PATCH] Allow infinite timeout in synchronousprocess, make
 openProjects public.

---
 src/libs/utils/synchronousprocess.cpp    | 10 ++++++++--
 src/plugins/vcsbase/basecheckoutwizard.h |  4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/libs/utils/synchronousprocess.cpp b/src/libs/utils/synchronousprocess.cpp
index 77a90f9d12a..31abaa6cfc0 100644
--- a/src/libs/utils/synchronousprocess.cpp
+++ b/src/libs/utils/synchronousprocess.cpp
@@ -38,6 +38,8 @@
 
 #include <QtGui/QApplication>
 
+#include <limits.h>
+
 enum { debug = 0 };
 
 enum { defaultMaxHangTimerCount = 10 };
@@ -167,12 +169,16 @@ SynchronousProcess::~SynchronousProcess()
 
 void SynchronousProcess::setTimeout(int timeoutMS)
 {
-    m_d->m_maxHangTimerCount = qMax(2, timeoutMS / 1000);
+    if (timeoutMS >= 0) {
+        m_d->m_maxHangTimerCount = qMax(2, timeoutMS / 1000);
+    } else {
+        m_d->m_maxHangTimerCount = INT_MAX;
+    }
 }
 
 int SynchronousProcess::timeout() const
 {
-    return 1000 * m_d->m_maxHangTimerCount;
+    return m_d->m_maxHangTimerCount == INT_MAX ? -1 : 1000 * m_d->m_maxHangTimerCount;
 }
 
 void SynchronousProcess::setStdOutCodec(QTextCodec *c)
diff --git a/src/plugins/vcsbase/basecheckoutwizard.h b/src/plugins/vcsbase/basecheckoutwizard.h
index a8091b20024..51ea090caf1 100644
--- a/src/plugins/vcsbase/basecheckoutwizard.h
+++ b/src/plugins/vcsbase/basecheckoutwizard.h
@@ -73,6 +73,8 @@ public:
 
     virtual QStringList runWizard(const QString &path, QWidget *parent);
 
+    static QString openProject(const QString &path, QString *errorMessage);
+
 protected:
     virtual QWizardPage *createParameterPage(const QString &path) = 0;
     virtual QSharedPointer<AbstractCheckoutJob> createJob(const QWizardPage *parameterPage,
@@ -82,8 +84,6 @@ private slots:
     void slotProgressPageShown();
 
 private:
-    QString openProject(const QString &path, QString *errorMessage);
-
     BaseCheckoutWizardPrivate *d;
 };
 
-- 
GitLab