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:
Jarek Kobus
2023-06-03 14:00:57 +02:00
parent f1c04035a6
commit aefd4d759e
3 changed files with 0 additions and 25 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -109,7 +109,6 @@ Project {
"environmentmodel.h",
"execmenu.cpp",
"execmenu.h",
"executeondestruction.h",
"externalterminalprocessimpl.cpp",
"externalterminalprocessimpl.h",
"fadingindicator.cpp",