Commit be365be9 authored by Pino Toscano's avatar Pino Toscano

Slightly improve some debug messages

- remove endl and '\n', since they are added automatically
- remove extra spaces
- remove extra quoting (done automatically for QString)
- raise some khcDebug to khcWarning, since they are not usual situations
- other general fixups
parent ea7cb1b9
......@@ -245,14 +245,13 @@ void DocMetaInfo::startTraverseEntry( DocEntry *entry,
{
if ( !traverser )
{
khcDebug() << "DocMetaInfo::startTraverseEntry(): ERROR. No Traverser."
<< endl;
khcWarning() << "DocMetaInfo::startTraverseEntry(): ERROR. No Traverser.";
return;
}
if ( !entry )
{
khcDebug() << "DocMetaInfo::startTraverseEntry(): no entry.";
khcWarning() << "DocMetaInfo::startTraverseEntry(): no entry.";
endTraverseEntries( traverser );
return;
}
......
......@@ -146,7 +146,7 @@ void History::updateCurrentEntry( View *view )
}
khcDebug() << "History::updateCurrentEntry(): " << view->title()
<< " (URL: " << url.url() << ")" << endl;
<< " (URL: " << url.url() << ")";
current->url = url;
current->title = view->title();
......@@ -217,7 +217,7 @@ void History::goHistory( int steps )
current = *newPos;
if ( !current ) {
khcWarning() << "No History entry at position " << newPos - m_entries.begin() << endl;
khcWarning() << "No History entry at position " << newPos - m_entries.begin();
return;
}
......
......@@ -367,7 +367,7 @@ void Navigator::slotItemSelected( QTreeWidgetItem *currentItem )
NavigatorItem *item = static_cast<NavigatorItem *>( currentItem );
khcDebug() << item->entry()->name() << endl;
khcDebug() << item->entry()->name();
item->setExpanded( !item->isExpanded() );
......
......@@ -73,8 +73,7 @@ void NavigatorAppGroupItem::itemExpanded(bool open)
if ( open && (childCount() == 0) && !mPopulated )
{
khcDebug() << "NavigatorAppGroupItem::itemExpanded(" << this << ", "
<< mRelpath << ")" << endl;
khcDebug() << " -> populate:" << this << "-" << mRelpath;
populate();
}
NavigatorItem::itemExpanded(open);
......@@ -86,7 +85,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
KServiceGroup::Ptr root = KServiceGroup::group(mRelpath);
if ( !root ) {
khcWarning() << "No Service groups\n";
khcWarning() << "No Service groups for" << mRelpath;
return;
}
KServiceGroup::List list = root->entries();
......
......@@ -54,7 +54,7 @@ PluginTraverser::PluginTraverser( Navigator *navigator, NavigatorItem *parent )
void PluginTraverser::process( DocEntry *entry )
{
if ( !mListView && !mParentItem ) {
khcDebug() << "ERROR! Neither mListView nor mParentItem is set.";
khcWarning() << "ERROR! Neither mListView nor mParentItem is set.";
return;
}
......@@ -114,7 +114,7 @@ DocEntryTraverser *PluginTraverser::createChild( DocEntry * /*entry*/ )
if ( mCurrentItem ) {
return new PluginTraverser( mNavigator, mCurrentItem );
}
khcDebug() << "ERROR! mCurrentItem is not set.";
khcWarning() << "ERROR! mCurrentItem is not set.";
return 0;
}
......
......@@ -63,14 +63,14 @@ void ScrollKeeperTreeBuilder::build( NavigatorItem *parent )
proc.setOutputChannelMode(KProcess::OnlyStdoutChannel);
proc.start();
if ( !proc.waitForFinished() ) {
khcDebug() << "Could not execute scrollkeeper-get-content-list";
khcWarning() << "Could not execute scrollkeeper-get-content-list";
return;
}
mContentsList = proc.readAllStandardOutput().trimmed();
if (!QFile::exists(mContentsList)) {
khcDebug() << "Scrollkeeper contents file '" << mContentsList
<< "' does not exist." << endl;
khcWarning() << "Scrollkeeper contents file" << mContentsList
<< "does not exist.";
return;
}
......
......@@ -17,16 +17,14 @@ SearchTraverser::SearchTraverser( SearchEngine *engine, int level ) :
mMaxLevel( 999 ), mEngine( engine), mLevel( level ), mResultsPtr( &mResults )
{
#if 0
khcDebug() << "SearchTraverser(): " << mLevel
<< " 0x" << QString::number( int( this ), 16 ) << endl;
khcDebug() << "SearchTraverser():" << mLevel << this;
#endif
}
SearchTraverser::~SearchTraverser()
{
#if 0
khcDebug() << "~SearchTraverser(): " << mLevel
<< " 0x" << QString::number( int( this ), 16 ) << endl;
khcDebug() << "~SearchTraverser():" << mLevel << this;
#endif
}
......@@ -37,16 +35,15 @@ void SearchTraverser::process( DocEntry * )
void SearchTraverser::startProcess( DocEntry *entry )
{
// khcDebug() << "SearchTraverser::startProcess(): " << entry->name() << " "
// << "SEARCH: '" << entry->search() << "'" << endl;
// khcDebug() << "SearchTraverser::startProcess():" << entry->name()
// << "SEARCH:" << entry->search();
if ( !mEngine->canSearch( entry ) || !entry->searchEnabled() ) {
mNotifyee->endProcess( entry, this );
return;
}
// khcDebug() << "SearchTraverser::startProcess(): " << entry->identifier()
// << endl;
// khcDebug() << "SearchTraverser::startProcess():" << entry->identifier();
SearchHandler *handler = mEngine->handler( entry->documentType() );
......@@ -90,8 +87,7 @@ void SearchTraverser::disconnectHandler( SearchHandler *handler )
QMap<SearchHandler *,int>::Iterator it;
it = mConnectCount.find( handler );
if ( it == mConnectCount.end() ) {
khcWarning() << "SearchTraverser::disconnectHandler() handler not connected."
<< endl;
khcWarning() << "SearchTraverser::disconnectHandler() handler not connected.";
} else {
int count = *it;
--count;
......@@ -144,8 +140,7 @@ void SearchTraverser::deleteTraverser()
void SearchTraverser::showSearchError( SearchHandler *handler, DocEntry *entry, const QString &error )
{
// khcDebug() << "SearchTraverser::showSearchError(): " << entry->name()
// << endl;
// khcDebug() << "SearchTraverser::showSearchError():" << entry->name();
mResultsPtr->append( qMakePair( entry, error ) );
......@@ -158,8 +153,7 @@ void SearchTraverser::showSearchError( SearchHandler *handler, DocEntry *entry,
void SearchTraverser::showSearchResult( SearchHandler *handler, DocEntry *entry, const QString &result )
{
// khcDebug() << "SearchTraverser::showSearchResult(): " << entry->name()
// << endl;
// khcDebug() << "SearchTraverser::showSearchResult():" << entry->name();
mResultsPtr->append( qMakePair( entry, result ) );
......
......@@ -16,9 +16,9 @@ class MyTraverser : public DocEntryTraverser
qDebug() << mIndent.constData() << entry->name() << " - WEIGHT: " << entry->weight();
#if 0
if ( entry->parent() ) qDebug() << mIndent << " PARENT: "
<< entry->parent()->name() << endl;
<< entry->parent()->name();
if ( entry->nextSibling() ) qDebug() << mIndent << " NEXT: "
<< entry->nextSibling()->name() << endl;
<< entry->nextSibling()->name();
#endif
}
......
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