Commit 7ff46c0e authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Allow infinite timeout in synchronousprocess, make openProjects public.

parent 50538555
......@@ -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)
......
......@@ -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;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment