mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
Ref T401, info and setting object for crash dumps
This commit is contained in:
76
src/blackmisc/crashsettings.h
Normal file
76
src/blackmisc/crashsettings.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_CRASHSETTINGS_H
|
||||
#define BLACKMISC_CRASHSETTINGS_H
|
||||
|
||||
#include "blackmisc/valueobject.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Settings
|
||||
{
|
||||
/*!
|
||||
* Crash info. Details about crash context.
|
||||
*/
|
||||
class BLACKMISC_EXPORT CCrashSettings : public CValueObject<CCrashSettings>
|
||||
{
|
||||
public:
|
||||
//! Properties by index
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexEnabled = CPropertyIndex::GlobalIndexCCrashSettings,
|
||||
IndexPrivateInfo
|
||||
};
|
||||
|
||||
//! Default constructor.
|
||||
CCrashSettings();
|
||||
|
||||
//! Is enabled?
|
||||
bool isEnabled() const { return m_enabled; }
|
||||
|
||||
//! Set enabled
|
||||
void setEnabled(bool enabled) { m_enabled = enabled; }
|
||||
|
||||
//! With privacy info
|
||||
bool withPrivacyInfo() const { return m_privacyInfo; }
|
||||
|
||||
//! Set privacy info
|
||||
void setPrivacyInfo(bool privacy) { m_privacyInfo = privacy; }
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CCrashSettings &compareValue) const;
|
||||
|
||||
private:
|
||||
bool m_enabled = false;
|
||||
bool m_privacyInfo = false;
|
||||
|
||||
BLACK_METACLASS(
|
||||
CCrashSettings,
|
||||
BLACK_METAMEMBER(enabled),
|
||||
BLACK_METAMEMBER(privacyInfo)
|
||||
);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Settings::CCrashSettings)
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user