KIO
kfileitemactions.cpp
Go to the documentation of this file.
240 QString dotDirectoryFile = KUrl::fromPath(firstItem.localPath()).path(KUrl::AddTrailingSlash).append(".directory");
259 const KMimeType::Ptr mimeTypePtr = commonMimeType.isEmpty() ? KMimeType::Ptr() : KMimeType::mimeType(commonMimeType);
295 if (reply.arguments().count() < 1 || reply.arguments().at(0).type() != QVariant::Bool || !reply.arguments().at(0).toBool()) {
373 for (QStringList::ConstIterator itex = excludeTypes.constBegin(); itex != excludeTypes.constEnd(); ++itex) {
388 const ServiceList userServices = KDesktopFileActions::userDefinedServices(*(*it2), isLocal, urlList);
431 KService::List KFileItemActions::associatedApplications(const QStringList& mimeTypeList, const QString& traderConstraint)
437 const KService::List firstOffers = KMimeTypeTrader::self()->query(mimeTypeList.first(), "Application", traderConstraint);
442 // This section does two things. First, it determines which services are common to all the given mimetypes.
456 const KService::List offers = KMimeTypeTrader::self()->query(mimeTypeList[j], "Application", traderConstraint);
493 const KService::List services = KMimeTypeTrader::self()->query(mimeType, QString::fromLatin1("Application"), constraint);
522 const QStringList serviceIdList = d->listPreferredServiceIds(d->m_mimeTypeList, traderConstraint);
529 && !(serviceIdList.count()==1 && serviceIdList.first().isEmpty())) { // empty means "no apps associated"
633 void KFileItemActions::runPreferredApplications(const KFileItemList& fileOpenList, const QString& traderConstraint)
681 QStringList KFileItemActionsPrivate::listPreferredServiceIds(const QStringList& mimeTypeList, const QString& traderConstraint)
693 KAction* KFileItemActionsPrivate::createAppAction(const KService::Ptr& service, bool singleOffer)
int insertServicesSubmenus(const QMap< QString, ServiceList > &list, QMenu *menu, bool isBuiltin)
Definition: kfileitemactions.cpp:111
void setText(const QString &text)
QString i18n(const char *text)
void setItemListProperties(const KFileItemListProperties &itemList)
Sets all the data for the next instance of the popupmenu.
Definition: kfileitemactions.cpp:190
void clear()
QList< KAction * > m_ownActions
Definition: kfileitemactions_p.h:86
static bool run(const KService &service, const KUrl::List &urls, QWidget *window, bool tempFiles=false, const QString &suggestedFileName=QString(), const QByteArray &asn=QByteArray())
Open a list of URLs with a certain service (application).
Definition: krun.cpp:984
void runPreferredApplications(const KFileItemList &fileOpenList, const QString &traderConstraint)
Slot used to execute a list of files in their respective preferred application.
Definition: kfileitemactions.cpp:633
void addOpenWithActionsTo(QMenu *menu, const QString &traderConstraint=QString())
Generate the "Open With " actions, and adds them to the menu.
Definition: kfileitemactions.cpp:497
~KFileItemActionsPrivate()
Definition: kfileitemactions.cpp:106
Definition: kfileitemactions_p.h:36
KFileItemActionsPrivate(KFileItemActions *qq)
Definition: kfileitemactions.cpp:93
static KServiceTypeTrader * self()
QList< KServiceAction > userDefinedServices(const QString &path, bool bLocalFiles)
Returns a list of services defined by the user as possible actions on the given .desktop file...
Definition: kdesktopfileactions.cpp:230
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
QVariant data() const
QActionGroup m_runApplicationActionGroup
Definition: kfileitemactions_p.h:85
int removeDuplicates()
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
void setIcon(const QIcon &icon)
const T & at(int i) const
Definition: netaccess.h:36
void removeAt(int i)
bool contains(const QString &str, Qt::CaseSensitivity cs) const
QList< QVariant > arguments() const
T value() const
static KUrl fromPath(const QString &text)
KConfigGroup group(const QByteArray &group)
KAction * preferredOpenWithAction(const QString &traderConstraint)
Returns an action for the preferred application only.
Definition: kfileitemactions.cpp:712
QAction * addAction(QAction *action)
QDBusConnection sessionBus()
void setParentWidget(QWidget *widget)
Set the parent widget for any dialogs being shown.
Definition: kfileitemactions.cpp:721
bool exists() const
void slotRunPreferredApplications()
Definition: kfileitemactions.cpp:602
KFileItemActions(QObject *parent=0)
Creates a KFileItemActions instance.
Definition: kfileitemactions.cpp:179
This class creates and handles the actions for a url (or urls) in a popupmenu.
Definition: kfileitemactions.h:44
QString i18nc(const char *ctxt, const char *text)
QList< KServiceAction > builtinServices(const KUrl &url)
Returns a list of services for the given .desktop file that are handled by kio itself.
Definition: kdesktopfileactions.cpp:156
QString mimeType() const
Definition: kfileitemlistproperties.cpp:170
KSharedConfigPtr config()
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
int count(const T &value) const
void append(const T &value)
QString m_traderConstraint
Definition: kfileitemactions_p.h:82
KService::Ptr service
Definition: kfileitemactions_p.h:53
KSharedPtr< KService > Ptr
int addServiceActionsTo(QMenu *menu)
Generate the user-defined actions and submenus, and adds them to the menu.
Definition: kfileitemactions.cpp:204
QString protocol() const
KService::List query(const QString &mimeType, const QString &genericServiceType=QString::fromLatin1("Application"), const QString &constraint=QString()) const
bool isEmpty() const
void setObjectName(const QString &name)
QString localPath() const
Returns the local path if isLocalFile() == true or the KIO item has a UDS_LOCAL_PATH atom...
Definition: kfileitem.cpp:602
bool isEmpty() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
List of KFileItems, which adds a few helper methods to QList.
Definition: kfileitem.h:674
static KMimeTypeTrader * self()
KFileItemList m_fileOpenList
Definition: kfileitemactions_p.h:83
QStringList readXdgListEntry(const QString &pKey, const QStringList &aDefault=QStringList()) const
T & first()
iterator end()
QList< Ptr > List
iterator begin()
static bool displayOpenWithDialog(const KUrl::List &lst, QWidget *window, bool tempFiles=false, const QString &suggestedFileName=QString(), const QByteArray &asn=QByteArray())
Display the Open-With dialog for those URLs, and run the chosen application.
Definition: krun.cpp:193
bool isDirectory() const
Definition: kfileitemlistproperties.cpp:165
KUrl::List urlList() const
List of urls, gathered from the fileitems.
Definition: kfileitemlistproperties.cpp:160
QActionGroup m_executeServiceActionGroup
Definition: kfileitemactions_p.h:84
QStringList types(Mode mode=Writing)
Returns a list of all KImageIO supported formats.
Definition: kimageio.cpp:82
void setData(const QVariant &userData)
iterator end()
QString icon() const
Provides information about the common properties of a group of KFileItem objects. ...
Definition: kfileitemlistproperties.h:49
static KService::Ptr preferredService(const QString &mimeType, const QString &constraint)
Definition: kfileitemactions.cpp:491
QVariant fromValue(const T &value)
KGuiItem ok()
bool hasKey(const QString &key) const
const Key key(const T &value) const
QString & replace(int position, int n, QChar after)
KService::List query(const QString &servicetype, const QString &constraint=QString()) const
static bool lessRank(const ServiceRank &id1, const ServiceRank &id2)
Definition: kfileitemactions_p.h:57
static KService::List associatedApplications(const QStringList &mimeTypeList, const QString &traderConstraint)
Helper method used internally, can also be used for similar GUIs that show the list of associated app...
Definition: kfileitemactions.cpp:431
QString mid(int position, int n) const
KFileItemList items() const
List of fileitems passed to the constructor or to setItems().
Definition: kfileitemlistproperties.cpp:155
QString storageId() const
T & last()
typedef ConstIterator
void openWithDialogAboutToBeShown()
Emitted before the "Open With" dialog is shown This is used e.g in folderview to close the folder pee...
int insertServices(const ServiceList &list, QMenu *menu, bool isBuiltin)
Definition: kfileitemactions.cpp:133
QStringList toStringList() const
QString mimeGroup() const
Definition: kfileitemlistproperties.cpp:177
bool authorize(const QString &genericAction)
QString fromLatin1(const char *str, int size)
int indexOf(const QRegExp &rx, int from) const
QString name() const
QStringList listPreferredServiceIds(const QStringList &mimeTypeList, const QString &traderConstraint)
Definition: kfileitemactions.cpp:681
const_iterator constEnd() const
const_iterator constBegin() const
void executeService(const KUrl::List &urls, const KServiceAction &service)
Execute service on the list of urls.
Definition: kdesktopfileactions.cpp:288
bool isLocalFile() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QAction * > actions() const
QStringList listMimeTypes(const KFileItemList &items)
Definition: kfileitemactions.cpp:671
T readEntry(const QString &key, const T &aDefault) const
KAction * createAppAction(const KService::Ptr &service, bool singleOffer)
Definition: kfileitemactions.cpp:693
bool supportsWriting() const
Check if writing capability is supported (file managers use this mostly for directories) ...
Definition: kfileitemlistproperties.cpp:140
KConfigGroup desktopGroup() const
iterator begin()
bool authorizeKAction(const QString &action)
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:45
QStringList m_mimeTypeList
Definition: kfileitemactions_p.h:81
static bool KIOSKAuthorizedAction(const KConfigGroup &cfg)
Definition: kfileitemactions.cpp:42
static Ptr serviceByStorageId(const QString &_storageId)
QStringList list(const QString &fileClass)
Returns a list of directories associated with this file-class.
Definition: krecentdirs.cpp:60
const T value(const Key &key) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.