Sort non-root entries in KHelpCenter

Make KHelpCenter entry sorting case-insensitive
This resolves Bug 1849
pull/2/head
Timothy Pearson 10 years ago
parent 88a2e25514
commit c292453620

@ -230,6 +230,7 @@ void Navigator::insertParentAppDocs( const TQString &name, NavigatorItem *topIte
}
createItemFromDesktopFile( topItem, desktopFile );
}
topItem->sortChildItems( 0, true /* ascending */ );
}
void Navigator::insertIOSlaveDocs( const TQString &name, NavigatorItem *topItem )
@ -269,8 +270,10 @@ void Navigator::insertAppletDocs( NavigatorItem *topItem )
TQStringList files = appletDir.entryList( TQDir::Files | TQDir::Readable );
TQStringList::ConstIterator it = files.begin();
TQStringList::ConstIterator end = files.end();
for ( ; it != end; ++it )
for ( ; it != end; ++it ) {
createItemFromDesktopFile( topItem, appletDir.absPath() + "/" + *it );
}
topItem->sortChildItems( 0, true /* ascending */ );
}
void Navigator::createItemFromDesktopFile( NavigatorItem *topItem,

@ -156,6 +156,11 @@ bool NavigatorAppItem::populate( bool recursive )
return entriesAdded;
}
TQString NavigatorAppItem::key( int column, bool ascending ) const
{
return text( column ).lower();
}
TQString NavigatorAppItem::documentationURL( KService *s )
{
TQString docPath = s->property( "DocPath" ).toString();

@ -43,6 +43,7 @@ class NavigatorAppItem : public NavigatorItem
virtual void setOpen(bool);
bool populate( bool recursive = false );
virtual TQString key( int column, bool ascending ) const;
protected:
TQString documentationURL( KService *s );

@ -102,4 +102,9 @@ void NavigatorItem::setOpen( bool open )
}
}
TQString NavigatorItem::key( int column, bool ascending ) const
{
return text( column ).lower();
}
// vim:ts=2:sw=2:et

@ -49,12 +49,14 @@ class NavigatorItem : public TQListViewItem
TOC *toc() const { return mToc; }
TOC *createTOC();
void setOpen( bool open );
virtual TQString key( int column, bool ascending ) const;
private:
void init( DocEntry * );
TOC *mToc;
DocEntry *mEntry;

Loading…
Cancel
Save