blob: 42d4ca2b166b0f776b5b4fcd4848f4a98ea2451b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright (C) 2019 Orgad Shaneh <orgads@gmail.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "utils_global.h"
#include "guard.h"
#include <QObject>
namespace Utils {
class QTCREATOR_UTILS_EXPORT GlobalFileChangeBlocker : public QObject
{
Q_OBJECT
public:
static GlobalFileChangeBlocker *instance();
void forceBlocked(bool blocked);
bool isBlocked() const { return m_blockedState; }
signals:
void stateChanged(bool blocked);
private:
GlobalFileChangeBlocker();
void applicationStateChanged(Qt::ApplicationState state);
Guard m_ignoreChanges;
bool m_blockedState = false;
};
} // namespace Utils
|