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"
632 void KFileItemActions::runPreferredApplications(const KFileItemList& fileOpenList, const QString& traderConstraint)
680 QStringList KFileItemActionsPrivate::listPreferredServiceIds(const QStringList& mimeTypeList, const QString& traderConstraint)
692 KAction* KFileItemActionsPrivate::createAppAction(const KService::Ptr& service, bool singleOffer)
int insertServicesSubmenus(const QMap< QString, ServiceList > &list, QMenu *menu, bool isBuiltin)
Definition: kfileitemactions.cpp:111
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
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:978
void runPreferredApplications(const KFileItemList &fileOpenList, const QString &traderConstraint)
Slot used to execute a list of files in their respective preferred application.
Definition: kfileitemactions.cpp:632
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
QActionGroup m_runApplicationActionGroup
Definition: kfileitemactions_p.h:85
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
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:711
void setParentWidget(QWidget *widget)
Set the parent widget for any dialogs being shown.
Definition: kfileitemactions.cpp:720
void slotRunPreferredApplications()
Definition: kfileitemactions.cpp:601
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()
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
QString localPath() const
Returns the local path if isLocalFile() == true or the KIO item has a UDS_LOCAL_PATH atom...
Definition: kfileitem.cpp:602
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
QList< Ptr > List
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
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
KGuiItem ok()
bool hasKey(const QString &key) const
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
KFileItemList items() const
List of fileitems passed to the constructor or to setItems().
Definition: kfileitemlistproperties.cpp:155
QString storageId() const
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 name() const
QStringList listPreferredServiceIds(const QStringList &mimeTypeList, const QString &traderConstraint)
Definition: kfileitemactions.cpp:680
void executeService(const KUrl::List &urls, const KServiceAction &service)
Execute service on the list of urls.
Definition: kdesktopfileactions.cpp:288
bool isLocalFile() const
QStringList listMimeTypes(const KFileItemList &items)
Definition: kfileitemactions.cpp:670
T readEntry(const QString &key, const T &aDefault) const
KAction * createAppAction(const KService::Ptr &service, bool singleOffer)
Definition: kfileitemactions.cpp:692
bool supportsWriting() const
Check if writing capability is supported (file managers use this mostly for directories) ...
Definition: kfileitemlistproperties.cpp:140
KConfigGroup desktopGroup() const
bool authorizeKAction(const QString &action)
Definition: netaccess.h:36
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.