KCrash

coreconfig.cpp
1/*
2 SPDX-FileCopyrightText: 2016-2021 Harald Sitter <sitter@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "coreconfig_p.h"
8
9#include <QFile>
10
11#include <config-kcrash.h>
12namespace KCrash
13{
14CoreConfig::CoreConfig(const QString &path)
15{
16#if !KCRASH_CORE_PATTERN_RAISE
17 return; // Leave everything false unless enabled.
18#endif
19 QFile file(path);
21 return;
22 }
23 char first = 0;
24 if (!file.getChar(&first)) {
25 return;
26 }
27 m_supported = true;
28 m_process = first == '|';
29
30 if (file.readLine().contains(QByteArrayLiteral("systemd-coredump"))) {
31 m_coredumpd = true;
32 }
33}
34
35bool CoreConfig::isProcess() const
36{
37 return m_supported && m_process;
38}
39
40bool CoreConfig::isCoredumpd() const
41{
42 return m_coredumpd;
43}
44
45} // namespace KCrash
This namespace contains functions to handle crashes.
bool contains(QByteArrayView bv) const const
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
bool getChar(char *c)
QByteArray readLine(qint64 maxSize)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 7 2024 11:59:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.