Commit dfafff97 authored by Kurt Hindenburg's avatar Kurt Hindenburg

remove QDebug/qWarning and use QCDebug

parent cf06fa08
......@@ -26,7 +26,6 @@
#include <QtCore/QDir>
#include <QCommandLineParser>
#include <QStandardPaths>
#include <QDebug>
// KDE
#include <KActionCollection>
......
......@@ -22,6 +22,8 @@
// Own
#include "ColorSchemeManager.h"
#include "konsoledebug.h"
// Qt
#include <QtCore/QIODevice>
#include <QtCore/QFileInfo>
......@@ -30,7 +32,6 @@
// KDE
#include <KConfig>
#include <QDebug>
using namespace Konsole;
......@@ -65,7 +66,7 @@ void ColorSchemeManager::loadAllColorSchemes()
}
if (failed > 0)
qWarning() << "failed to load " << failed << " color schemes.";
qCDebug(KonsoleDebug) << "failed to load " << failed << " color schemes.";
_haveLoadedAll = true;
}
......@@ -92,7 +93,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath)
scheme->read(config);
if (scheme->name().isEmpty()) {
qWarning() << "Color scheme in" << filePath << "does not have a valid name and was not loaded.";
qCDebug(KonsoleDebug) << "Color scheme in" << filePath << "does not have a valid name and was not loaded.";
delete scheme;
return false;
}
......@@ -162,7 +163,7 @@ bool ColorSchemeManager::deleteColorScheme(const QString& name)
_colorSchemes.remove(name);
return true;
} else {
qWarning() << "Failed to remove color scheme -" << path;
qCDebug(KonsoleDebug)<<"Failed to remove color scheme -"<<path;
return false;
}
}
......@@ -176,7 +177,7 @@ const ColorScheme* ColorSchemeManager::findColorScheme(const QString& name)
// Konsole will create a sub-folder in that case (bko 315086)
// More code will have to go in to prevent the users from doing that.
if (name.contains(QLatin1String("/"))) {
qWarning() << name << " has an invalid character / in the name ... skipping";
qCDebug(KonsoleDebug)<<name<<" has an invalid character / in the name ... skipping";
return defaultColorScheme();
}
......@@ -189,7 +190,7 @@ const ColorScheme* ColorSchemeManager::findColorScheme(const QString& name)
return findColorScheme(name);
}
qWarning() << "Could not find color scheme - " << name;
qCDebug(KonsoleDebug) << "Could not find color scheme - " << name;
return 0;
}
......
......@@ -22,8 +22,7 @@
// Own
#include "ExtendedCharTable.h"
// KDE
#include <QDebug>
#include "konsoledebug.h"
// Konsole
#include "TerminalDisplay.h"
......@@ -91,7 +90,7 @@ ushort ExtendedCharTable::createExtendedChar(const ushort* unicodePoints , ushor
}
}
} else {
qWarning() << "Using all the extended char hashes, going to miss this extended character";
qCDebug(KonsoleDebug) << "Using all the extended char hashes, going to miss this extended character";
return 0;
}
}
......
......@@ -20,8 +20,9 @@
// Own
#include "Filter.h"
#include "konsoledebug.h"
// Qt
#include <QDebug>
#include <QAction>
#include <QApplication>
#include <QtGui/QClipboard>
......@@ -499,7 +500,7 @@ RegExpFilter::HotSpot* FileFilter::newHotSpot(int startLine, int startColumn, in
int endColumn, const QStringList& capturedTexts)
{
if (!_session) {
qWarning() << "Trying to create new hot spot without session!";
qCDebug(KonsoleDebug) << "Trying to create new hot spot without session!";
return nullptr;
}
......
......@@ -21,6 +21,8 @@
// Own
#include "History.h"
#include "konsoledebug.h"
// System
#include <stdlib.h>
#include <stdio.h>
......@@ -30,8 +32,6 @@
#include <errno.h>
// KDE
#include <QDebug>
#include <QDir>
#include <qplatformdefs.h>
#include <QStandardPaths>
......@@ -108,7 +108,7 @@ void HistoryFile::map()
if (_fileMap == MAP_FAILED) {
_readWriteBalance = 0;
_fileMap = 0;
qWarning() << "mmap'ing history failed. errno = " << errno;
qCDebug(KonsoleDebug) << "mmap'ing history failed. errno = " << errno;
}
}
......
......@@ -22,6 +22,8 @@
// Own
#include "KeyboardTranslator.h"
#include "konsoledebug.h"
// System
#include <ctype.h>
#include <stdio.h>
......@@ -33,7 +35,6 @@
#include <QtGui/QKeySequence>
// KDE
#include <QDebug>
#include <KLocalizedString>
using namespace Konsole;
......@@ -128,7 +129,7 @@ void KeyboardTranslatorReader::readNext()
} else if (tokens[2].type == Token::Command) {
// identify command
if (!parseAsCommand(tokens[2].text, command))
qWarning() << "Key" << tokens[1].text << ", Command" << tokens[2].text << "not understood. ";
qCDebug(KonsoleDebug) << "Key" << tokens[1].text << ", Command" << tokens[2].text << "not understood. ";
}
KeyboardTranslator::Entry newEntry;
......@@ -218,7 +219,7 @@ bool KeyboardTranslatorReader::decodeSequence(const QString& text,
} else if (parseAsKeyCode(buffer, itemKeyCode)) {
keyCode = itemKeyCode;
} else {
qWarning() << "Unable to parse key binding item:" << buffer;
qCDebug(KonsoleDebug) << "Unable to parse key binding item:" << buffer;
}
buffer.clear();
......@@ -283,7 +284,7 @@ bool KeyboardTranslatorReader::parseAsKeyCode(const QString& item , int& keyCode
keyCode = sequence[0];
if (sequence.count() > 1) {
qWarning() << "Unhandled key codes in sequence: " << item;
qCDebug(KonsoleDebug) << "Unhandled key codes in sequence: " << item;
}
} else {
return false;
......@@ -381,7 +382,7 @@ QList<KeyboardTranslatorReader::Token> KeyboardTranslatorReader::tokenize(const
QRegularExpressionMatch keyMatch(key.match(text));
if (!keyMatch.hasMatch()) {
qWarning() << "Line in keyboard translator file could not be understood:" << text;
qCDebug(KonsoleDebug) << "Line in keyboard translator file could not be understood:" << text;
return list;
}
......
......@@ -22,13 +22,12 @@
// Own
#include "KeyboardTranslatorManager.h"
#include "konsoledebug.h"
// Qt
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
// KDE
#include <QDebug>
#include <QStandardPaths>
using namespace Konsole;
......@@ -57,7 +56,7 @@ void KeyboardTranslatorManager::addTranslator(KeyboardTranslator* translator)
_translators.insert(translator->name(), translator);
if (!saveTranslator(translator))
qWarning() << "Unable to save translator" << translator->name()
qCDebug(KonsoleDebug) << "Unable to save translator" << translator->name()
<< "to disk.";
}
......@@ -71,7 +70,7 @@ bool KeyboardTranslatorManager::deleteTranslator(const QString& name)
_translators.remove(name);
return true;
} else {
qWarning() << "Failed to remove translator - " << path;
qCDebug(KonsoleDebug) << "Failed to remove translator - " << path;
return false;
}
}
......@@ -121,7 +120,7 @@ const KeyboardTranslator* KeyboardTranslatorManager::findTranslator(const QStrin
if (translator != 0)
_translators[name] = translator;
else if (!name.isEmpty())
qWarning() << "Unable to load translator" << name;
qCDebug(KonsoleDebug) << "Unable to load translator" << name;
return translator;
}
......@@ -136,7 +135,7 @@ bool KeyboardTranslatorManager::saveTranslator(const KeyboardTranslator* transla
QFile destination(path);
if (!destination.open(QIODevice::WriteOnly | QIODevice::Text)) {
qWarning() << "Unable to save keyboard translation:"
qCDebug(KonsoleDebug) << "Unable to save keyboard translation:"
<< destination.errorString();
return false;
}
......
......@@ -30,7 +30,6 @@
#include <QAction>
#include <KActionCollection>
#include <KPluginFactory>
#include <QDebug>
// Konsole
#include "EditProfileDialog.h"
......
......@@ -43,7 +43,6 @@
#include <KConfigGroup>
#include <KSharedConfig>
#include <KUser>
#include <QDebug>
#if defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) || defined(Q_OS_OSX)
#include <sys/sysctl.h>
......
......@@ -22,6 +22,8 @@
// Own
#include "ProfileManager.h"
#include "konsoledebug.h"
// Qt
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
......@@ -31,7 +33,6 @@
// KDE
#include <KSharedConfig>
#include <KConfig>
#include <QDebug>
#include <KConfigGroup>
#include <KLocalizedString>
......@@ -161,7 +162,7 @@ Profile::Ptr ProfileManager::loadProfile(const QString& shortPath)
PopStackOnExit<QString> popGuardOnExit(recursionGuard);
if (recursionGuard.contains(path)) {
qWarning() << "Ignoring attempt to load profile recursively from" << path;
qCDebug(KonsoleDebug) << "Ignoring attempt to load profile recursively from" << path;
return _fallbackProfile;
} else {
recursionGuard.push(path);
......@@ -184,7 +185,7 @@ Profile::Ptr ProfileManager::loadProfile(const QString& shortPath)
delete reader;
if (!result) {
qWarning() << "Could not load profile from " << path;
qCDebug(KonsoleDebug) << "Could not load profile from " << path;
return Profile::Ptr();
} else {
addProfile(newProfile);
......@@ -429,7 +430,7 @@ bool ProfileManager::deleteProfile(Profile::Ptr profile)
// try to delete the config file
if (profile->isPropertySet(Profile::Path) && QFile::exists(profile->path())) {
if (!QFile::remove(profile->path())) {
qWarning() << "Could not delete profile: " << profile->path()
qCDebug(KonsoleDebug) << "Could not delete profile: " << profile->path()
<< "The file is most likely in a directory which is read-only.";
return false;
......
......@@ -21,6 +21,8 @@
// Own
#include "Pty.h"
#include "konsoledebug.h"
// System
#include <termios.h>
#include <signal.h>
......@@ -30,7 +32,6 @@
#include <qplatformdefs.h>
// KDE
#include <QDebug>
#include <KPtyDevice>
using Konsole::Pty;
......@@ -77,7 +78,7 @@ void Pty::sendData(const QByteArray& data)
return;
if (pty()->write(data.constData()) == -1) {
qWarning() << "Could not send input data to terminal process.";
qCDebug(KonsoleDebug) << "Could not send input data to terminal process.";
return;
}
}
......@@ -118,7 +119,7 @@ void Pty::setFlowControlEnabled(bool enable)
ttmode.c_iflag &= ~(IXOFF | IXON);
if (!pty()->tcSetAttr(&ttmode))
qWarning() << "Unable to set terminal attributes.";
qCDebug(KonsoleDebug) << "Unable to set terminal attributes.";
}
}
......@@ -130,7 +131,7 @@ bool Pty::flowControlEnabled() const
return ((ttmode.c_iflag & IXOFF) != 0u) &&
((ttmode.c_iflag & IXON) != 0u);
} else {
qWarning() << "Unable to get flow control status, terminal not connected.";
qCDebug(KonsoleDebug) << "Unable to get flow control status, terminal not connected.";
return _xonXoff;
}
}
......@@ -149,7 +150,7 @@ void Pty::setUtf8Mode(bool enable)
ttmode.c_iflag &= ~IUTF8;
if (!pty()->tcSetAttr(&ttmode))
qWarning() << "Unable to set terminal attributes.";
qCDebug(KonsoleDebug) << "Unable to set terminal attributes.";
}
#else
Q_UNUSED(enable);
......@@ -166,7 +167,7 @@ void Pty::setEraseChar(char eChar)
ttmode.c_cc[VERASE] = eChar;
if (!pty()->tcSetAttr(&ttmode))
qWarning() << "Unable to set terminal attributes.";
qCDebug(KonsoleDebug) << "Unable to set terminal attributes.";
}
}
......@@ -177,7 +178,7 @@ char Pty::eraseChar() const
pty()->tcGetAttr(&ttyAttributes);
return ttyAttributes.c_cc[VERASE];
} else {
qWarning() << "Unable to get erase char attribute, terminal not connected.";
qCDebug(KonsoleDebug) << "Unable to get erase char attribute, terminal not connected.";
return _eraseChar;
}
}
......@@ -267,15 +268,15 @@ void Pty::setWriteable(bool writeable)
if (QT_STAT(pty()->ttyName(), &sbuf) == 0) {
if (writeable) {
if (::chmod(pty()->ttyName(), sbuf.st_mode | S_IWGRP) < 0) {
qWarning() << "Could not set writeable on "<<pty()->ttyName();
qCDebug(KonsoleDebug) << "Could not set writeable on "<<pty()->ttyName();
}
} else {
if (::chmod(pty()->ttyName(), sbuf.st_mode & ~(S_IWGRP | S_IWOTH)) < 0) {
qWarning() << "Could not unset writeable on "<<pty()->ttyName();
qCDebug(KonsoleDebug) << "Could not unset writeable on "<<pty()->ttyName();
}
}
} else {
qWarning() << "Could not stat "<<pty()->ttyName();
qCDebug(KonsoleDebug) << "Could not stat "<<pty()->ttyName();
}
}
......@@ -287,14 +288,14 @@ void Pty::closePty()
void Pty::sendEof()
{
if (pty()->masterFd() < 0) {
qWarning() << "Unable to get eof char attribute, terminal not connected.";
qCDebug(KonsoleDebug) << "Unable to get eof char attribute, terminal not connected.";
return;
}
struct ::termios ttyAttributes;
pty()->tcGetAttr(&ttyAttributes);
char eofChar = ttyAttributes.c_cc[VEOF];
if (pty()->write(QByteArray(1, eofChar)) == -1) {
qWarning() << "Unable to send EOF";
qCDebug(KonsoleDebug) << "Unable to send EOF";
}
pty()->waitForBytesWritten();
......
......@@ -39,7 +39,6 @@
#include <QKeyEvent>
// KDE
#include <QDebug>
#include <KLocalizedString>
#include <KNotification>
#include <KRun>
......
......@@ -20,7 +20,9 @@
// Own
#include "SessionController.h"
#include "ProfileManager.h"
#include "konsoledebug.h"
// Qt
#include <QApplication>
......@@ -34,7 +36,6 @@
#include <QStandardPaths>
#include <QtCore/QUrl>
#include <QtGui/QIcon>
#include <QDebug>
// KDE
#include <KActionMenu>
......@@ -338,7 +339,7 @@ void SessionController::openUrl(const QUrl& url)
i18n("Konsole does not know how to open the bookmark: ") +
url.toDisplayString());
qWarning() << "Unable to open bookmark at url" << url << ", I do not know"
qCDebug(KonsoleDebug) << "Unable to open bookmark at url" << url << ", I do not know"
<< " how to handle the protocol " << url.scheme();
}
}
......@@ -907,7 +908,7 @@ void SessionController::closeSession()
if (_session->closeInForceWay())
return;
else
qWarning() << "Konsole failed to close a session in any way.";
qCDebug(KonsoleDebug) << "Konsole failed to close a session in any way.";
}
}
}
......@@ -1577,7 +1578,7 @@ void SessionController::showDisplayContextMenu(const QPoint& position)
if (chosen && chosen->objectName() == "close-session")
chosen->trigger();
} else {
qWarning() << "Unable to display popup menu for session"
qCDebug(KonsoleDebug) << "Unable to display popup menu for session"
<< _session->title(Session::NameRole)
<< ", no GUI factory available to build the popup.";
}
......
......@@ -22,6 +22,8 @@
// Own
#include "SessionManager.h"
#include "konsoledebug.h"
// Qt
#include <QtCore/QStringList>
#include <QtCore/QSignalMapper>
......@@ -30,7 +32,6 @@
// KDE
#include <KConfig>
#include <KConfigGroup>
#include <QDebug>
// Konsole
#include "Session.h"
......@@ -53,7 +54,7 @@ SessionManager::SessionManager()
SessionManager::~SessionManager()
{
if (_sessions.count() > 0) {
qWarning() << "Konsole SessionManager destroyed with"<< _sessions.count()<<"session(s) still alive";
qCDebug(KonsoleDebug) << "Konsole SessionManager destroyed with"<< _sessions.count()<<"session(s) still alive";
// ensure that the Session doesn't later try to call back and do things to the
// SessionManager
foreach(Session* session, _sessions) {
......@@ -319,7 +320,7 @@ Session* SessionManager::idToSession(int id)
return session;
}
// this should not happen
qWarning() << "Failed to find session for ID" << id;
qCDebug(KonsoleDebug) << "Failed to find session for ID" << id;
return nullptr;
}
......@@ -50,7 +50,6 @@
#include <KShell>
#include <KColorScheme>
#include <KCursor>
#include <QDebug>
#include <KLocalizedString>
#include <KNotification>
#include <KIO/DropJob>
......
......@@ -34,7 +34,6 @@
// KDE
#include <KLocalizedString>
#include <QDebug>
// Konsole
#include "KeyboardTranslator.h"
......
......@@ -27,7 +27,6 @@
// KDE
#include <KKeySequenceWidget>
#include <QDebug>
#include <KLocalizedString>
#include <KIconLoader>
#include <QPushButton>
......@@ -482,7 +481,6 @@ ShortcutItemDelegate::ShortcutItemDelegate(QObject* aParent)
void ShortcutItemDelegate::editorModified(const QKeySequence& keys)
{
Q_UNUSED(keys);
////qDebug() << keys.toString();
KKeySequenceWidget* editor = qobject_cast<KKeySequenceWidget*>(sender());
Q_ASSERT(editor);
......
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