Commit 5016261b authored by Michal Humpula's avatar Michal Humpula

migrate from KDebug to QLoggingCategory (katepart)

REVIEW: 114491
parent 242b7e2a
......@@ -219,8 +219,6 @@ snippet/editrepository.ui
snippet/editsnippet.ui
)
add_definitions ( -DKDE_DEFAULT_DEBUG_AREA=13000 )
kde4_add_ui_files(katepart_PART_SRCS ${katepart_PART_UI} )
add_library (katepartinterfaces SHARED ${katepart_PART_SRCS} )
......
......@@ -27,6 +27,8 @@
#include "katedocument.h"
#include "kateview.h"
#include "katepartdebug.h"
// fdatasync
#include <kde_file.h>
......@@ -34,9 +36,9 @@
#include <kdeversion.h>
#if 0
#define EDIT_DEBUG kDebug()
#define EDIT_DEBUG qCDebug(LOG_PART)
#else
#define EDIT_DEBUG if (0) kDebug()
#define EDIT_DEBUG if (0) qCDebug(LOG_PART)
#endif
namespace Kate {
......@@ -582,7 +584,7 @@ bool TextBuffer::load (const QString &filename, bool &encodingErrors, bool &tooL
// bail out on encoding error, if not last round!
if (encodingErrors && i < (enforceTextCodec ? 0 : 3)) {
kDebug (13020) << "Failed try to load file" << filename << "with codec" <<
qCDebug(LOG_PART) << "Failed try to load file" << filename << "with codec" <<
(file.textCodec() ? file.textCodec()->name() : "(null)");
break;
}
......@@ -673,14 +675,14 @@ bool TextBuffer::load (const QString &filename, bool &encodingErrors, bool &tooL
Q_ASSERT (m_lines > 0);
// report CODEC + ERRORS
kDebug (13020) << "Loaded file " << filename << "with codec" << m_textCodec->name()
qCDebug(LOG_PART) << "Loaded file " << filename << "with codec" << m_textCodec->name()
<< (encodingErrors ? "with" : "without") << "encoding errors";
// report BOM
kDebug (13020) << (file.byteOrderMarkFound () ? "Found" : "Didn't find") << "byte order mark";
qCDebug(LOG_PART) << (file.byteOrderMarkFound () ? "Found" : "Didn't find") << "byte order mark";
// report filter device mime-type
kDebug (13020) << "used filter device for mime-type" << m_mimeTypeForFilterDev;
qCDebug(LOG_PART) << "used filter device for mime-type" << m_mimeTypeForFilterDev;
// emit success
emit loaded (filename, encodingErrors);
......@@ -826,7 +828,7 @@ bool TextBuffer::save (const QString &filename)
m_history.setLastSavedRevision ();
// report CODEC + ERRORS
kDebug (13020) << "Saved file " << filename << "with codec" << m_textCodec->name()
qCDebug(LOG_PART) << "Saved file " << filename << "with codec" << m_textCodec->name()
<< (ok ? "without" : "with") << "errors";
if (ok)
......
......@@ -27,7 +27,7 @@
#include <QTreeView>
#include <QApplication>
#include <kdebug.h>
#include "katepartdebug.h"
#include "expandingwidgetmodel.h"
......@@ -90,7 +90,7 @@ void ExpandingDelegate::paint( QPainter * painter, const QStyleOptionViewItem &
option.decorationAlignment = m_cachedAlignment;
option.displayAlignment = m_cachedAlignment;
//kDebug( 13035 ) << "Painting row " << index.row() << ", column " << index.column() << ", internal " << index.internalPointer() << ", drawselected " << option.showDecorationSelected << ", selected " << (option.state & QStyle::State_Selected);
//qCDebug(LOG_PART) << "Painting row " << index.row() << ", column " << index.column() << ", internal " << index.internalPointer() << ", drawselected " << option.showDecorationSelected << ", selected " << (option.state & QStyle::State_Selected);
m_cachedHighlights.clear();
m_backgroundColor = getUsedBackgroundColor(option, index);
......@@ -100,9 +100,9 @@ void ExpandingDelegate::paint( QPainter * painter, const QStyleOptionViewItem &
m_cachedHighlights = createHighlighting(index, option);
}
/*kDebug( 13035 ) << "Highlights for line:";
/*qCDebug(LOG_PART) << "Highlights for line:";
foreach (const QTextLayout::FormatRange& fr, m_cachedHighlights)
kDebug( 13035 ) << fr.start << " len " << fr.length << " format ";*/
qCDebug(LOG_PART) << fr.start << " len " << fr.length << " format ";*/
QItemDelegate::paint(painter, option, index);
......@@ -203,7 +203,7 @@ void ExpandingDelegate::drawDisplay( QPainter * painter, const QStyleOptionViewI
if(m_backgroundColor.isValid()) {
QColor background = m_backgroundColor;
// kDebug() << text << "background:" << background.name();
// qCDebug(LOG_PART) << text << "background:" << background.name();
//Now go through the formats, and make sure the contrast background/foreground is readable
for(int a = 0; a < additionalFormats.size(); ++a) {
QColor currentBackground = background;
......@@ -216,10 +216,10 @@ void ExpandingDelegate::drawDisplay( QPainter * painter, const QStyleOptionViewI
QColor invertedColor(0xffffffff-additionalFormats[a].format.foreground().color().rgb());
double invertedContrast = readabilityContrast(invertedColor, currentBackground);
// kDebug() << "values:" << invertedContrast << currentContrast << invertedColor.name() << currentColor.name();
// qCDebug(LOG_PART) << "values:" << invertedContrast << currentContrast << invertedColor.name() << currentColor.name();
if(invertedContrast > currentContrast) {
// kDebug() << text << additionalFormats[a].length << "switching from" << currentColor.name() << "to" << invertedColor.name();
// qCDebug(LOG_PART) << text << additionalFormats[a].length << "switching from" << currentColor.name() << "to" << invertedColor.name();
QBrush b(additionalFormats[a].format.foreground());
b.setColor(invertedColor);
additionalFormats[a].format.setForeground(b);
......@@ -243,9 +243,9 @@ void ExpandingDelegate::drawDisplay( QPainter * painter, const QStyleOptionViewI
}
}
// kDebug( 13035 ) << "Highlights for text [" << text << "] col start " << m_currentColumnStart << ":";
// qCDebug(LOG_PART) << "Highlights for text [" << text << "] col start " << m_currentColumnStart << ":";
// foreach (const QTextLayout::FormatRange& fr, additionalFormats)
// kDebug( 13035 ) << fr.start << " len " << fr.length << "foreground" << fr.format.foreground() << "background" << fr.format.background();
// qCDebug(LOG_PART) << fr.start << " len " << fr.length << "foreground" << fr.format.foreground() << "background" << fr.format.background();
layout.setAdditionalFormats(additionalFormats);
......@@ -317,7 +317,7 @@ QList<QTextLayout::FormatRange> ExpandingDelegate::highlightingFromVariantList(c
for (int i = 0; i + 2 < customHighlights.count(); i += 3) {
if (!customHighlights[i].canConvert(QVariant::Int) || !customHighlights[i+1].canConvert(QVariant::Int) || !customHighlights[i+2].canConvert<QTextFormat>()) {
kWarning() << "Unable to convert triple to custom formatting.";
qCWarning(LOG_PART) << "Unable to convert triple to custom formatting.";
continue;
}
......@@ -327,7 +327,7 @@ QList<QTextLayout::FormatRange> ExpandingDelegate::highlightingFromVariantList(c
format.format = customHighlights[i+2].value<QTextFormat>().toCharFormat();
if(!format.format.isValid())
kWarning() << "Format is not valid";
qCWarning(LOG_PART) << "Format is not valid";
ret << format;
}
......
......@@ -24,7 +24,7 @@
#include <QTextDocument>
#include <QAbstractTextDocumentLayout>
#include <QPainter>
#include <kdebug.h>
#include "katepartdebug.h"
#include "expandingwidgetmodel.h"
ExpandingTree::ExpandingTree(QWidget* parent) : QTreeView(parent) {
......
......@@ -23,6 +23,7 @@
#include <QTreeView>
#include <QModelIndex>
#include <QBrush>
#include <QApplication>
#include <ktexteditor/codecompletionmodel.h>
#include <kiconloader.h>
......@@ -30,7 +31,7 @@
#include "kcolorutils.h"
#include "expandingdelegate.h"
#include <qapplication.h>
#include "katepartdebug.h"
QIcon ExpandingWidgetModel::m_expandedIcon;
QIcon ExpandingWidgetModel::m_collapsedIcon;
......@@ -237,7 +238,7 @@ void ExpandingWidgetModel::rowSelected(const QModelIndex& idx_)
}
}
}else{
kDebug( 13035 ) << "ExpandingWidgetModel::rowSelected: Row is already partially expanded";
qCDebug(LOG_PART) << "ExpandingWidgetModel::rowSelected: Row is already partially expanded";
}
}
......@@ -312,7 +313,7 @@ void ExpandingWidgetModel::setExpanded(QModelIndex idx_, bool expanded)
{
QModelIndex idx(firstColumn(idx_));
//kDebug( 13035 ) << "Setting expand-state of row " << idx.row() << " to " << expanded;
//qCDebug(LOG_PART) << "Setting expand-state of row " << idx.row() << " to " << expanded;
if( !idx.isValid() )
return;
......@@ -360,7 +361,7 @@ int ExpandingWidgetModel::basicRowHeight( const QModelIndex& idx_ ) const
ExpandingDelegate* delegate = dynamic_cast<ExpandingDelegate*>( treeView()->itemDelegate(idx) );
if( !delegate || !idx.isValid() ) {
kDebug( 13035 ) << "ExpandingWidgetModel::basicRowHeight: Could not get delegate";
qCDebug(LOG_PART) << "ExpandingWidgetModel::basicRowHeight: Could not get delegate";
return 15;
}
return delegate->basicSizeHint( idx ).height();
......@@ -467,7 +468,7 @@ QList<QVariant> mergeCustomHighlighting( int leftSize, const QList<QVariant>& le
for(int a = 0; a < 2; a++) {
++testIt;
if(testIt == right.constEnd()) {
kWarning() << "Length of input is not multiple of 3";
qCWarning(LOG_PART) << "Length of input is not multiple of 3";
break;
}
}
......@@ -479,7 +480,7 @@ QList<QVariant> mergeCustomHighlighting( int leftSize, const QList<QVariant>& le
++it;
ret << *it;
if(!(*it).value<QTextFormat>().isValid())
kDebug( 13035 ) << "Text-format is invalid";
qCDebug(LOG_PART) << "Text-format is invalid";
++it;
}
}
......@@ -490,17 +491,17 @@ QList<QVariant> mergeCustomHighlighting( int leftSize, const QList<QVariant>& le
QList<QVariant> mergeCustomHighlighting( QStringList strings, QList<QVariantList> highlights, int grapBetweenStrings )
{
if(strings.isEmpty()) {
kWarning() << "List of strings is empty";
qCWarning(LOG_PART) << "List of strings is empty";
return QList<QVariant>();
}
if(highlights.isEmpty()) {
kWarning() << "List of highlightings is empty";
qCWarning(LOG_PART) << "List of highlightings is empty";
return QList<QVariant>();
}
if(strings.count() != highlights.count()) {
kWarning() << "Length of string-list is " << strings.count() << " while count of highlightings is " << highlights.count() << ", should be same";
qCWarning(LOG_PART) << "Length of string-list is " << strings.count() << " while count of highlightings is " << highlights.count() << ", should be same";
return QList<QVariant>();
}
......
......@@ -28,6 +28,7 @@
#include "katecompletionwidget.h"
#include "kateargumenthinttree.h"
#include "katecompletiontree.h"
#include "katepartdebug.h"
using namespace KTextEditor;
......@@ -45,7 +46,7 @@ QModelIndex KateArgumentHintModel::mapToSource( const QModelIndex & index ) cons
KateCompletionModel::ModelRow source = group()->filtered[m_rows[index.row()]].sourceRow();
if( !source.first ) {
kDebug( 13035 ) << "KateArgumentHintModel::data: Row does not exist in source";
qCDebug(LOG_PART) << "KateArgumentHintModel::data: Row does not exist in source";
return QModelIndex();
}
......@@ -89,7 +90,7 @@ KateArgumentHintModel::KateArgumentHintModel( KateCompletionWidget* parent ) : E
QVariant KateArgumentHintModel::data ( const QModelIndex & index, int role ) const {
if( index.row() < 0 || index.row() >= m_rows.count() ) {
//kDebug( 13035 ) << "KateArgumentHintModel::data: index out of bound: " << index.row() << " total filtered: " << m_rows.count();
//qCDebug(LOG_PART) << "KateArgumentHintModel::data: index out of bound: " << index.row() << " total filtered: " << m_rows.count();
return QVariant();
}
......@@ -107,13 +108,13 @@ QVariant KateArgumentHintModel::data ( const QModelIndex & index, int role ) con
}
if( m_rows[index.row()] < 0 || m_rows[index.row()] >= group()->filtered.count() ) {
kDebug( 13035 ) << "KateArgumentHintModel::data: index out of bound: " << m_rows[index.row()] << " total filtered: " << group()->filtered.count();
qCDebug(LOG_PART) << "KateArgumentHintModel::data: index out of bound: " << m_rows[index.row()] << " total filtered: " << group()->filtered.count();
return QVariant();
}
KateCompletionModel::ModelRow source = group()->filtered[m_rows[index.row()]].sourceRow();
if( !source.first ) {
kDebug( 13035 ) << "KateArgumentHintModel::data: Row does not exist in source";
qCDebug(LOG_PART) << "KateArgumentHintModel::data: Row does not exist in source";
return QVariant();
}
......@@ -138,7 +139,7 @@ QVariant KateArgumentHintModel::data ( const QModelIndex & index, int role ) con
QModelIndex sourceIndex = source.second.sibling(source.second.row(), index.column());
if( !sourceIndex.isValid() ) {
kDebug( 13035 ) << "KateArgumentHintModel::data: Source-index is not valid";
qCDebug(LOG_PART) << "KateArgumentHintModel::data: Source-index is not valid";
return QVariant();
}
......
......@@ -72,7 +72,7 @@ void KateArgumentHintTree::dataChanged ( const QModelIndex & topLeft, const QMod
}
void KateArgumentHintTree::currentChanged ( const QModelIndex & current, const QModelIndex & previous ) {
/* kDebug( 13035 ) << "currentChanged()";*/
/* qCDebug(LOG_PART) << "currentChanged()";*/
static_cast<ExpandingWidgetModel*>(model())->rowSelected(current);
QTreeView::currentChanged(current, previous);
}
......@@ -105,7 +105,7 @@ void KateArgumentHintTree::updateGeometry(QRect geom) {
updatingGeometry = true;
if( model()->rowCount(QModelIndex()) == 0 ) {
/* kDebug( 13035 ) << "KateArgumentHintTree:: empty model";*/
/* qCDebug(LOG_PART) << "KateArgumentHintTree:: empty model";*/
hide();
setGeometry(geom);
updatingGeometry = false;
......@@ -165,7 +165,7 @@ void KateArgumentHintTree::updateGeometry(QRect geom) {
setHorizontalScrollBarPolicy( enableScrollBars ? Qt::ScrollBarAlwaysOn : Qt::ScrollBarAlwaysOff );
/* kDebug( 13035 ) << "KateArgumentHintTree::updateGeometry: updating geometry to " << geom;*/
/* qCDebug(LOG_PART) << "KateArgumentHintTree::updateGeometry: updating geometry to " << geom;*/
setGeometry(geom);
if( resized && currentIndex().isValid() )
......
......@@ -28,6 +28,7 @@
#include "kateview.h"
#include "katehighlight.h"
#include "katerenderrange.h"
#include "katepartdebug.h"
#include "katecompletionwidget.h"
#include "katecompletionmodel.h"
......@@ -99,7 +100,7 @@ QList<QTextLayout::FormatRange> KateCompletionDelegate::createHighlighting(const
if( index.column() < m_cachedColumnStarts.size() ) {
m_currentColumnStart = m_cachedColumnStarts[index.column()];
} else {
kWarning() << "Column-count does not match";
qCWarning(LOG_PART) << "Column-count does not match";
}
return m_cachedHighlights;
......@@ -126,7 +127,7 @@ QList<QTextLayout::FormatRange> KateCompletionDelegate::createHighlighting(const
Kate::TextLine thisLine = Kate::TextLine (new Kate::TextLineData(lineContent));
//kDebug( 13035 ) << "About to highlight with mode " << highlightMethod << " text [" << thisLine->string() << "]";
//qCDebug(LOG_PART) << "About to highlight with mode " << highlightMethod << " text [" << thisLine->string() << "]";
if (highlightMethod & KTextEditor::CodeCompletionModel::InternalHighlighting) {
Kate::TextLine previousLine;
......
......@@ -38,6 +38,7 @@
#include "katerenderer.h"
#include "kateconfig.h"
#include "codecompletionmodelcontrollerinterfacev4.h"
#include "katepartdebug.h"
using namespace KTextEditor;
......@@ -106,7 +107,7 @@ void HierarchicalModelHandler::takeRole(const QModelIndex& index) {
m_roleValues[(CodeCompletionModel::ExtraItemDataRoles)v.toInt()] = value;
}
}else{
kDebug( 13035 ) << "Did not return valid GroupRole in hierarchical completion-model";
qCDebug(LOG_PART) << "Did not return valid GroupRole in hierarchical completion-model";
}
}
......@@ -419,20 +420,20 @@ QModelIndex KateCompletionModel::index( int row, int column, const QModelIndex &
return QModelIndex();
if (row >= g->filtered.count()) {
//kWarning() << "Invalid index requested: row " << row << " beyond indivdual range in group " << g;
//qCWarning(LOG_PART) << "Invalid index requested: row " << row << " beyond indivdual range in group " << g;
return QModelIndex();
}
//kDebug( 13035 ) << "Returning index for child " << row << " of group " << g;
//qCDebug(LOG_PART) << "Returning index for child " << row << " of group " << g;
return createIndex(row, column, g);
}
if (row >= m_rowTable.count()) {
//kWarning() << "Invalid index requested: row " << row << " beyond group range.";
//qCWarning(LOG_PART) << "Invalid index requested: row " << row << " beyond group range.";
return QModelIndex();
}
//kDebug( 13035 ) << "Returning index for group " << m_rowTable[row];
//qCDebug(LOG_PART) << "Returning index for group " << m_rowTable[row];
return createIndex(row, column, quintptr (0));
}
......@@ -692,7 +693,7 @@ KateCompletionModel::Group* KateCompletionModel::fetchGroup( int attribute, cons
return m_ungrouped;
int groupingAttribute = groupingAttributes(attribute);
//kDebug( 13035 ) << attribute << " " << groupingAttribute;
//qCDebug(LOG_PART) << attribute << " " << groupingAttribute;
if (m_groupHash.contains(groupingAttribute)) {
if (groupingMethod() & Scope) {
......@@ -782,8 +783,8 @@ KateCompletionModel::Group* KateCompletionModel::fetchGroup( int attribute, cons
bool KateCompletionModel::hasGroups( ) const
{
//kDebug( 13035 ) << "m_groupHash.size()"<<m_groupHash.size();
//kDebug( 13035 ) << "m_rowTable.count()"<<m_rowTable.count();
//qCDebug(LOG_PART) << "m_groupHash.size()"<<m_groupHash.size();
//qCDebug(LOG_PART) << "m_rowTable.count()"<<m_rowTable.count();
// We cannot decide whether there is groups easily. The problem: The code-model can
// be populated with a delay from within a background-thread.
// Proper solution: Ask all attached code-models(Through a new interface) whether they want to use grouping,
......@@ -834,7 +835,7 @@ QModelIndex KateCompletionModel::parent( const QModelIndex & index ) const
int row = m_rowTable.indexOf(g);
if (row == -1) {
kWarning() << "Couldn't find parent for index" << index;
qCWarning(LOG_PART) << "Couldn't find parent for index" << index;
return QModelIndex();
}
......@@ -848,10 +849,10 @@ int KateCompletionModel::rowCount( const QModelIndex & parent ) const
{
if (!parent.isValid()) {
if (hasGroups()) {
//kDebug( 13035 ) << "Returning row count for toplevel " << m_rowTable.count();
//qCDebug(LOG_PART) << "Returning row count for toplevel " << m_rowTable.count();
return m_rowTable.count();
} else {
//kDebug( 13035 ) << "Returning ungrouped row count for toplevel " << m_ungrouped->filtered.count();
//qCDebug(LOG_PART) << "Returning ungrouped row count for toplevel " << m_ungrouped->filtered.count();
return m_ungrouped->filtered.count();
}
}
......@@ -862,7 +863,7 @@ int KateCompletionModel::rowCount( const QModelIndex & parent ) const
if (!g)
return 0;
//kDebug( 13035 ) << "Returning row count for group " << g << " as " << g->filtered.count();
//qCDebug(LOG_PART) << "Returning row count for group " << g << " as " << g->filtered.count();
return g->filtered.count();
}
......@@ -882,7 +883,7 @@ QModelIndex KateCompletionModel::mapToSource( const QModelIndex & proxyIndex ) c
ModelRow source = g->filtered[proxyIndex.row()].sourceRow();
return source.second.sibling(source.second.row(), proxyIndex.column());
}else{
kDebug( 13035 ) << "Invalid proxy-index";
qCDebug(LOG_PART) << "Invalid proxy-index";
}
}
......@@ -934,7 +935,7 @@ void KateCompletionModel::setCurrentCompletion( KTextEditor::CodeCompletionModel
changeType = Narrow;
}
//kDebug( 13035 ) << model << "Old match: " << m_currentMatch[model] << ", new: " << completion << ", type: " << changeType;
//qCDebug(LOG_PART) << model << "Old match: " << m_currentMatch[model] << ", new: " << completion << ", type: " << changeType;
m_currentMatch[model] = completion;
......@@ -956,13 +957,13 @@ void KateCompletionModel::setCurrentCompletion( KTextEditor::CodeCompletionModel
// NOTE: best matches are also updated in resort
resort();
kDebug()<<"needsReset"<<needsReset;
qCDebug(LOG_PART)<<"needsReset"<<needsReset;
if(needsReset)
reset();
clearExpanding(); //We need to do this, or be aware of expanding-widgets while filtering.
emit contentGeometryChanged();
kDebug();
qCDebug(LOG_PART);
}
QString KateCompletionModel::commonPrefixInternal(const QString &forcePrefix) const
......@@ -1116,7 +1117,7 @@ void KateCompletionModel::hideOrShowGroup(Group* g, bool notifyModel)
endRemoveRows();
m_emptyGroups.append(g);
} else {
kWarning() << "Group " << g << " not found in row table!!";
qCWarning(LOG_PART) << "Group " << g << " not found in row table!!";
}
}
......@@ -1170,11 +1171,11 @@ void KateCompletionModel::slotModelReset()
void KateCompletionModel::debugStats()
{
if (!hasGroups())
kDebug( 13035 ) << "Model groupless, " << m_ungrouped->filtered.count() << " items.";
qCDebug(LOG_PART) << "Model groupless, " << m_ungrouped->filtered.count() << " items.";
else {
kDebug( 13035 ) << "Model grouped (" << m_rowTable.count() << " groups):";
qCDebug(LOG_PART) << "Model grouped (" << m_rowTable.count() << " groups):";
foreach (Group* g, m_rowTable)
kDebug( 13035 ) << "Group" << g << "count" << g->filtered.count();
qCDebug(LOG_PART) << "Group" << g << "count" << g->filtered.count();
}
}
......@@ -1276,7 +1277,7 @@ int KateCompletionModel::translateColumn( int sourceColumn ) const
columnMerge += "] ";
}
kDebug( 13035 ) << k_funcinfo << columnMerge;*/
qCDebug(LOG_PART) << k_funcinfo << columnMerge;*/
int c = 0;
foreach (const QList<int>& list, m_columnMerges) {
......@@ -1295,7 +1296,7 @@ int KateCompletionModel::groupingAttributes( int attribute ) const
if (m_groupingMethod & ScopeType) {
if (countBits(attribute & ScopeTypeMask) > 1)
kWarning() << "Invalid completion model metadata: more than one scope type modifier provided.";
qCWarning(LOG_PART) << "Invalid completion model metadata: more than one scope type modifier provided.";
if (attribute & KTextEditor::CodeCompletionModel::GlobalScope)
ret |= KTextEditor::CodeCompletionModel::GlobalScope;
......@@ -1307,7 +1308,7 @@ int KateCompletionModel::groupingAttributes( int attribute ) const
if (m_groupingMethod & AccessType) {
if (countBits(attribute & AccessTypeMask) > 1)
kWarning() << "Invalid completion model metadata: more than one access type modifier provided.";
qCWarning(LOG_PART) << "Invalid completion model metadata: more than one access type modifier provided.";
if (attribute & KTextEditor::CodeCompletionModel::Public)
ret |= KTextEditor::CodeCompletionModel::Public;
......@@ -1325,7 +1326,7 @@ int KateCompletionModel::groupingAttributes( int attribute ) const
if (m_groupingMethod & ItemType) {
if (countBits(attribute & ItemTypeMask) > 1)
kWarning() << "Invalid completion model metadata: more than one item type modifier provided.";
qCWarning(LOG_PART) << "Invalid completion model metadata: more than one item type modifier provided.";
if (attribute & KTextEditor::CodeCompletionModel::Namespace)
ret |= KTextEditor::CodeCompletionModel::Namespace;
......@@ -1457,7 +1458,7 @@ bool KateCompletionModel::Item::operator <( const Item & rhs ) const
{
int ret = 0;
//kDebug( 13035 ) << c1 << " c/w " << c2 << " -> " << (model->isSortingReverse() ? ret > 0 : ret < 0) << " (" << ret << ")";
//qCDebug(LOG_PART) << c1 << " c/w " << c2 << " -> " << (model->isSortingReverse() ? ret > 0 : ret < 0) << " (" << ret << ")";
const bool isBad = m_sourceRow.second.data(CodeCompletionModel::UnimportantItemRole).toBool();
const bool otherIsBad = rhs.m_sourceRow.second.data(CodeCompletionModel::UnimportantItemRole).toBool();
......
......@@ -31,6 +31,7 @@
#include "kateview.h"
#include "katerenderer.h"
#include "kateconfig.h"
#include "katepartdebug.h"
#include "katecompletionwidget.h"
#include "katecompletiondelegate.h"
......@@ -146,7 +147,7 @@ void KateCompletionTree::resizeColumns(bool firstShow, bool forceResize)
while( current.isValid() && currentYPos < height() )
{
// kDebug() << current.row() << "out of" << model()->rowCount(current.parent()) << "in" << current.parent().data(Qt::DisplayRole);
// qCDebug(LOG_PART) << current.row() << "out of" << model()->rowCount(current.parent()) << "in" << current.parent().data(Qt::DisplayRole);
currentYPos += sizeHintForIndex(current).height();
// itemDelegate()->sizeHint(QStyleOptionViewItem(), current).isValid() && itemDelegate()->sizeHint(QStyleOptionViewItem(), current).intersects(visibleViewportRect)
changed = true;
......@@ -154,11 +155,11 @@ void KateCompletionTree::resizeColumns(bool firstShow, bool forceResize)
for( int a = 0; a < numColumns; a++ )
{
QSize s = sizeHintForIndex (current.sibling(current.row(), a));
// kDebug() << "size-hint for" << current.row() << a << ":" << s << current.sibling(current.row(), a).data(Qt::DisplayRole);
// qCDebug(LOG_PART) << "size-hint for" << current.row() << a << ":" << s << current.sibling(current.row(), a).data(Qt::DisplayRole);
if( s.width() > columnSize[a] && s.width() < 2000 )
columnSize[a] = s.width();
else if( s.width() > 2000 )
kDebug( 13035 ) << "got invalid size-hint of width " << s.width();
qCDebug(LOG_PART) << "got invalid size-hint of width " << s.width();
}
QModelIndex oldCurrent = current;
......@@ -232,7 +233,7 @@ void KateCompletionTree::resizeColumns(bool firstShow, bool forceResize)
for( int n = 0; n < numColumns; n++ ) {
setColumnWidth(n, columnSize[n]);
}
// kDebug() << "resizing viewport to" << totalColumnsWidth;
// qCDebug(LOG_PART) << "resizing viewport to" << totalColumnsWidth;
viewport()->resize( totalColumnsWidth, viewport()->height() );
}
}
......@@ -252,7 +253,7 @@ void KateCompletionTree::resizeColumns(bool firstShow, bool forceResize)
if(maximumResize > 0 || forceResize || oldIndentWidth != newIndentWidth) {
// kDebug() << geometry() << "newWidth" << newWidth << "current width" << width() << "target width" << newWidth + scrollBarWidth;
// qCDebug(LOG_PART) << geometry() << "newWidth" << newWidth << "current width" << width() << "target width" << newWidth + scrollBarWidth;
if((newWidth + scrollBarWidth) != width() && originalViewportWidth != totalColumnsWidth)
{
......@@ -260,13 +261,13 @@ void KateCompletionTree::resizeColumns(bool firstShow, bool forceResize)
resize(newWidth + scrollBarWidth, widget()->height()- (2*widget()->frameWidth()));
}
// kDebug() << "created geometry:" << widget()->geometry() << geometry() << "newWidth" << newWidth << "viewport" << viewport()->width();
// qCDebug(LOG_PART) << "created geometry:" << widget()->geometry() << geometry() << "newWidth" << newWidth << "viewport" << viewport()->width();
if( viewport()->width() > totalColumnsWidth ) //Set the size of the last column to fill the whole rest of the widget
setColumnWidth(numColumns-1, viewport()->width() - columnViewportPosition(numColumns-1));
/* for(int a = 0; a < numColumns; ++a)
kDebug() << "column" << a << columnWidth(a) << "target:" << columnSize[a];*/
qCDebug(LOG_PART) << "column" << a << columnWidth(a) << "target:" << columnSize[a];*/
if (oldIndentWidth != newIndentWidth)
if(widget()->updatePosition() && !forceResize) {
......
This diff is collapsed.
......@@ -57,7 +57,7 @@
#include <kvbox.h>
#include <QtWidgets/QCheckBox>
#include <kdebug.h>
#include "katepartdebug.h"
//END
/// Amount of characters the document may have to enable automatic invocation (1MB)
......@@ -382,7 +382,7 @@ void KateWordCompletionView::completeForwards()
// Pop up the editors completion list if applicable
void KateWordCompletionView::popupCompletionList()
{
kDebug( 13040 ) << "entered ...";
qCDebug(LOG_PART) << "entered ...";
KTextEditor::Range r = range();
KTextEditor::CodeCompletionInterface *cci = qobject_cast<KTextEditor::CodeCompletionInterface *>( m_view );
......@@ -391,7 +391,7 @@ void KateWordCompletionView::popupCompletionList()
m_dWCompletionModel->saveMatches( m_view, r );
kDebug( 13040 ) << "after save matches ...";
qCDebug(LOG_PART) << "after save matches ...";
if ( ! m_dWCompletionModel->rowCount(QModelIndex()) ) return;
......@@ -433,7 +433,7 @@ void KateWordCompletionView::complete( bool fw )
if ( d->dcRange.isValid() )
{
//kDebug( 13040 )<<"CONTINUE "<<d->dcRange;
//qCDebug(LOG_PART)<<"CONTINUE "<<d->dcRange;
// this is a repeted activation
// if we are back to where we started, reset.
......@@ -460,7 +460,7 @@ void KateWordCompletionView::complete( bool fw )
}
else // new completion, reset all
{
//kDebug( 13040 )<<"RESET FOR NEW";
//qCDebug(LOG_PART)<<"RESET FOR NEW";
d->dcRange = r;
d->liRange->setRange( KTextEditor::Range::invalid() );
d->dcCursor = r.start();
......@@ -478,14 +478,14 @@ void KateWordCompletionView::complete( bool fw )
while ( true )
{
//kDebug( 13040 )<<"SEARCHING FOR "<<d->re.pattern()<<" "<<ln<<" at "<<d->dcCursor;
//qCDebug(LOG_PART)<<"SEARCHING FOR "<<d->re.pattern()<<" "<<ln<<" at "<<d->dcCursor;
pos = fw ?
d->re.indexIn( ln, d->dcCursor.column() ) :
d->re.lastIndexIn( ln, d->dcCursor.column() );
if ( pos > -1 ) // we matched a word
{
//kDebug( 13040 )<<"USABLE MATCH";
//qCDebug(LOG_PART)<<"USABLE MATCH";
QString m = d->re.cap( 1 );
if ( m != doc->text( *d->liRange ) && (d->dcCursor.line() != d->dcRange.start().line() || pos != d->dcRange.start().column() ) )
{
......@@ -507,7 +507,7 @@ void KateWordCompletionView::complete( bool fw )
// equal to last one, continue
else
{
//kDebug( 13040 )<<"SKIPPING, EQUAL MATCH";
//qCDebug(LOG_PART)<<"SKIPPING, EQUAL MATCH";
d->dcCursor.setColumn( pos ); // for next try
if ( fw )
......@@ -538,7 +538,7 @@ void KateWordCompletionView::complete( bool fw )
else // no match
{
//kDebug( 13040 )<<"NO MATCH";
//qCDebug(LOG_PART)<<"NO MATCH";
if ( (! fw && d->dcCursor.line() == 0 ) || ( fw && d->dcCursor.line() >= doc->lines() ) )
{
KNotification::beep();
......
......@@ -34,7 +34,7 @@
#include <QtCore/QObject>
#include <QtCore/QList>
#include <kdebug.h>
#include "katepartdebug.h"
class KATEPART_TESTS_EXPORT KateWordCompletionModel : public KTextEditor::CodeCompletionModel2, public KTextEditor::CodeCompletionModelControllerInterface4
{
......
......@@ -71,7 +71,7 @@
#include <kcolordialog.h>