forked from qt-creator/qt-creator
CorePlugin: Reuse qScopeGuard instead of ExecuteOnDestruction
Change-Id: I2b6f6319d82512fec9a407649d7514f93283770d Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -42,7 +42,6 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/checkablemessagebox.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/executeondestruction.h>
|
||||
#include <utils/filepath.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/infobar.h>
|
||||
@@ -70,6 +69,7 @@
|
||||
#include <QPushButton>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
#include <QScopeGuard>
|
||||
#include <QSet>
|
||||
#include <QSettings>
|
||||
#include <QSplitter>
|
||||
@@ -3325,9 +3325,7 @@ IEditor *EditorManager::openEditorWithContents(Id editorId,
|
||||
EditorManager::gotoOtherSplit();
|
||||
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
Utils::ExecuteOnDestruction appRestoreCursor(&QApplication::restoreOverrideCursor);
|
||||
Q_UNUSED(appRestoreCursor)
|
||||
|
||||
const auto cleanup = qScopeGuard(&QApplication::restoreOverrideCursor);
|
||||
|
||||
const QString title = makeTitleUnique(titlePattern);
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/executeondestruction.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/listmodel.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -33,6 +32,7 @@
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QRegularExpression>
|
||||
#include <QScopeGuard>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QToolButton>
|
||||
@@ -591,7 +591,7 @@ void LoggingViewManagerWidget::saveLoggingsToFile() const
|
||||
{
|
||||
// should we just let it continue without temporarily disabling?
|
||||
const bool enabled = m_manager->isEnabled();
|
||||
Utils::ExecuteOnDestruction exec([this, enabled] { m_manager->setEnabled(enabled); });
|
||||
const auto cleanup = qScopeGuard([this, enabled] { m_manager->setEnabled(enabled); });
|
||||
if (enabled)
|
||||
m_manager->setEnabled(false);
|
||||
const Utils::FilePath fp = Utils::FileUtils::getSaveFilePath(ICore::dialogParent(),
|
||||
|
||||
Reference in New Issue
Block a user