forked from qt-creator/qt-creator
Don't ask to reload the file, if the user uses git/undo or git/revert.
Simply do it. Task-Nr: 254558
This commit is contained in:
@@ -136,6 +136,25 @@ private:
|
||||
bool m_blockActivated;
|
||||
};
|
||||
|
||||
/*! The FileChangeBlocker blocks all change notifications to all IFile * that
|
||||
match the given filename. And unblocks in the destructor.
|
||||
|
||||
To also reload the IFile in the destructor class set modifiedReload to true
|
||||
|
||||
*/
|
||||
class CORE_EXPORT FileChangeBlocker
|
||||
{
|
||||
public:
|
||||
FileChangeBlocker(const QString &fileName);
|
||||
~FileChangeBlocker();
|
||||
void setModifiedReload(bool reload);
|
||||
bool modifiedReload() const;
|
||||
private:
|
||||
QList<IFile *> m_files;
|
||||
bool m_reload;
|
||||
Q_DISABLE_COPY(FileChangeBlocker);
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
#endif // FILEMANAGER_H
|
||||
|
||||
Reference in New Issue
Block a user