KURLComboBox Class Reference
This combobox shows a number of recent URLs/directories, as well as some default directories. A combo box showing a number of recent URLs/directories. More...
#include <kurlcombobox.h>
Inheritance diagram for KURLComboBox:


Public Types | |
enum | Mode { Files = -1, Directories = 1, Both = 0 } |
This enum describes which kind of items is shown in the combo box. More... | |
enum | OverLoadResolving { RemoveTop, RemoveBottom } |
This Enumeration is used in setURL() to determine which items will be removed when the given list is larger than maxItems(). More... | |
Signals | |
void | urlActivated (const KURL &url) |
Emitted when an item was clicked at. | |
Public Member Functions | |
KURLComboBox (Mode mode, QWidget *parent=0, const char *name=0) | |
Constructs a KURLComboBox. | |
KURLComboBox (Mode mode, bool rw, QWidget *parent=0, const char *name=0) | |
~KURLComboBox () | |
Destructs the combo box. | |
void | setURL (const KURL &url) |
Sets the current url. | |
void | setURLs (QStringList urls) |
Inserts urls into the combobox below the "default urls" (see addDefaultURL). | |
void | setURLs (QStringList urls, OverLoadResolving remove) |
Inserts urls into the combobox below the "default urls" (see addDefaultURL). | |
QStringList | urls () const |
void | setMaxItems (int) |
Sets how many items should be handled and displayed by the combobox. | |
int | maxItems () const |
void | addDefaultURL (const KURL &url, const QString &text=QString::null) |
Adds a url that will always be shown in the combobox, it can't be "rotated away". | |
void | addDefaultURL (const KURL &url, const QPixmap &pix, const QString &text=QString::null) |
Adds a url that will always be shown in the combobox, it can't be "rotated away". | |
void | setDefaults () |
Clears all items and inserts the default urls into the combo. | |
void | removeURL (const KURL &url, bool checkDefaultURLs=true) |
Removes any occurence of url . | |
Protected Types | |
typedef _KURLComboItem | KURLComboItem |
Protected Slots | |
void | slotActivated (int) |
Protected Member Functions | |
void | init (Mode mode) |
void | insertURLItem (const KURLComboItem *) |
QPixmap | getPixmap (const KURL &url) const |
Uses KMimeType::pixmapForURL() to return a proper pixmap for url . | |
void | updateItem (const KURLComboItem *item, int index, const QPixmap &pix) |
Updates item with pixmap and sets the url instead of the text of the KURLComboItem. | |
Protected Attributes | |
QPtrList< KURLComboItem > | itemList |
QPtrList< KURLComboItem > | defaultList |
QMap< int, const KURLComboItem * > | itemMapper |
QPixmap | opendirPix |
int | firstItemIndex |
Detailed Description
This combobox shows a number of recent URLs/directories, as well as some default directories. A combo box showing a number of recent URLs/directories.It will manage the default dirs root-directory, home-directory and Desktop-directory, as well as a number of URLs set via setURLs() and one additional entry to be set via setURL().
- Author:
- Carsten Pfeiffer <pfeiffer@kde.org>
Definition at line 41 of file kurlcombobox.h.
Member Enumeration Documentation
|
This enum describes which kind of items is shown in the combo box.
Definition at line 51 of file kurlcombobox.h. |
|
This Enumeration is used in setURL() to determine which items will be removed when the given list is larger than maxItems().
Definition at line 59 of file kurlcombobox.h. |
Constructor & Destructor Documentation
|
Constructs a KURLComboBox.
Definition at line 41 of file kurlcombobox.cpp. References KStdAccel::name(). |
|
Destructs the combo box.
Definition at line 56 of file kurlcombobox.cpp. |
Member Function Documentation
|
Sets the current url.
This combo handles exactly one url additionally to the default items and those set via setURLs(). So you can call setURL() as often as you want, it will always replace the previous one set via setURL(). If Note that you won't receive any signals, e.g. textChanged(), returnPressed() or activated() upon calling this method. Definition at line 199 of file kurlcombobox.cpp. References QPtrList< KURLComboItem >::append(), QComboBox::count(), QPtrListIterator::current(), getPixmap(), QComboBox::insertItem(), KURL::isEmpty(), KURL::isLocalFile(), KURL::path(), KURL::prettyURL(), QPtrList< KURLComboItem >::removeLast(), KComboBox::setCurrentItem(), setDefaults(), QComboBox::text(), updateItem(), and KURL::url(). Referenced by KFileDialog::readConfig(). |
|
Inserts If the list of urls contains more items than maxItems, the first items will be stripped. Definition at line 137 of file kurlcombobox.cpp. Referenced by KFileDialog::readConfig(), and KFileDialog::readRecentFiles(). |
|
Inserts
If the list of urls contains more items than maxItems, the Definition at line 142 of file kurlcombobox.cpp. References QPtrList< KURLComboItem >::append(), QPtrList< KURLComboItem >::clear(), QPtrList< KURLComboItem >::count(), KURL::fromPathOrURL(), getPixmap(), KURL::isLocalFile(), KURL::path(), setDefaults(), and QComboBox::text(). |
|
Definition at line 81 of file kurlcombobox.cpp. References QComboBox::count(), QPtrList< KURLComboItem >::count(), QString::isEmpty(), and QComboBox::text(). Referenced by KFileDialog::saveRecentFiles(). |
|
Sets how many items should be handled and displayed by the combobox.
Definition at line 281 of file kurlcombobox.cpp. References QPtrList< KURLComboItem >::count(), QComboBox::count(), QPtrListIterator::current(), QComboBox::currentItem(), KComboBox::setCurrentItem(), and setDefaults(). Referenced by KFileDialog::readConfig(), and KFileDialog::readRecentFiles(). |
|
Definition at line 135 of file kurlcombobox.h. |
|
Adds a url that will always be shown in the combobox, it can't be "rotated away". Default urls won't be returned in urls() and don't have to be set via setURLs(). If you want to specify a special pixmap, use the overloaded method with the pixmap parameter. Default URLs will be inserted into the combobox by setDefaults() Definition at line 101 of file kurlcombobox.cpp. References getPixmap(). |
|
Adds a url that will always be shown in the combobox, it can't be "rotated away". Default urls won't be returned in urls() and don't have to be set via setURLs(). If you don't need to specify a pixmap, use the overloaded method without the pixmap parameter. Default URLs will be inserted into the combobox by setDefaults() Definition at line 107 of file kurlcombobox.cpp. References QPtrList< KURLComboItem >::append(), QString::isEmpty(), KURL::isLocalFile(), KURL::path(), and KURL::prettyURL(). |
|
Clears all items and inserts the default urls into the combo. Will be called implicitly upon the first call to setURLs() or setURL()
Definition at line 125 of file kurlcombobox.cpp. References QPtrList< KURLComboItem >::at(), QComboBox::clear(), and QPtrList< KURLComboItem >::count(). Referenced by removeURL(), setMaxItems(), setURL(), and setURLs(). |
|
Removes any occurence of
If Definition at line 307 of file kurlcombobox.cpp. References QPtrListIterator::current(), QPtrList< KURLComboItem >::remove(), setDefaults(), and KURL::url(). |
|
Emitted when an item was clicked at.
|
|
Uses KMimeType::pixmapForURL() to return a proper pixmap for In directory mode, a folder icon is always returned. Definition at line 329 of file kurlcombobox.cpp. References KMimeType::pixmapForURL(). Referenced by addDefaultURL(), setURL(), and setURLs(). |
|
Updates Also works around a Qt bug. Definition at line 340 of file kurlcombobox.cpp. References QComboBox::changeItem(), QComboBox::editable(), QComboBox::insertItem(), and QComboBox::removeItem(). Referenced by setURL(). |
The documentation for this class was generated from the following files: