KIO
openwith.cpp
39void addToMimeAppsList(const QString &serviceId /*menu id or storage id*/, const QString &qMimeType)
41 KSharedConfig::Ptr profile = KSharedConfig::openConfig(QStringLiteral("mimeapps.list"), KConfig::NoGlobals, QStandardPaths::GenericConfigLocation);
56 KSharedConfig::Ptr fileTypesConfig = KSharedConfig::openConfig(QStringLiteral("filetypesrc"), KConfig::NoGlobals);
57 fileTypesConfig->group(QStringLiteral("EmbedSettings")).writeEntry(QStringLiteral("embed-") + qMimeType, false);
77 const QString preferredTerminal = confGroup.readPathEntry("TerminalApplication", QStringLiteral("konsole"));
90 return {.accept = false, .error = i18n("Could not extract executable name from '%1', please type a valid program name.", serviceName)};
142 ? xi18nc("@info", "<filename>%1</filename> does not appear to be an executable program.", binaryName)
143 : xi18nc("@info", "<filename>%1</filename> was not found; please enter a valid path to an executable program.", binaryName);
167 if (!typedExec.contains(QLatin1String("%u"), Qt::CaseInsensitive) && !typedExec.contains(QLatin1String("%f"), Qt::CaseInsensitive)) {
196 // qDebug() << "Creating new service" << serviceName << "(" << newPath << ")" << "menuId=" << menuId;
217 if (!typedExec.contains(QLatin1String("%u"), Qt::CaseInsensitive) && !typedExec.contains(QLatin1String("%f"), Qt::CaseInsensitive)) {
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
QString readPathEntry(const char *key, const QString &aDefault) const
void writeXdgListEntry(const char *key, const QStringList &value, WriteConfigFlags pFlags=Normal)
bool sync() override
NoGlobals
KConfigGroup desktopGroup() const
static QString executablePath(const QString &execLine)
Given a full command line (e.g. the Exec= line from a .desktop file), extract the name of the executa...
Definition desktopexecparser.cpp:589
static QString executableName(const QString &execLine)
Given a full command line (e.g. the Exec= line from a .desktop file), extract the name of the executa...
Definition desktopexecparser.cpp:582
static AcceptResult accept(KService::Ptr &service, const QString &typedExec, bool remember, const QString &mimeType, bool openInTerminal, bool lingerTerminal, bool saveNewApps)
Accept an openwith request with the provided arguments as context.
Definition openwith.cpp:66
void setExec(const QString &exec)
QString storageId() const
void setTerminalOptions(const QString &options)
static QString newServicePath(bool showInMenu, const QString &suggestedName, QString *menuId=nullptr, const QStringList *reservedMenuIds=nullptr)
bool terminal() const
bool noDisplay() const
static Ptr serviceByDesktopName(const QString &_name)
QString exec() const
void setTerminal(bool b)
bool isApplication() const
QString name() const
QString entryPath() const
QString xi18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
bool exists() const const
QString fileName() const const
void prepend(parameter_type value)
qsizetype removeAll(const AT &t)
GenericConfigLocation
QString findExecutable(const QString &executableName, const QStringList &paths)
QString & append(QChar ch)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString number(double n, char format, int precision)
QString & remove(QChar ch, Qt::CaseSensitivity cs)
QString simplified() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QStringView mid(qsizetype start, qsizetype length) const const
qsizetype indexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs) const const
QStringView trimmed() const const
CaseInsensitive
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.