KFilePlaceEditDialog Class

A dialog that allows editing entries of a KFilePlacesModel. More...

Header: #include <KFilePlaceEditDialog>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOFileWidgets)
Since: 5.53
Inherits: QDialog

Public Functions

KFilePlaceEditDialog(bool allowGlobal, const QUrl &url, const QString &label, const QString &icon, bool isAddingNewPlace, bool appLocal = true, int iconSize = KIconLoader::SizeMedium, QWidget *parent = nullptr)
bool applicationLocal() const
QString icon() const
QString label() const
QUrl url() const

Public Slots

void urlChanged(const QString &)

Static Public Members

bool getInformation(bool allowGlobal, QUrl &url, QString &label, QString &icon, bool isAddingNewPlace, bool &appLocal, int iconSize, QWidget *parent = nullptr)

Detailed Description

The dialog offers to configure a given url, label and icon. See the class-method getInformation() for easy usage.

Member Function Documentation

KFilePlaceEditDialog::KFilePlaceEditDialog(bool allowGlobal, const QUrl &url, const QString &label, const QString &icon, bool isAddingNewPlace, bool appLocal = true, int iconSize = KIconLoader::SizeMedium, QWidget *parent = nullptr)

Constructs a KFilePlaceEditDialog.

allowGlobal if you set this to true, the dialog will have a checkbox for the user to decide if he wants the entry to be available globally or just for the current application.

url the url of the item

label a short, translated description of the item

icon an icon for the item

appLocal tells whether the item should be local for this application or be available globally

iconSize determines the size of the icon that is shown/selectable

parent the parent-widget for the dialog

If you leave the icon empty, the default icon for the given url will be used (KMimeType::pixmapForUrl()).

bool KFilePlaceEditDialog::applicationLocal() const

Returns whether the item should be local to the application or global. If allowGlobal was set to false in the constructor, this will always return true.

[static] bool KFilePlaceEditDialog::getInformation(bool allowGlobal, QUrl &url, QString &label, QString &icon, bool isAddingNewPlace, bool &appLocal, int iconSize, QWidget *parent = nullptr)

A convenience method to show the dialog and retrieve all the properties via the given parameters. The parameters are used to initialize the dialog and then return the user-configured values.

allowGlobal if you set this to true, the dialog will have a checkbox for the user to decide if he wants the entry to be available globally or just for the current application.

url the url of the item

label a short, translated description of the item

icon an icon for the item

appLocal tells whether the item should be local for this application or be available globally

iconSize determines the size of the icon that is shown/selectable

parent the parent-widget for the dialog

If you leave the icon empty, the default icon for the given url will be used (KMimeType::pixmapForUrl()).

QString KFilePlaceEditDialog::icon() const

Returns the configured icon

QString KFilePlaceEditDialog::label() const

Returns the configured label

QUrl KFilePlaceEditDialog::url() const

Returns the configured url

[slot] void KFilePlaceEditDialog::urlChanged(const QString &)