• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KDECore

KCompletionMatches Class Reference

This structure is returned by KCompletion::allWeightedMatches . More...

#include <kcompletion.h>

Inheritance diagram for KCompletionMatches:

Inheritance graph
[legend]

List of all members.


Public Member Functions

 KCompletionMatches (const KCompletionMatchesWrapper &matches)
 KCompletionMatches (bool sort)
QStringList list (bool sort=true) const
void removeDuplicates ()
bool sorting () const
 ~KCompletionMatches ()

Detailed Description

This structure is returned by KCompletion::allWeightedMatches .

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();

List for keeping matches returned from KCompletion

Definition at line 615 of file kcompletion.h.


Constructor & Destructor Documentation

KCompletionMatches::KCompletionMatches ( bool  sort  ) 

Definition at line 763 of file kcompletion.cpp.

KCompletionMatches::KCompletionMatches ( const KCompletionMatchesWrapper &  matches  ) 

For internal use only.

Definition at line 768 of file kcompletion.cpp.

KCompletionMatches::~KCompletionMatches (  ) 

Definition at line 782 of file kcompletion.cpp.


Member Function Documentation

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 786 of file kcompletion.cpp.

void KCompletionMatches::removeDuplicates (  ) 

Removes duplicate matches.

Needed only when you merged several matches results and there's a possibility of duplicates.

Definition at line 797 of file kcompletion.cpp.

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 641 of file kcompletion.h.


The documentation for this class was generated from the following files:
  • kcompletion.h
  • kcompletion.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal