KDED
vfolder_menu.cpp
Go to the documentation of this file.
41 static void foldNode(QDomElement &docElem, QDomElement &e, QMap<QString,QDomElement> &dupeList, QString s=QString()) //krazy:exclude=passbyvalue
56 static void replaceNode(QDomElement &docElem, QDomNode &n, const QStringList &list, const QString &tag)
116 track(const QString &menuId, const QString &menuName, const QHash<QString,KService::Ptr>& includeList, const QHash<QString,KService::Ptr>& excludeList, const QHash<QString,KService::Ptr>& itemList, const QString &comment)
119 printf("%s: %s INCL %d EXCL %d\n", qPrintable(menuName), qPrintable(comment), includeList.contains(menuId) ? 1 : 0, excludeList.contains(menuId) ? 1 : 0);
123 VFolderMenu::includeItems(QHash<QString,KService::Ptr>& items1, const QHash<QString,KService::Ptr>& items2)
131 VFolderMenu::matchItems(QHash<QString,KService::Ptr>& items1, const QHash<QString,KService::Ptr>& items2)
142 VFolderMenu::excludeItems(QHash<QString,KService::Ptr>& items1, const QHash<QString,KService::Ptr>& items2)
156 for (QList<SubMenu*>::Iterator it = parentMenu->subMenus.begin(); it != parentMenu->subMenus.end(); ++it)
181 track(m_trackId, menu1->name, menu1->items, menu1->excludeItems, menu2->items, QString("Before MenuMerge w. %1 (incl)").arg(menu2->name));
182 track(m_trackId, menu1->name, menu1->items, menu1->excludeItems, menu2->excludeItems, QString("Before MenuMerge w. %1 (excl)").arg(menu2->name));
229 track(m_trackId, menu1->name, menu1->items, menu1->excludeItems, menu2->items, QString("After MenuMerge w. %1 (incl)").arg(menu2->name));
230 track(m_trackId, menu1->name, menu1->items, menu1->excludeItems, menu2->excludeItems, QString("After MenuMerge w. %1 (excl)").arg(menu2->name));
237 VFolderMenu::insertSubMenu(SubMenu *parentMenu, const QString &menuName, SubMenu *newMenu, bool reversePriority)
307 VFolderMenu::VFolderMenu(KBuildServiceFactory* serviceFactory, KBuildSycocaInterface* kbuildsycocaInterface)
490 kWarning(7021) << "Parse error in " << m_docInfo.path << ", line " << errorRow << ", col " << errorCol << ": " << errorMsg;
1067 VFolderMenu::processLegacyDir(const QString &dir, const QString &relDir, const QString &prefix)
1069 kDebug(7021).nospace() << "processLegacyDir(" << dir << ", " << relDir << ", " << prefix << ")";
1330 track(m_trackId, m_currentMenu->name, m_currentMenu->items, m_currentMenu->excludeItems, items, "Before <Include>");
1336 track(m_trackId, m_currentMenu->name, m_currentMenu->items, m_currentMenu->excludeItems, items, "After <Include>");
1352 track(m_trackId, m_currentMenu->name, m_currentMenu->items, m_currentMenu->excludeItems, items, "Before <Exclude>");
1356 track(m_trackId, m_currentMenu->name, m_currentMenu->items, m_currentMenu->excludeItems, items, "After <Exclude>");
1552 kWarning() << "The menu spec file contains a Layout or DefaultLayout tag without the mandatory Merge tag inside. Please fix your file.";
1558 VFolderMenu::layoutMenu(VFolderMenu::SubMenu *menu, QStringList defaultLayout) //krazy:exclude=passbyvalue
QDomAttr createAttribute(const QString &name)
QHash< QString, KService::Ptr > excludeItems
Definition: vfolder_menu.h:50
bool hasNext() const
virtual KService::Ptr createService(const QString &path)=0
void clear()
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
QString & append(QChar ch)
iterator insert(const Key &key, const T &value)
QDomNode item(int index) const
iterator erase(iterator pos)
void setValue(const QString &v)
Definition: vfolder_menu.h:40
QDomNode appendChild(const QDomNode &newChild)
QString attribute(const QString &name, const QString &defValue) const
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
QString & prepend(QChar ch)
QDomNode insertAfter(const QDomNode &newChild, const QDomNode &refChild)
QStringList findDirs(const char *type, const QString &reldir) const
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
KStandardDirs * dirs()
bool contains(const QString &str, Qt::CaseSensitivity cs) const
QStack< VFolderMenu::DocInfo > m_docInfoStack
Definition: vfolder_menu.h:118
QDebug & nospace()
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
iterator erase(iterator pos)
QDomElement documentElement() const
const_iterator insert(const T &value)
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
static bool exists(const QString &fullPath)
SubMenu * parseMenu(const QString &file, bool forceLegacyLoad=false)
Parses VFolder menu definition and generates a menu layout.
Definition: vfolder_menu.cpp:1590
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
QDomNode nextSibling() const
void clear()
QString filePath() const
QDomElement toElement() const
bool isFile() const
void setMenuId(const QString &menuId)
const char * name() const
int count() const
int count(const T &value) const
QString fromLocal8Bit(const char *str, int size)
void append(const T &value)
QDomDocument ownerDocument() const
void pop_front()
QString text() const
bool hasAttribute(const QString &name) const
bool isDir() const
QString fileName() const
KSharedPtr< KService > Ptr
int toInt(bool *ok, int base) const
bool isEmpty() const
QDomNodeList elementsByTagName(const QString &tagname) const
void setTrackId(const QString &id)
Debug function to enable tracking of what happens with a specific menu item id.
Definition: vfolder_menu.cpp:1651
QString absoluteFilePath() const
bool isEmpty() const
QString relativeLocation(const char *type, const QString &absPath)
int removeAll(const T &value)
QString menuId() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
Item next()
virtual void addEntry(const KSycocaEntry::Ptr &newEntry)
Add a new entry.
Definition: kbuildservicefactory.cpp:381
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
typedef Iterator
T & first()
iterator end()
int remove(const Key &key)
QStringList allDirectories()
Returns a list of all directories involved in the last call to parseMenu(), excluding the KDE Legacy ...
Definition: vfolder_menu.cpp:88
QString kfsstnd_prefixes()
KAction * next(const QObject *recvr, const char *slot, QObject *parent)
Definition: kbuildsycocainterface.h:25
QDomText createTextNode(const QString &value)
QDomNode namedItem(const QString &name) const
void clear()
iterator end()
void remove()
QDomNode removeChild(const QDomNode &oldChild)
QStringList resourceDirs(const char *type) const
bool isRelativePath(const QString &path)
QString value() const
KGuiItem ok()
bool contains(const T &value) const
bool isNull() const
void clear()
QString cleanPath(const QString &path)
QDomNode firstChild() const
QString mid(int position, int n) const
QString dir(const QString &fileClass)
QDomAttr setAttributeNode(const QDomAttr &newAttr)
typedef ConstIterator
QDomAttr toAttr() const
QString findResource(const char *type, const QString &filename) const
void reserve(int size)
QHash< QString, KService::Ptr > applications
Definition: vfolder_menu.h:134
int length() const
QStringList categories() const
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QString left(int n) const
void sort()
void prepend(const T &value)
iterator insert(const Key &key, const T &value)
bool contains(const Key &key) const
VFolderMenu(KBuildServiceFactory *serviceFactory, KBuildSycocaInterface *kbuildsycocaInterface)
Definition: vfolder_menu.cpp:307
QString tagName() const
QStringList findAllResources(const char *type, const QString &filter=QString(), SearchOptions options=NoSearchOptions) const
const_iterator constEnd() const
QDomElement createElement(const QString &tagName)
const_iterator constBegin() const
QDomNode insertBefore(const QDomNode &newChild, const QDomNode &refChild)
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QDomAttr attributeNode(const QString &name)
iterator find(const Key &key)
iterator begin()
static QString realPath(const QString &dirname)
bool setContent(const QByteArray &data, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
QDomNamedNodeMap attributes() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:11 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:26:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.