Commit 1c1cf47c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Autogenerate debug category + create categories file

parent f74f2a91
......@@ -17,6 +17,7 @@ include(ECMMarkNonGuiExecutable)
include(ECMOptionalAddSubdirectory)
include(FeatureSummary)
include(CheckIncludeFiles)
include(ECMQtDeclareLoggingCategory)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
DBus
......@@ -67,7 +68,6 @@ add_subdirectory( templates )
########### next target ###############
set(khelpcenter_KDEINIT_SRCS
khc_debug.cpp
navigator.cpp
navigatoritem.cpp
navigatorappitem.cpp
......@@ -91,6 +91,7 @@ set(khelpcenter_KDEINIT_SRCS
scrollkeepertreebuilder.cpp
bookmarkowner.cpp
searchhandler.cpp )
ecm_qt_declare_logging_category(khelpcenter_KDEINIT_SRCS HEADER khc_debug.h IDENTIFIER KHC_LOG CATEGORY_NAME org.kde.khelpcenter)
kconfig_add_kcfg_files(khelpcenter_KDEINIT_SRCS prefs.kcfgc )
# kf5_add_app_icon(khelpcenter_KDEINIT_SRCS "${KDE4_INSTALL_DIR}/share/icons/oxygen/*/apps/help-browser.png")
......@@ -112,5 +113,6 @@ install( FILES table-of-contents.xslt glossary.xslt DESTINATION ${DATA_INSTALL_D
install( FILES khelpcenterui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/khelpcenter )
install( FILES khelpcenter.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
install( FILES org.kde.Help.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
install( FILES khelpcenter.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -326,15 +326,15 @@ bool DocEntry::isSearchable() const
void DocEntry::dump() const
{
khcDebug() << " <docentry>";
khcDebug() << " <name>" << mName << "</name>";
khcDebug() << " <searchmethod>" << mSearchMethod << "</searchmethod>";
khcDebug() << " <search>" << mSearch << "</search>";
khcDebug() << " <indexer>" << mIndexer << "</indexer>";
khcDebug() << " <indextestfile>" << mIndexTestFile << "</indextestfile>";
khcDebug() << " <icon>" << mIcon << "</icon>";
khcDebug() << " <url>" << mUrl << "</url>";
khcDebug() << " <documenttype>" << mDocumentType << "</documenttype>";
khcDebug() << " </docentry>";
qCDebug(KHC_LOG) << " <docentry>";
qCDebug(KHC_LOG) << " <name>" << mName << "</name>";
qCDebug(KHC_LOG) << " <searchmethod>" << mSearchMethod << "</searchmethod>";
qCDebug(KHC_LOG) << " <search>" << mSearch << "</search>";
qCDebug(KHC_LOG) << " <indexer>" << mIndexer << "</indexer>";
qCDebug(KHC_LOG) << " <indextestfile>" << mIndexTestFile << "</indextestfile>";
qCDebug(KHC_LOG) << " <icon>" << mIcon << "</icon>";
qCDebug(KHC_LOG) << " <url>" << mUrl << "</url>";
qCDebug(KHC_LOG) << " <documenttype>" << mDocumentType << "</documenttype>";
qCDebug(KHC_LOG) << " </docentry>";
}
// vim:ts=2:sw=2:et
......@@ -45,14 +45,14 @@ DocMetaInfo *DocMetaInfo::self()
DocMetaInfo::DocMetaInfo()
{
khcDebug() << "DocMetaInfo()";
qCDebug(KHC_LOG) << "DocMetaInfo()";
mRootEntry.setName( i18n("Top-Level Documentation") );
}
DocMetaInfo::~DocMetaInfo()
{
khcDebug() << "~DocMetaInfo()";
qCDebug(KHC_LOG) << "~DocMetaInfo()";
DocEntry::List::ConstIterator it;
for( it = mDocEntries.constBegin(); it != mDocEntries.constEnd(); ++it )
......@@ -135,7 +135,7 @@ QString DocMetaInfo::languageName( const QString &langcode )
QString cfgfile = QStandardPaths::locate( QStandardPaths::GenericDataLocation, QStringLiteral( "locale/%1/kf5_entry.desktop" ).arg( langcode ) );
khcDebug() << "-- langcode: " << langcode << " cfgfile: " << cfgfile;
qCDebug(KHC_LOG) << "-- langcode: " << langcode << " cfgfile: " << cfgfile;
KConfig _cfg( cfgfile, KConfig::SimpleConfig );
KConfigGroup cfg(&_cfg, "KCM Locale" );
......@@ -160,7 +160,7 @@ void DocMetaInfo::scanMetaInfo( bool force )
}
for( it = metaInfos.constBegin(); it != metaInfos.constEnd(); ++it)
{
khcDebug() << "DocMetaInfo::scanMetaInfo(): scanning " << *it;
qCDebug(KHC_LOG) << "DocMetaInfo::scanMetaInfo(): scanning " << *it;
scanMetaInfoDir( *it, &mRootEntry );
}
......@@ -237,7 +237,7 @@ void DocMetaInfo::traverseEntry( DocEntry *entry, DocEntryTraverser *traverser )
void DocMetaInfo::startTraverseEntries( DocEntryTraverser *traverser )
{
khcDebug() << "DocMetaInfo::startTraverseEntries()";
qCDebug(KHC_LOG) << "DocMetaInfo::startTraverseEntries()";
traverser->setNotifyee( this );
startTraverseEntry( &mRootEntry, traverser );
}
......@@ -247,13 +247,13 @@ void DocMetaInfo::startTraverseEntry( DocEntry *entry,
{
if ( !traverser )
{
khcWarning() << "DocMetaInfo::startTraverseEntry(): ERROR. No Traverser.";
qCWarning(KHC_LOG) << "DocMetaInfo::startTraverseEntry(): ERROR. No Traverser.";
return;
}
if ( !entry )
{
khcWarning() << "DocMetaInfo::startTraverseEntry(): no entry.";
qCWarning(KHC_LOG) << "DocMetaInfo::startTraverseEntry(): no entry.";
endTraverseEntries( traverser );
return;
}
......@@ -301,11 +301,11 @@ void DocMetaInfo::endProcess( DocEntry *entry, DocEntryTraverser *traverser )
void DocMetaInfo::endTraverseEntries( DocEntryTraverser *traverser )
{
khcDebug() << "DocMetaInfo::endTraverseEntries()";
qCDebug(KHC_LOG) << "DocMetaInfo::endTraverseEntries()";
if ( !traverser )
{
khcDebug() << " no more traversers.";
qCDebug(KHC_LOG) << " no more traversers.";
return;
}
......
......@@ -159,7 +159,7 @@ void Glossary::rebuildGlossaryCache()
meinproc->start();
if (!meinproc->waitForStarted())
{
khcWarning() << "could not start process" << meinproc->program();
qCWarning(KHC_LOG) << "could not start process" << meinproc->program();
if (mainWindow && !m_alreadyWarned)
{
; // add warning message box with don't display again option
......@@ -177,8 +177,8 @@ void Glossary::meinprocFinished( int exitCode, QProcess::ExitStatus exitStatus )
if (exitStatus != QProcess::NormalExit || exitCode != 0)
{
khcWarning() << "running" << meinproc->program() << "failed with exitCode" << exitCode;
khcWarning() << "stderr output:" << meinproc->readAllStandardError();
qCWarning(KHC_LOG) << "running" << meinproc->program() << "failed with exitCode" << exitCode;
qCWarning(KHC_LOG) << "stderr output:" << meinproc->readAllStandardError();
if (mainWindow && !m_alreadyWarned)
{
; // add warning message box with don't display again option
......
......@@ -70,7 +70,7 @@ QString GrantleeFormatter::Private::format( Grantlee::Template t, Grantlee::Cont
t->render( &stream, ctx );
if ( t->error() )
{
khcWarning() << "GrantleeFormatter rendering error:" << t->errorString();
qCWarning(KHC_LOG) << "GrantleeFormatter rendering error:" << t->errorString();
}
return result;
......
......@@ -109,7 +109,7 @@ void History::installMenuBarHook( KXmlGuiWindow *mainWindow )
void History::createEntry()
{
khcDebug() << "History::createEntry()";
qCDebug(KHC_LOG) << "History::createEntry()";
// First, remove any forward history
if (m_entries_current!=m_entries.end())
......@@ -141,11 +141,11 @@ void History::updateCurrentEntry( View *view )
current->view = view;
if ( url.isEmpty() ) {
khcDebug() << "History::updateCurrentEntry(): internal url";
qCDebug(KHC_LOG) << "History::updateCurrentEntry(): internal url";
url = view->internalUrl();
}
khcDebug() << "History::updateCurrentEntry(): " << view->title()
qCDebug(KHC_LOG) << "History::updateCurrentEntry(): " << view->title()
<< " (URL: " << url.url() << ")";
current->url = url;
......@@ -162,33 +162,33 @@ void History::updateActions()
void History::back()
{
khcDebug() << "History::back()";
qCDebug(KHC_LOG) << "History::back()";
goHistoryActivated( -1 );
}
void History::backActivated( QAction *action )
{
int id = action->data().toInt();
khcDebug() << "History::backActivated(): id = " << id;
qCDebug(KHC_LOG) << "History::backActivated(): id = " << id;
goHistoryActivated( -( id + 1 ) );
}
void History::forward()
{
khcDebug() << "History::forward()";
qCDebug(KHC_LOG) << "History::forward()";
goHistoryActivated( 1 );
}
void History::forwardActivated( QAction *action )
{
int id = action->data().toInt();
khcDebug() << "History::forwardActivated(): id = " << id;
qCDebug(KHC_LOG) << "History::forwardActivated(): id = " << id;
goHistoryActivated( id + 1 );
}
void History::goHistoryActivated( int steps )
{
khcDebug() << "History::goHistoryActivated(): m_goBuffer = " << m_goBuffer;
qCDebug(KHC_LOG) << "History::goHistoryActivated(): m_goBuffer = " << m_goBuffer;
if ( m_goBuffer )
return;
m_goBuffer = steps;
......@@ -197,7 +197,7 @@ void History::goHistoryActivated( int steps )
void History::goHistoryDelayed()
{
khcDebug() << "History::goHistoryDelayed(): m_goBuffer = " << m_goBuffer;
qCDebug(KHC_LOG) << "History::goHistoryDelayed(): m_goBuffer = " << m_goBuffer;
if ( !m_goBuffer )
return;
int steps = m_goBuffer;
......@@ -207,7 +207,7 @@ void History::goHistoryDelayed()
void History::goHistory( int steps )
{
khcDebug() << "History::goHistory(): " << steps;
qCDebug(KHC_LOG) << "History::goHistory(): " << steps;
// If current entry is empty remove it.
Entry *current = *m_entries_current;
......@@ -217,25 +217,25 @@ void History::goHistory( int steps )
current = *newPos;
if ( !current ) {
khcWarning() << "No History entry at position " << newPos - m_entries.begin();
qCWarning(KHC_LOG) << "No History entry at position " << newPos - m_entries.begin();
return;
}
if ( !current->view ) {
khcWarning() << "Empty history entry." ;
qCWarning(KHC_LOG) << "Empty history entry." ;
return;
}
m_entries_current = newPos;
if ( current->search ) {
khcDebug() << "History::goHistory(): search";
qCDebug(KHC_LOG) << "History::goHistory(): search";
current->view->lastSearch();
return;
}
if ( current->url.scheme() == QLatin1String("khelpcenter") ) {
khcDebug() << "History::goHistory(): internal";
qCDebug(KHC_LOG) << "History::goHistory(): internal";
emit goInternalUrl( current->url );
return;
}
......@@ -314,10 +314,10 @@ void History::goMenuActivated( QAction* action )
int index = goMenu->actions().indexOf(action) - m_goMenuIndex + 1;
if ( index > 0 )
{
khcDebug() << "Item clicked has index " << index;
qCDebug(KHC_LOG) << "Item clicked has index " << index;
// -1 for one step back, 0 for don't move, +1 for one step forward, etc.
int steps = ( m_goMenuHistoryStartPos+1 ) - index - m_goMenuHistoryCurrentPos; // make a drawing to understand this :-)
khcDebug() << "Emit activated with steps = " << steps;
qCDebug(KHC_LOG) << "Emit activated with steps = " << steps;
goHistory( steps );
}
}
......@@ -378,7 +378,7 @@ bool History::canGoForward() const
void History::dumpHistory() const {
for(EntryList::const_iterator it = m_entries.constBegin() ; it!=m_entries.constEnd() ; ++it) {
khcDebug() << (*it)->title << (*it)->url << (it==EntryList::const_iterator(m_entries_current) ? "current" : "" ) ;
qCDebug(KHC_LOG) << (*it)->title << (*it)->url << (it==EntryList::const_iterator(m_entries_current) ? "current" : "" ) ;
}
}
......
......@@ -54,7 +54,7 @@ InfoCategoryItem::InfoCategoryItem( NavigatorItem *parent, const QString &text )
setAutoDeleteDocEntry( true );
setExpanded( false );
setIcon( 0, QIcon::fromTheme( "help-contents" ) );
// khcDebug() << "Got category: " << text;
// qCDebug(KHC_LOG) << "Got category: " << text;
}
void InfoCategoryItem::itemExpanded( bool open )
......@@ -70,7 +70,7 @@ InfoNodeItem::InfoNodeItem( InfoCategoryItem *parent, const QString &text )
: NavigatorItem( new DocEntry( text ), parent )
{
setAutoDeleteDocEntry( true );
// khcDebug() << "Created info node item: " << text;
// qCDebug(KHC_LOG) << "Created info node item: " << text;
}
InfoTree::InfoTree( QObject *parent )
......@@ -81,7 +81,7 @@ InfoTree::InfoTree( QObject *parent )
void InfoTree::build( NavigatorItem *parent )
{
khcDebug() << "Populating info tree.";
qCDebug(KHC_LOG) << "Populating info tree.";
m_parentItem = parent;
......@@ -111,7 +111,7 @@ void InfoTree::build( NavigatorItem *parent )
void InfoTree::parseInfoDirFile( const QString &infoDirFileName )
{
khcDebug() << "Parsing info dir file " << infoDirFileName;
qCDebug(KHC_LOG) << "Parsing info dir file " << infoDirFileName;
QFile infoDirFile( infoDirFileName );
if ( !infoDirFile.open( QIODevice::ReadOnly ) )
......
/*
This file is part of the KDE Help Center
Copyright (c) 2016 Pino Toscano <pino@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA
*/
#include "khc_debug.h"
Q_LOGGING_CATEGORY( KHC_LOG, "org.kde.khelpcenter", QtWarningMsg )
/*
This file is part of the KDE Help Center
Copyright (c) 2016 Pino Toscano <pino@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA
*/
#ifndef KHC_DEBUG_H
#define KHC_DEBUG_H
#include <QLoggingCategory>
#include <QDebug>
Q_DECLARE_LOGGING_CATEGORY(KHC_LOG)
#define khcCritical() qCCritical(KHC_LOG)
#define khcDebug() qCDebug(KHC_LOG)
#define khcInfo() qCInfo(KHC_LOG)
#define khcWarning() qCWarning(KHC_LOG)
#endif
org.kde.khelpcenter KHelpCenter (main application)
org.kde.khelpcenter.xapian.cachereader KHelpCenter (Xapian cache reader)
org.kde.khelpcenter.xapian.htmltextdump KHelpCenter (Xapian HTML text dump)
org.kde.khelpcenter.xapian.common KHelpCenter (Xapian common)
org.kde.khelpcenter.xapian.indexer KHelpCenter (Xapian indexer)
org.kde.khelpcenter.xapian.search KHelpCenter (Xapian search)
org.kde.khelpcenter khelpcenter IDENTIFIER [KHC_LOG]
......@@ -330,7 +330,7 @@ void MainWindow::slotOpenURLRequest( const QUrl &url,
const KParts::OpenUrlArguments &args,
const KParts::BrowserArguments &browserArgs )
{
khcDebug() << url.url();
qCDebug(KHC_LOG) << url.url();
mNavigator->selectItem( url );
viewUrl( url, args, browserArgs );
......
......@@ -169,7 +169,7 @@ void Navigator::insertPlugins()
void Navigator::insertParentAppDocs( const QString &name, NavigatorItem *topItem )
{
khcDebug() << "Requested plugin documents for ID " << name;
qCDebug(KHC_LOG) << "Requested plugin documents for ID " << name;
KServiceGroup::Ptr grp = KServiceGroup::childGroup( name );
if ( !grp )
......@@ -188,7 +188,7 @@ void Navigator::insertParentAppDocs( const QString &name, NavigatorItem *topItem
void Navigator::insertKCMDocs( const QString &name, NavigatorItem *topItem, const QString &type )
{
khcDebug() << "Requested KCM documents for ID" << name;
qCDebug(KHC_LOG) << "Requested KCM documents for ID" << name;
QString systemsettingskontrolconstraint = "[X-KDE-System-Settings-Parent-Category] != ''";
QString konquerorcontrolconstraint = "[X-KDE-PluginKeyword] == 'khtml_general'\
or [X-KDE-PluginKeyword] == 'performance'\
......@@ -240,7 +240,7 @@ History no X-KDE-PluginKeyword in kcmhistory.desktop
void Navigator::insertIOSlaveDocs( const QString &name, NavigatorItem *topItem )
{
khcDebug() << "Requested IOSlave documents for ID" << name;
qCDebug(KHC_LOG) << "Requested IOSlave documents for ID" << name;
QStringList list = KProtocolInfo::protocols();
list.sort();
......@@ -293,7 +293,7 @@ void Navigator::insertScrollKeeperDocs( NavigatorItem *topItem )
void Navigator::selectItem( const QUrl &url )
{
khcDebug() << "Navigator::selectItem(): " << url.url();
qCDebug(KHC_LOG) << "Navigator::selectItem(): " << url.url();
if ( url.url() == "khelpcenter:home" ) {
clearSelection();
......@@ -316,7 +316,7 @@ void Navigator::selectItem( const QUrl &url )
if ( item && mSelected ) {
QUrl currentURL ( item->entry()->url() );
if ( (currentURL == url) || (currentURL == alternativeURL) ) {
khcDebug() << "URL already shown.";
qCDebug(KHC_LOG) << "URL already shown.";
return;
}
}
......@@ -367,7 +367,7 @@ void Navigator::slotItemSelected( QTreeWidgetItem *currentItem )
NavigatorItem *item = static_cast<NavigatorItem *>( currentItem );
khcDebug() << item->entry()->name();
qCDebug(KHC_LOG) << item->entry()->name();
item->setExpanded( !item->isExpanded() );
......@@ -491,7 +491,7 @@ QString Navigator::createChildrenList( QTreeWidgetItem *child, int level )
void Navigator::slotSearch()
{
khcDebug() << "Navigator::slotSearch()";
qCDebug(KHC_LOG) << "Navigator::slotSearch()";
if ( mIndexingProc ) return;
......@@ -502,8 +502,8 @@ void Navigator::slotSearch()
int pages = mSearchWidget->pages();
QStringList scope = mSearchWidget->scope();
khcDebug() << "Navigator::slotSearch() words: " << words;
khcDebug() << "Navigator::slotSearch() scope: " << scope;
qCDebug(KHC_LOG) << "Navigator::slotSearch() words: " << words;
qCDebug(KHC_LOG) << "Navigator::slotSearch() scope: " << scope;
if ( words.isEmpty() || scope.isEmpty() ) return;
......@@ -533,7 +533,7 @@ void Navigator::slotSearchFinished()
mSearchButton->setEnabled(true);
QApplication::restoreOverrideCursor();
khcDebug() << "Search finished.";
qCDebug(KHC_LOG) << "Search finished.";
}
void Navigator::checkSearchButton()
......@@ -633,12 +633,12 @@ void Navigator::slotDoIndexWork()
return slotDoIndexWork();
}
if ( !handler->checkPaths( &error ) ) {
khcWarning() << "Indexing path error for" << entry->name() << ":" << error;
qCWarning(KHC_LOG) << "Indexing path error for" << entry->name() << ":" << error;
return slotDoIndexWork();
}
QString indexer = handler->indexCommand( entry->identifier() );
if ( indexer.isEmpty() ) {
khcWarning() << "Empty indexer for" << entry->identifier() << entry->documentType();
qCWarning(KHC_LOG) << "Empty indexer for" << entry->identifier() << entry->documentType();
return slotDoIndexWork();
}
......@@ -647,10 +647,10 @@ void Navigator::slotDoIndexWork()
indexer.replace( QLatin1String( "%i" ), entry->identifier() );
indexer.replace( QLatin1String( "%d" ), indexDir );
indexer.replace( QLatin1String( "%p" ), entry->url() );
khcDebug() << "Indexer:" << indexer;
qCDebug(KHC_LOG) << "Indexer:" << indexer;
if ( !QDir().mkpath( indexDir ) ) {
khcWarning() << "cannot create the directory:" << indexDir;
qCWarning(KHC_LOG) << "cannot create the directory:" << indexDir;
return slotDoIndexWork();
}
......@@ -664,7 +664,7 @@ void Navigator::slotDoIndexWork()
mIndexingProc->start();
if ( !mIndexingProc->waitForStarted() ) {
khcWarning() << "Unable to start command" << indexer;
qCWarning(KHC_LOG) << "Unable to start command" << indexer;
delete mIndexingProc;
mIndexingProc = nullptr;
return slotDoIndexWork();
......@@ -674,13 +674,13 @@ void Navigator::slotDoIndexWork()
void Navigator::slotProcessExited( int exitCode, QProcess::ExitStatus exitStatus )
{
if ( exitStatus != QProcess::NormalExit ) {
khcWarning() << "Process failed";
khcWarning() << "stdout output:" << mIndexingProc->readAllStandardOutput();
khcWarning() << "stderr output:" << mIndexingProc->readAllStandardError();
qCWarning(KHC_LOG) << "Process failed";
qCWarning(KHC_LOG) << "stdout output:" << mIndexingProc->readAllStandardOutput();
qCWarning(KHC_LOG) << "stderr output:" << mIndexingProc->readAllStandardError();
} else if ( exitCode != 0 ) {
khcWarning() << "running" << mIndexingProc->program() << "failed with exitCode" << exitCode;
khcWarning() << "stdout output:" << mIndexingProc->readAllStandardOutput();
khcWarning() << "stderr output:" << mIndexingProc->readAllStandardError();
qCWarning(KHC_LOG) << "running" << mIndexingProc->program() << "failed with exitCode" << exitCode;
qCWarning(KHC_LOG) << "stdout output:" << mIndexingProc->readAllStandardOutput();
qCWarning(KHC_LOG) << "stderr output:" << mIndexingProc->readAllStandardError();
}
delete mIndexingProc;
mIndexingProc = nullptr;
......
......@@ -69,11 +69,11 @@ void NavigatorAppGroupItem::setRelpath( const QString &relpath )
void NavigatorAppGroupItem::itemExpanded(bool open)
{
khcDebug() << "NavigatorAppGroupItem::itemExpanded()";
qCDebug(KHC_LOG) << "NavigatorAppGroupItem::itemExpanded()";
if ( open && (childCount() == 0) && !mPopulated )
{
khcDebug() << " -> populate:" << this << "-" << mRelpath;
qCDebug(KHC_LOG) << " -> populate:" << this << "-" << mRelpath;
populate();
}
NavigatorItem::itemExpanded(open);
......@@ -85,7 +85,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
KServiceGroup::Ptr root = KServiceGroup::group(mRelpath);
if ( !root ) {
khcWarning() << "No Service groups for" << mRelpath;
qCWarning(KHC_LOG) << "No Service groups for" << mRelpath;
return;
}
KServiceGroup::List list = root->entries();
......
......@@ -71,7 +71,7 @@ void NavigatorAppItem::scheduleTOCBuild()
if ( url.scheme() == QLatin1String( "help" ) ) {
mToc = new TOC( this );
khcDebug() << "Trying to build TOC for" << entry()->name();
qCDebug(KHC_LOG) << "Trying to build TOC for" << entry()->name();
mToc->setApplication( url.toString( QUrl::RemoveScheme | QUrl::RemoveFilename | QUrl::StripTrailingSlash ) );
QString doc = View::langLookup( url.path() );
// Enforce the original .docbook version, in case langLookup returns a
......@@ -81,7 +81,7 @@ void NavigatorAppItem::scheduleTOCBuild()
if ( pos >= 0 ) {
doc.replace( pos, 5, QLatin1String( ".docbook" ) );
}
khcDebug() << "doc =" << doc;
qCDebug(KHC_LOG) << "doc =" << doc;
mToc->build( doc );
// ensure the newly populated item is expanded
......
......@@ -55,7 +55,7 @@ PluginTraverser::PluginTraverser( Navigator *navigator, NavigatorItem *parent )
void PluginTraverser::process( DocEntry *entry )
{
if ( !mListView && !mParentItem ) {
khcWarning() << "ERROR! Neither mListView nor mParentItem is set.";
qCWarning(KHC_LOG) << "ERROR! Neither mListView nor mParentItem is set.";
return;
}
......@@ -115,7 +115,7 @@ DocEntryTraverser *PluginTraverser::createChild( DocEntry * /*entry*/ )
if ( mCurrentItem ) {
return new PluginTraverser( mNavigator, mCurrentItem );
}
khcWarning() << "ERROR! mCurrentItem is not set.";
qCWarning(KHC_LOG) << "ERROR! mCurrentItem is not set.";
return nullptr;
}
......
......@@ -49,11 +49,11 @@ void ScrollKeeperTreeBuilder::build( NavigatorItem *parent )
{
QString lang = QLocale().bcp47Name();
khcDebug() << "ScrollKeeper language: " << lang;
qCDebug(KHC_LOG) << "ScrollKeeper language: " << lang;
const QString exePath = QStandardPaths::findExecutable( QLatin1Literal( "scrollkeeper-get-content-list" ) );
if ( exePath.isEmpty() ) {
khcDebug() << "scrollkeeper-get-content-list is not available, skipping";
qCDebug(KHC_LOG) << "scrollkeeper-get-content-list is not available, skipping";
return;
}
......@@ -64,13 +64,13 @@ void ScrollKeeperTreeBuilder::build( NavigatorItem *parent )
proc.setOutputChannelMode(KProcess::OnlyStdoutChannel);
proc.start();
if ( !proc.waitForFinished() ) {
khcWarning() << "Could not execute scrollkeeper-get-content-list";
qCWarning(KHC_LOG) << "Could not execute scrollkeeper-get-content-list";
return;