forked from qt-creator/qt-creator
Utils: Get rid of ExecuteOnDestruction
Change-Id: I6c93e665268df16d10d899743052e698a421e0f5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -43,7 +43,6 @@ add_qtc_library(Utils
|
||||
environmentfwd.h
|
||||
environmentmodel.cpp environmentmodel.h
|
||||
execmenu.cpp execmenu.h
|
||||
executeondestruction.h
|
||||
expected.h
|
||||
externalterminalprocessimpl.cpp externalterminalprocessimpl.h
|
||||
fadingindicator.cpp fadingindicator.h
|
||||
|
@@ -1,23 +0,0 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class ExecuteOnDestruction
|
||||
{
|
||||
public:
|
||||
ExecuteOnDestruction() noexcept : destructionCode([] {}) {}
|
||||
ExecuteOnDestruction(std::function<void()> code) : destructionCode(std::move(code)) {}
|
||||
~ExecuteOnDestruction() { if (destructionCode) destructionCode(); }
|
||||
|
||||
void reset(std::function<void()> code) { destructionCode = std::move(code); }
|
||||
|
||||
private:
|
||||
std::function<void()> destructionCode;
|
||||
};
|
||||
|
||||
} // Utils
|
@@ -109,7 +109,6 @@ Project {
|
||||
"environmentmodel.h",
|
||||
"execmenu.cpp",
|
||||
"execmenu.h",
|
||||
"executeondestruction.h",
|
||||
"externalterminalprocessimpl.cpp",
|
||||
"externalterminalprocessimpl.h",
|
||||
"fadingindicator.cpp",
|
||||
|
Reference in New Issue
Block a user