Commit 14b42195 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add debug categories

parent 2b2ed3fa
Pipeline #118884 passed with stage
in 53 seconds
......@@ -25,6 +25,7 @@ include(ECMInstallIcons)
include(ECMMarkNonGuiExecutable)
include(CheckIncludeFiles)
include(ECMSetupVersion)
include(ECMQtDeclareLoggingCategory)
find_package(Gettext REQUIRED)
find_package(PythonInterp REQUIRED)
......@@ -143,4 +144,10 @@ if (KF5DocTools_FOUND)
endif()
install(FILES org.kde.kalzium.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
ecm_qt_install_logging_categories(
EXPORT KALZIUM
FILE kalzium.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -43,6 +43,8 @@ if (HAVE_OPENBABEL)
endif (EIGEN3_FOUND AND AvogadroLibs_FOUND)
endif (HAVE_OPENBABEL)
## Kalzium calculator files
set(kalziumtools_SRCS
${kalziumtools_SRCS}
......@@ -68,6 +70,7 @@ ki18n_wrap_ui(kalziumtools_SRCS
# calculator/massCalculator.ui
)
ecm_qt_declare_logging_category(kalziumtools_SRCS HEADER kalzium_debug.h IDENTIFIER KALZIUM_LOG CATEGORY_NAME org.kde.kalzium DESCRIPTION "Kalzium" EXPORT KALZIUML)
set(kalzium_SRCS
${kalziumtools_SRCS}
detailedgraphicaloverview.cpp
......
......@@ -6,7 +6,7 @@
#include "calculator.h"
#include <QDebug>
#include "kalzium_debug.h"
#include <QDialog>
#include <QDialogButtonBox>
#include <QIcon>
......@@ -91,7 +91,7 @@ void calculator::slotItemSelection(QTreeWidgetItem *item)
}
//DEBUG
qDebug() << "Item clicked: " << item->text(0);
qCDebug(KALZIUM_LOG) << "Item clicked: " << item->text(0);
QString s = item->text(0);
......
......@@ -6,7 +6,7 @@
#include "concCalculator.h"
#include <QDebug>
#include "kalzium_debug.h"
#include <KLocalizedString>
#include <KUnitConversion/Converter>
......
......@@ -7,7 +7,7 @@
#ifndef CONCCALCULATOR_H
#define CONCCALCULATOR_H
#include <QDebug>
#include "kalzium_debug.h"
#include <KUnitConversion/UnitCategory>
......
......@@ -7,7 +7,7 @@
#ifndef GASCALCULATOR_H
#define GASCALCULATOR_H
#include <QDebug>
#include "kalzium_debug.h"
#include <KUnitConversion/Converter>
#include <KUnitConversion/UnitCategory>
......
......@@ -7,7 +7,7 @@
#ifndef NUCLEARCALCULATOR_H
#define NUCLEARCALCULATOR_H
#include <QDebug>
#include "kalzium_debug.h"
#include <KUnitConversion/UnitCategory>
#include <KUnitConversion/Converter>
......
......@@ -7,7 +7,7 @@
#ifndef TITRATIONCALCULATOR_H
#define TITRATIONCALCULATOR_H
#include <QDebug>
#include "kalzium_debug.h"
#include <QString>
#include <QStringList>
......
......@@ -10,7 +10,7 @@
#include <KLocalizedString>
#include <QDebug>
#include "kalzium_debug.h"
#include <QFile>
#include <QFileInfo>
#include <QFontDatabase>
......
......@@ -10,7 +10,7 @@
#include "prefs.h"
//Qt-Includes
#include <QDebug>
#include "kalzium_debug.h"
#include <QDialogButtonBox>
#include <QKeyEvent>
#include <QPen>
......@@ -141,14 +141,14 @@ void ElementDataViewer::swapXYAxis()
void ElementDataViewer::setLimits()
{
qDebug() << "ElementDataViewer::setLimits()";
qCDebug(KALZIUM_LOG) << "ElementDataViewer::setLimits()";
double x1 = 0.0, x2 = 0.0, y1 = 0.0, y2 = 0.0;
getMinMax(x1, x2, m_xData);
getMinMax(y1, y2, m_yData);
qDebug() << x1 << " :: " << x2 << " ----- " << y1 << " :: " << y2;
qCDebug(KALZIUM_LOG) << x1 << " :: " << x2 << " ----- " << y1 << " :: " << y2;
//JH: add some padding to show all points
double dx = 0.05*(x2-x1);
......@@ -178,7 +178,7 @@ void ElementDataViewer::getMinMax(double& min, double& max, AxisData * data)
double minValue = data->value(firstElement);
double maxValue = data->value(firstElement);
qDebug() << "Taking elements from " << firstElement << " to " << lastElement;
qCDebug(KALZIUM_LOG) << "Taking elements from " << firstElement << " to " << lastElement;
for (int _currentVal = firstElement; _currentVal <= lastElement; ++_currentVal) { //go over all selected elements
double v = data->value(_currentVal);
......@@ -191,7 +191,7 @@ void ElementDataViewer::getMinMax(double& min, double& max, AxisData * data)
}
}
qDebug() << "The value are ]"<< minValue << " , " << maxValue << "[.";
qCDebug(KALZIUM_LOG) << "The value are ]"<< minValue << " , " << maxValue << "[.";
min = minValue;
max = maxValue;
......
......@@ -7,7 +7,7 @@
#include "kalziumutils.h"
#include <QDebug>
#include "kalzium_debug.h"
#include <QDialog>
#include <QDialogButtonBox>
#include <QFont>
......@@ -76,7 +76,7 @@ PropertyListEntry::~PropertyListEntry()
ExportDialog::ExportDialog(QWidget * parent)
: QDialog(parent),m_outputStream(nullptr)
{
qDebug() << "ExportDialog::ExportDialog";
qCDebug(KALZIUM_LOG) << "ExportDialog::ExportDialog";
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Help);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
......@@ -87,29 +87,29 @@ ExportDialog::ExportDialog(QWidget * parent)
connect(buttonBox, &QDialogButtonBox::accepted, this, &ExportDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ExportDialog::reject);
mainLayout->addWidget(buttonBox);
qDebug() << "ExportDialog: setButtons";
qCDebug(KALZIUM_LOG) << "ExportDialog: setButtons";
ui.setupUi(mainWidget);
qDebug() << "ExportDialog: ui.setupUi(mainWidget)";
qCDebug(KALZIUM_LOG) << "ExportDialog: ui.setupUi(mainWidget)";
KGuiItem::assign(user1Button, KGuiItem(i18n("OK")));
qDebug() << "ExportDialog: setButtonGuiItem(User1, KGuiItem(i18n(\"OK\")));";
qCDebug(KALZIUM_LOG) << "ExportDialog: setButtonGuiItem(User1, KGuiItem(i18n(\"OK\")));";
ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);
qDebug() << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
qCDebug(KALZIUM_LOG) << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
setWindowTitle(i18nc("@title:window", "Export Chemical Data"));
qDebug() << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
qCDebug(KALZIUM_LOG) << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
populateElementList();
qDebug() << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
qCDebug(KALZIUM_LOG) << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
ui.formatList->addItem(QStringLiteral(".html (formatted html document)"), "html");
ui.formatList->addItem(QStringLiteral(".xml (raw element data)"), "xml");
ui.formatList->addItem(QStringLiteral(".csv (comma-separated data)"), "csv");
qDebug() << "ui.formatList->addItem(...);";
qCDebug(KALZIUM_LOG) << "ui.formatList->addItem(...);";
connect(user1Button, &QPushButton::clicked, this, &ExportDialog::slotOkClicked);
qDebug() << "connect(user1Button, SIGNAL(clicked()), this, SLOT(slotOkClicked()));";
qCDebug(KALZIUM_LOG) << "connect(user1Button, SIGNAL(clicked()), this, SLOT(slotOkClicked()));";
connect(buttonBox, &QDialogButtonBox::helpRequested, this, &ExportDialog::slotHelpRequested);
qDebug() << "KHelpClient::invokeHelp(QString(), \"kalzium\");";
qCDebug(KALZIUM_LOG) << "KHelpClient::invokeHelp(QString(), \"kalzium\");";
}
ExportDialog::~ExportDialog()
......
......@@ -7,7 +7,7 @@
#include <KLocalizedString>
#include <QDebug>
#include "kalzium_debug.h"
#include <QIcon>
#include <QTimer>
......
......@@ -13,7 +13,7 @@
#include <isotope.h>
#include <QDebug>
#include "kalzium_debug.h"
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
......
......@@ -441,7 +441,7 @@ void Kalzium::slotSwitchtoNumeration(int index)
void Kalzium::slotSwitchtoLookGradient(int which)
{
qDebug() << "slotSwitchtoLookGradient Kalzium";
qCDebug(KALZIUM_LOG) << "slotSwitchtoLookGradient Kalzium";
KalziumElementProperty::instance()->setGradient(which);
......@@ -461,7 +461,7 @@ void Kalzium::slotSwitchtoLookGradient(int which)
void Kalzium::slotSwitchtoLookScheme(int which)
{
qDebug() << "slotSwitchtoLookScheme Kalzium";
qCDebug(KALZIUM_LOG) << "slotSwitchtoLookScheme Kalzium";
KalziumElementProperty::instance()->setScheme(which);
......@@ -558,7 +558,7 @@ void Kalzium::elementHover(int num)
e->dataAsString(ChemicalDataObject::name),
e->dataAsString(ChemicalDataObject::atomicNumber),
e->dataAsString(ChemicalDataObject::mass)));
qDebug() << "change item in status bar";
qCDebug(KALZIUM_LOG) << "change item in status bar";
m_detailWidget->setElement(num);
}
......
......@@ -12,7 +12,7 @@
#include <spectrumparser.h>
#include <QCoreApplication>
#include <QDebug>
#include "kalzium_debug.h"
#include <QFile>
#include <QFileInfo>
#include <QGlobalStatic>
......
......@@ -10,7 +10,7 @@
#include "prefs.h"
#include "kalziumdataobject.h"
#include <QDebug>
#include "kalzium_debug.h"
#include <QVariant>
#include <KLocalizedString>
......
......@@ -17,7 +17,7 @@
#endif
#include <QBrush>
#include <QDebug>
#include "kalzium_debug.h"
#include <QStandardPaths>
#include <KLocalizedString>
......@@ -449,7 +449,7 @@ QList<legendPair> KalziumColorSchemeType::legendItems() const
//X {
//X QString crystal = KalziumDataObject::instance()->element(el)->dataAsString(ChemicalDataObject::crystalstructure);
//X
//X qDebug() << "crystal is " << crystal;
//X qCDebug(KALZIUM_LOG) << "crystal is " << crystal;
//X
//X static QString resourcepath;
//X if (resourcepath.isEmpty()) {
......@@ -481,11 +481,11 @@ QList<legendPair> KalziumColorSchemeType::legendItems() const
//X
//X QBrush ret;
//X if (!filename.isEmpty()) {
//X qDebug() << el << ": FILENAME is not EMPTY... " << filename;
//X qCDebug(KALZIUM_LOG) << el << ": FILENAME is not EMPTY... " << filename;
//X QPixmap pixmap(resourcepath + filename);
//X ret = QBrush(pixmap.scaled(elrect.size(), Qt::KeepAspectRatio));
//X } else {
//X qDebug() << el << ": FILENAME EMPTY... " << filename;
//X qCDebug(KALZIUM_LOG) << el << ": FILENAME EMPTY... " << filename;
//X ret.setColor(Qt::gray);
//X }
//X
......
......@@ -7,7 +7,7 @@
#include <config-kalzium.h>
#include <QDebug>
#include "kalzium_debug.h"
#include <QFont>
#include <QPainter>
#include <QRect>
......
......@@ -13,7 +13,7 @@
#include <KTreeWidgetSearchLine>
#include <QKeyEvent>
#include <QDebug>
#include "kalzium_debug.h"
#include <QDialogButtonBox>
#include <QDomDocument>
#include <QEvent>
......@@ -148,7 +148,7 @@ bool Glossary::loadLayout(QDomDocument &Document, const QUrl &url)
QFile layoutFile(url.path());
if (!layoutFile.exists()) {
qDebug() << "no such file: " << layoutFile.fileName();
qCDebug(KALZIUM_LOG) << "no such file: " << layoutFile.fileName();
return false;
}
......@@ -158,7 +158,7 @@ bool Glossary::loadLayout(QDomDocument &Document, const QUrl &url)
// check if document is well-formed
if (!Document.setContent(&layoutFile)) {
qDebug() << "wrong xml of " << layoutFile.fileName();
qCDebug(KALZIUM_LOG) << "wrong xml of " << layoutFile.fileName();
layoutFile.close();
return false;
}
......
......@@ -8,7 +8,7 @@
#include "prefs.h"
#include <QDebug>
#include "kalzium_debug.h"
#include <QGridLayout>
#include <QHBoxLayout>
......@@ -27,7 +27,7 @@ LegendWidget::~LegendWidget()
void LegendWidget::setDockArea(Qt::DockWidgetArea newDockArea)
{
qDebug() << "dock Area changed" << newDockArea;
qCDebug(KALZIUM_LOG) << "dock Area changed" << newDockArea;
m_dockArea = newDockArea;
updateContent();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment