Commit 7d74db4e authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use categorized logging also for critical warnings

GIT_SILENT
parent fa946211
......@@ -270,7 +270,7 @@ QAction *KActionCollection::addAction(const QString &name, QAction *action)
// In debug mode assert
Q_ASSERT(!KGlobalAccel::self()->hasShortcut(action));
// In release mode keep the old name
qCritical() << "Changing action name from " << objectName << " to " << indexName << "\nignored because of active global shortcut.";
qCCritical(DEBUG_KXMLGUI) << "Changing action name from " << objectName << " to " << indexName << "\nignored because of active global shortcut.";
indexName = objectName;
}
#endif
......@@ -546,7 +546,7 @@ void KActionCollection::exportGlobalShortcuts(KConfigGroup *config, bool writeAl
// If the action name starts with unnamed- spit out a warning. That name
// will change at will and will break loading writing
if (actionName.startsWith(QLatin1String("unnamed-"))) {
qCritical() << "Skipped exporting Shortcut for action without name " << action->text() << "!";
qCCritical(DEBUG_KXMLGUI) << "Skipped exporting Shortcut for action without name " << action->text() << "!";
continue;
}
......@@ -618,7 +618,7 @@ bool KActionCollectionPrivate::writeKXMLGUIConfigFile()
// If the action name starts with unnamed- spit out a warning and ignore
// it. That name will change at will and will break loading writing
if (actionName.startsWith(QLatin1String("unnamed-"))) {
qCritical() << "Skipped writing shortcut for action " << actionName << "(" << action->text() << ")!";
qCCritical(DEBUG_KXMLGUI) << "Skipped writing shortcut for action " << actionName << "(" << action->text() << ")!";
continue;
}
......@@ -686,7 +686,7 @@ void KActionCollection::writeSettings(KConfigGroup *config, bool writeAll, QActi
// If the action name starts with unnamed- spit out a warning and ignore
// it. That name will change at will and will break loading writing
if (actionName.startsWith(QLatin1String("unnamed-"))) {
qCritical() << "Skipped saving Shortcut for action without name " << action->text() << "!";
qCCritical(DEBUG_KXMLGUI) << "Skipped saving Shortcut for action without name " << action->text() << "!";
continue;
}
......
......@@ -34,7 +34,6 @@
#include <QLineEdit>
#include <QStandardPaths>
#include <QTextEdit>
#include <QDebug>
#include <QHBoxLayout>
#include <QGridLayout>
......@@ -46,6 +45,7 @@
#include <kmessagebox.h>
#include <ktitlewidget.h>
#include "debug.h"
#include "../kxmlgui_version.h"
#include "systeminformation_p.h"
#include "config-xmlgui.h"
......@@ -513,7 +513,7 @@ bool KBugReport::sendBugReport()
proc.start(command, args);
//qCDebug(DEBUG_KXMLGUI) << command << args;
if (!proc.waitForStarted()) {
qCritical() << "Unable to open a pipe to " << command;
qCCritical(DEBUG_KXMLGUI) << "Unable to open a pipe to " << command;
return false;
}
proc.write(text().toUtf8());
......
......@@ -28,6 +28,7 @@
// The following is needed for KShortcutsEditorPrivate and QTreeWidgetHack
#include "kshortcutsdialog_p.h"
#include "debug.h"
#include <QAction>
#include <QHeaderView>
......@@ -40,7 +41,6 @@
#include <QTextTableFormat>
#include <QPrinter>
#include <QPrintDialog>
#include <QDebug>
#include <kconfig.h>
#include <kconfiggroup.h>
......@@ -365,7 +365,7 @@ bool KShortcutsEditorPrivate::addAction(QAction *action, QTreeWidgetItem *hier[]
// it. That name will change at will and will break loading and writing
QString actionName = action->objectName();
if (actionName.isEmpty() || actionName.startsWith(QLatin1String("unnamed-"))) {
qCritical() << "Skipping action without name " << action->text() << "," << actionName << "!";
qCCritical(DEBUG_KXMLGUI) << "Skipping action without name " << action->text() << "," << actionName << "!";
return false;
}
......
......@@ -21,6 +21,8 @@
#include "kswitchlanguagedialog_p.h"
#include "debug.h"
#include <QApplication>
#include <QDialogButtonBox>
#include <QDir>
......@@ -30,7 +32,6 @@
#include <QSettings>
#include <QSharedPointer>
#include <QStandardPaths>
#include <QDebug>
#include <private/qlocale_p.h>
#include <QGridLayout>
......@@ -229,19 +230,19 @@ void KSwitchLanguageDialog::removeButtonClicked()
{
QObject const *signalSender = sender();
if (!signalSender) {
qCritical() << "KSwitchLanguageDialog::removeButtonClicked() called directly, not using signal";
qCCritical(DEBUG_KXMLGUI) << "KSwitchLanguageDialog::removeButtonClicked() called directly, not using signal";
return;
}
QPushButton *removeButton = const_cast<QPushButton *>(::qobject_cast<const QPushButton *>(signalSender));
if (!removeButton) {
qCritical() << "KSwitchLanguageDialog::removeButtonClicked() called from something else than QPushButton";
qCCritical(DEBUG_KXMLGUI) << "KSwitchLanguageDialog::removeButtonClicked() called from something else than QPushButton";
return;
}
QMap<QPushButton *, LanguageRowData>::iterator it = d->languageRows.find(removeButton);
if (it == d->languageRows.end()) {
qCritical() << "KSwitchLanguageDialog::removeButtonClicked called from unknown QPushButton";
qCCritical(DEBUG_KXMLGUI) << "KSwitchLanguageDialog::removeButtonClicked called from unknown QPushButton";
return;
}
......
......@@ -332,10 +332,10 @@ void KXMLGUIClient::setXML(const QString &document, bool merge)
setDOMDocument(doc, merge);
} else {
#ifdef NDEBUG
qCritical() << "Error parsing XML document:" << errorMsg << "at line" << errorLine << "column" << errorColumn;
qCCritical(DEBUG_KXMLGUI) << "Error parsing XML document:" << errorMsg << "at line" << errorLine << "column" << errorColumn;
setDOMDocument(QDomDocument(), merge); // otherwise empty menus from ui_standards.rc stay around
#else
qCritical() << "Error parsing XML document:" << errorMsg << "at line" << errorLine << "column" << errorColumn;
qCCritical(DEBUG_KXMLGUI) << "Error parsing XML document:" << errorMsg << "at line" << errorLine << "column" << errorColumn;
abort();
#endif
}
......
......@@ -147,7 +147,7 @@ QString KXMLGUIFactory::readConfigFile(const QString &filename, const QString &_
QFile file(xml_file);
if (xml_file.isEmpty() || !file.open(QIODevice::ReadOnly)) {
qCritical() << "No such XML file" << filename;
qCCritical(DEBUG_KXMLGUI) << "No such XML file" << filename;
return QString();
}
......@@ -169,7 +169,7 @@ bool KXMLGUIFactory::saveConfigFile(const QDomDocument &doc,
QDir().mkpath(fileInfo.absolutePath());
QFile file(xml_file);
if (xml_file.isEmpty() || !file.open(QIODevice::WriteOnly)) {
qCritical() << "Could not write to" << filename;
qCCritical(DEBUG_KXMLGUI) << "Could not write to" << filename;
return false;
}
......@@ -389,7 +389,7 @@ void KXMLGUIFactoryPrivate::saveDefaultActionProperties(const QList<QAction *> &
// Check if we have an empty default shortcut and an non empty
// custom shortcut. Print out a warning and correct the mistake.
if ((!activeShortcut.isEmpty()) && defaultShortcut.isEmpty()) {
qCritical() << "Shortcut for action " << action->objectName() << action->text() << "set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.";
qCCritical(DEBUG_KXMLGUI) << "Shortcut for action " << action->objectName() << action->text() << "set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.";
action->setProperty("_k_DefaultShortcut", QVariant::fromValue(activeShortcut));
} else {
action->setProperty("_k_DefaultShortcut", QVariant::fromValue(defaultShortcut));
......
......@@ -24,7 +24,6 @@
#include "ktoolbar.h"
#include <QWidget>
#include <QDebug>
#include "debug.h"
#include <assert.h>
......@@ -664,11 +663,11 @@ void BuildHelper::processMergeElement(const QString &tag, const QString &name, c
QString mergingName(name);
if (mergingName.isEmpty()) {
if (tag == tagDefineGroup) {
qCritical() << "cannot define group without name!";
qCCritical(DEBUG_KXMLGUI) << "cannot define group without name!";
return;
}
if (tag == tagActionList) {
qCritical() << "cannot define actionlist without name!";
qCCritical(DEBUG_KXMLGUI) << "cannot define actionlist without name!";
return;
}
mergingName = defaultMergingName;
......
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