File indexing completed on 2024-12-22 04:52:49

0001 /*
0002    SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "evolutionutil.h"
0008 
0009 #include "evolutionv3plugin_debug.h"
0010 
0011 #include <QDomDocument>
0012 #include <QFile>
0013 
0014 bool EvolutionUtil::loadInDomDocument(QFile *file, QDomDocument &doc)
0015 {
0016     const QDomDocument::ParseResult parseResult = doc.setContent(file);
0017     if (!parseResult) {
0018         qCDebug(EVOLUTIONPLUGIN_LOG) << "Unable to load document.Parse error in line " << parseResult.errorLine << ", col " << parseResult.errorColumn << ": "
0019                                      << qPrintable(parseResult.errorMessage);
0020         return false;
0021     }
0022     return true;
0023 }
0024 
0025 bool EvolutionUtil::loadInDomDocument(const QString &file, QDomDocument &doc)
0026 {
0027     const QDomDocument::ParseResult parseResult = doc.setContent(file);
0028     if (!parseResult) {
0029         qCDebug(EVOLUTIONPLUGIN_LOG) << "Unable to load document.Parse error in line " << parseResult.errorLine << ", col " << parseResult.errorColumn << ": "
0030                                      << qPrintable(parseResult.errorMessage);
0031         return false;
0032     }
0033     return true;
0034 }