1 /* This file is part of the KDE libraries
2 * Copyright (C) 1999 David Faure <faure@kde.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License version 2 as published by the Free Software Foundation;
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public License
14 * along with this library; see the file COPYING.LIB. If not, write to
15 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
18 #ifndef KDED_KBUILDSYCOCA_H
19 #define KDED_KBUILDSYCOCA_H
23 #include <QtCore/QObject>
24 #include <QtCore/QString>
28 #include <ksycocatype.h>
29 #include <ksycocaentry.h>
30 #include <kservicegroup.h>
32 #include "vfolder_menu.h"
36 // No need for this in libkio - apps only get readonly access
37 class KBuildSycoca
: public KSycoca
42 virtual ~KBuildSycoca();
45 * Recreate the database file
49 static bool checkTimestamps( quint32 timestamp
, const QStringList
&dirs
);
51 static QStringList
existingResourceDirs();
53 void setTrackId(const QString
&id
) { m_trackId
= id
; }
56 void slotCreateEntry(const QString
&file
, KService::Ptr
*entry
);
61 * Look up gnome mimetypes.
63 void processGnomeVfs();
66 * Add single entry to the sycoca database.
67 * Either from a previous database or regenerated from file.
69 KSycocaEntry::Ptr
createEntry(const QString
&file
, bool addToFactory
);
72 * Convert a VFolderMenu::SubMenu to KServiceGroups.
74 void createMenu(const QString
&caption
, const QString
&name
, VFolderMenu::SubMenu
*menu
);
77 * Build the whole system cache, from .desktop files
82 * Save the ksycoca file
91 static bool checkDirTimestamps( const QString
& dir
, const QDateTime
& stamp
, bool top
);
95 * @return true if building (i.e. if a KBuildSycoca);
97 virtual bool isBuilding() { return true; }
99 QStringList m_allResourceDirs
;