mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-08 21:17:53 +00:00
CProgressDialog: Remove redundant future copies
We can pass by reference here.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
#include "CEditorApplication.h"
|
#include "CEditorApplication.h"
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
|
|
||||||
CProgressDialog::CProgressDialog(QString OperationName, bool UseBusyIndicator, bool AlertOnFinish, QWidget *pParent)
|
CProgressDialog::CProgressDialog(const QString& OperationName, bool UseBusyIndicator, bool AlertOnFinish, QWidget *pParent)
|
||||||
: IProgressNotifierUI(pParent)
|
: IProgressNotifierUI(pParent)
|
||||||
, mpUI(std::make_unique<Ui::CProgressDialog>())
|
, mpUI(std::make_unique<Ui::CProgressDialog>())
|
||||||
, mUseBusyIndicator(UseBusyIndicator)
|
, mUseBusyIndicator(UseBusyIndicator)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class CProgressDialog : public IProgressNotifierUI
|
|||||||
bool mCanceled = false;
|
bool mCanceled = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CProgressDialog(QString OperationName, bool UseBusyIndicator, bool AlertOnFinish, QWidget *pParent = nullptr);
|
explicit CProgressDialog(const QString& OperationName, bool UseBusyIndicator, bool AlertOnFinish, QWidget *pParent = nullptr);
|
||||||
~CProgressDialog() override;
|
~CProgressDialog() override;
|
||||||
|
|
||||||
void DisallowCanceling();
|
void DisallowCanceling();
|
||||||
@@ -44,7 +44,7 @@ public slots:
|
|||||||
// Results
|
// Results
|
||||||
protected:
|
protected:
|
||||||
template<typename RetType>
|
template<typename RetType>
|
||||||
void InternalWaitForResults(QFuture<RetType> Future)
|
void InternalWaitForResults(const QFuture<RetType>& Future)
|
||||||
{
|
{
|
||||||
gpEdApp->SetEditorTicksEnabled(false);
|
gpEdApp->SetEditorTicksEnabled(false);
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
template<typename RetType>
|
template<typename RetType>
|
||||||
RetType WaitForResults(QFuture<RetType> Future)
|
RetType WaitForResults(const QFuture<RetType>& Future)
|
||||||
{
|
{
|
||||||
InternalWaitForResults(Future);
|
InternalWaitForResults(Future);
|
||||||
return Future.result();
|
return Future.result();
|
||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline void CProgressDialog::WaitForResults(QFuture<void> Future)
|
inline void CProgressDialog::WaitForResults(const QFuture<void>& Future)
|
||||||
{
|
{
|
||||||
InternalWaitForResults(Future);
|
InternalWaitForResults(Future);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user