Diffstat (limited to 'noncore/applets/keyhelper/keyhelperapplet/config/KeycfgErrorHandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/keyhelper/keyhelperapplet/config/KeycfgErrorHandler.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/noncore/applets/keyhelper/keyhelperapplet/config/KeycfgErrorHandler.cpp b/noncore/applets/keyhelper/keyhelperapplet/config/KeycfgErrorHandler.cpp new file mode 100644 index 0000000..e1faf18 --- a/dev/null +++ b/noncore/applets/keyhelper/keyhelperapplet/config/KeycfgErrorHandler.cpp | |||
@@ -0,0 +1,38 @@ | |||
1 | #include "KeycfgErrorHandler.h" | ||
2 | |||
3 | void KeycfgErrorHandler::setErrorString(const QString& header, | ||
4 | const QXmlParseException& exception) | ||
5 | { | ||
6 | m_errstr = header; | ||
7 | m_errstr.append(": "); | ||
8 | m_errstr.append(exception.message()); | ||
9 | m_errstr.append(" ["); | ||
10 | m_errstr.append(QString::number(exception.lineNumber())); | ||
11 | m_errstr.append(", "); | ||
12 | m_errstr.append(QString::number(exception.columnNumber())); | ||
13 | m_errstr.append("]"); | ||
14 | qWarning(m_errstr.latin1()); | ||
15 | } | ||
16 | |||
17 | bool KeycfgErrorHandler::warning(const QXmlParseException& exception) | ||
18 | { | ||
19 | setErrorString("warning", exception); | ||
20 | return(true); | ||
21 | } | ||
22 | |||
23 | bool KeycfgErrorHandler::error(const QXmlParseException& exception) | ||
24 | { | ||
25 | setErrorString("error", exception); | ||
26 | return(false); | ||
27 | } | ||
28 | |||
29 | bool KeycfgErrorHandler::fatalError(const QXmlParseException& exception) | ||
30 | { | ||
31 | setErrorString("fatal", exception); | ||
32 | return(false); | ||
33 | } | ||
34 | |||
35 | QString KeycfgErrorHandler::errorString() | ||
36 | { | ||
37 | return(m_errstr); | ||
38 | } | ||