mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2025-07-06 17:25:22 +08:00
Minor code style cleanup
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#ifndef _QTPROMISE_QPROMISE_H
|
||||
#define _QTPROMISE_QPROMISE_H
|
||||
#ifndef QTPROMISE_QPROMISE_H
|
||||
#define QTPROMISE_QPROMISE_H
|
||||
|
||||
// QtPromise
|
||||
#include "qpromise_p.h"
|
||||
@ -95,4 +95,4 @@ private:
|
||||
|
||||
#include "qpromise.inl"
|
||||
|
||||
#endif // ifndef _QTPROMISE_QPROMISE_H
|
||||
#endif // ifndef QTPROMISE_QPROMISE_H
|
||||
|
@ -12,7 +12,8 @@ public:
|
||||
: m_promise(new QPromise<T>(std::move(p)))
|
||||
{ }
|
||||
|
||||
void operator()(const T& value) const {
|
||||
void operator()(const T& value) const
|
||||
{
|
||||
resolve(value);
|
||||
}
|
||||
|
||||
@ -88,7 +89,7 @@ inline QPromiseBase<T>::QPromiseBase(F resolver)
|
||||
|
||||
try {
|
||||
resolver(resolve);
|
||||
} catch(...) {
|
||||
} catch (...) {
|
||||
reject(std::current_exception());
|
||||
}
|
||||
}
|
||||
@ -103,7 +104,7 @@ inline QPromiseBase<T>::QPromiseBase(F resolver)
|
||||
|
||||
try {
|
||||
resolver(resolve, reject);
|
||||
} catch(...) {
|
||||
} catch (...) {
|
||||
reject(std::current_exception());
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef _QTPROMISE_QPROMISE_P_H
|
||||
#define _QTPROMISE_QPROMISE_P_H
|
||||
#ifndef QTPROMISE_QPROMISE_P_H
|
||||
#define QTPROMISE_QPROMISE_P_H
|
||||
|
||||
// QtPromise
|
||||
#include "qpromiseerror.h"
|
||||
@ -284,7 +284,7 @@ struct PromiseCatcher
|
||||
error.rethrow();
|
||||
} catch (const TArg& error) {
|
||||
PromiseDispatch<TArg, ResType>::call(error, handler, resolve, reject);
|
||||
} catch(...) {
|
||||
} catch (...) {
|
||||
reject(std::current_exception());
|
||||
}
|
||||
};
|
||||
@ -332,7 +332,7 @@ struct PromiseCatcher<T, std::nullptr_t, void>
|
||||
template <typename T> class PromiseData;
|
||||
|
||||
template <typename T>
|
||||
class PromiseDataBase: public QSharedData
|
||||
class PromiseDataBase : public QSharedData
|
||||
{
|
||||
public:
|
||||
using Error = QtPromise::QPromiseError;
|
||||
@ -415,7 +415,7 @@ private:
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class PromiseData: public PromiseDataBase<T>
|
||||
class PromiseData : public PromiseDataBase<T>
|
||||
{
|
||||
using Handler = std::pair<QPointer<QThread>, std::function<void(const T&)> >;
|
||||
|
||||
@ -463,7 +463,7 @@ private:
|
||||
};
|
||||
|
||||
template <>
|
||||
class PromiseData<void>: public PromiseDataBase<void>
|
||||
class PromiseData<void> : public PromiseDataBase<void>
|
||||
{
|
||||
using Handler = std::pair<QPointer<QThread>, std::function<void()> >;
|
||||
|
||||
@ -494,4 +494,4 @@ private:
|
||||
|
||||
} // namespace QtPromise
|
||||
|
||||
#endif // ifndef _QTPROMISE_QPROMISE_H
|
||||
#endif // ifndef QTPROMISE_QPROMISE_H
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef _QTPROMISE_QPROMISEERROR_H
|
||||
#define _QTPROMISE_QPROMISEERROR_H
|
||||
#ifndef QTPROMISE_QPROMISEERROR_H
|
||||
#define QTPROMISE_QPROMISEERROR_H
|
||||
|
||||
// QtPromise
|
||||
#include "qpromiseglobal.h"
|
||||
@ -14,7 +14,7 @@ public:
|
||||
{
|
||||
try {
|
||||
throw value;
|
||||
} catch(...) {
|
||||
} catch (...) {
|
||||
m_exception = std::current_exception();
|
||||
}
|
||||
}
|
||||
@ -55,4 +55,4 @@ private:
|
||||
|
||||
} // namespace QtPromise
|
||||
|
||||
#endif // _QTPROMISE_QPROMISEERROR_H
|
||||
#endif // QTPROMISE_QPROMISEERROR_H
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef _QTPROMISE_QPROMISEFUTURE_P_H
|
||||
#define _QTPROMISE_QPROMISEFUTURE_P_H
|
||||
#ifndef QTPROMISE_QPROMISEFUTURE_P_H
|
||||
#define QTPROMISE_QPROMISEFUTURE_P_H
|
||||
|
||||
// Qt
|
||||
#include <QFutureWatcher>
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
namespace QtPromise {
|
||||
|
||||
class QPromiseCanceledException: public QException
|
||||
class QPromiseCanceledException : public QException
|
||||
{
|
||||
public:
|
||||
void raise() const Q_DECL_OVERRIDE { throw *this; }
|
||||
@ -50,7 +50,7 @@ struct PromiseFulfill<QFuture<T> >
|
||||
} else {
|
||||
PromiseFulfill<T>::call(watcher->result(), resolve, reject);
|
||||
}
|
||||
} catch(...) {
|
||||
} catch (...) {
|
||||
reject(std::current_exception());
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ struct PromiseFulfill<QFuture<void> >
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
} catch(...) {
|
||||
} catch (...) {
|
||||
reject(std::current_exception());
|
||||
}
|
||||
|
||||
@ -94,4 +94,4 @@ struct PromiseFulfill<QFuture<void> >
|
||||
|
||||
} // namespace QtPromisePrivate
|
||||
|
||||
#endif // _QTPROMISE_QPROMISEFUTURE_P_H
|
||||
#endif // QTPROMISE_QPROMISEFUTURE_P_H
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef _QTPROMISE_QPROMISEGLOBAL_H
|
||||
#define _QTPROMISE_QPROMISEGLOBAL_H
|
||||
#ifndef QTPROMISE_QPROMISEGLOBAL_H
|
||||
#define QTPROMISE_QPROMISEGLOBAL_H
|
||||
|
||||
// QtCore
|
||||
#include <QtGlobal>
|
||||
@ -122,4 +122,4 @@ struct ArgsOf<const volatile T&&> : public ArgsOf<T>
|
||||
|
||||
} // namespace QtPromisePrivate
|
||||
|
||||
#endif // ifndef _QTPROMISE_QPROMISEGLOBAL_H
|
||||
#endif // ifndef QTPROMISE_QPROMISEGLOBAL_H
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef _QTPROMISE_QPROMISEHELPERS_H
|
||||
#define _QTPROMISE_QPROMISEHELPERS_H
|
||||
#ifndef QTPROMISE_QPROMISEHELPERS_H
|
||||
#define QTPROMISE_QPROMISEHELPERS_H
|
||||
|
||||
// QtPromise
|
||||
#include "qpromise_p.h"
|
||||
@ -39,4 +39,4 @@ QPromise<void> qPromiseAll(const QVector<QPromise<void> >& promises)
|
||||
|
||||
} // namespace QtPromise
|
||||
|
||||
#endif // _QTPROMISE_QPROMISEHELPERS_H
|
||||
#endif // QTPROMISE_QPROMISEHELPERS_H
|
||||
|
Reference in New Issue
Block a user