KCompletionMatches class Reference (kdecore Library)

| # kdecore Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KCompletionMatches Class Reference

This structure is returned by KCompletion::allWeightedMatches . List for keeping matches returned from KCompletion. More...

`#include <kcompletion.h>`

Inheritance diagram for KCompletionMatches:

[legend]
Collaboration diagram for KCompletionMatches:

[legend]
List of all members.

## Public Member Functions
| KCompletionMatches (bool sort)
| KCompletionMatches (const KCompletionMatchesWrapper &matches)
void | removeDuplicates ()
| Removes duplicate matches.
QStringList | list (bool sort=true) const
| Returns the matches as a QStringList.
bool | sorting () const
| If sorting() returns false, the matches aren't sorted by their weight, even if true is passed to list().

## Detailed Description

This structure is returned by KCompletion::allWeightedMatches . List for keeping matches returned from KCompletion.

It also keeps the weight of the matches, allowing you to modify some matches or merge them with matches from another call to allWeightedMatches(), and sort the matches after that in order to have the matches ordered correctly

Example (a simplified example of what Konqueror's completion does):

     KCompletionMatches matches = completion->allWeightedMatches( location );
     if( !location.startsWith( "www." ))
           matches += completion->allWeightedmatches( "www." + location" );
     matches.removeDuplicates();
     QStringList list = matches.list();

Definition at line 606 of file kcompletion.h.

## Member Function Documentation

void KCompletionMatches::removeDuplicates | ( |  | ) |

| Removes duplicate matches. Needed only when you merged several matches results and there's a possibility of duplicates. Definition at line 779 of file kcompletion.cpp. References QValueList< KSortableItem< T, Key > >::begin(), QValueList< KSortableItem< T, Key > >::end(), QValueList< KSortableItem< T, Key > >::Iterator(), and QValueList< KSortableItem< T, Key > >::remove().

QStringList KCompletionMatches::list | ( | bool | sort = true | ) | const

  | Returns the matches as a QStringList. Parameters:
  sort | if false, the matches won't be sorted before the conversion, use only if you're sure the sorting is not needed
Returns: the list of matches Definition at line 768 of file kcompletion.cpp. References QValueList< KSortableItem< T, Key > >::begin(), QValueList< KSortableItem< T, Key > >::ConstIterator(), QValueList< KSortableItem< T, Key > >::end(), and QStringList::sort().

bool KCompletionMatches::sorting | ( |  | ) | const`[inline]`

| If sorting() returns false, the matches aren't sorted by their weight, even if true is passed to list(). Returns: true if the matches won't be sorted Definition at line 633 of file kcompletion.h.

The documentation for this class was generated from the following files:

- kcompletion.h
- kcompletion.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:47:23 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001