KDED
kbuildsycoca.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 * Copyright (C) 1999 David Faure <faure@kde.org> 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Library General Public 00006 * License version 2 as published by the Free Software Foundation; 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Library General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Library General Public License 00014 * along with this library; see the file COPYING.LIB. If not, write to 00015 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 * Boston, MA 02110-1301, USA. 00017 **/ 00018 #ifndef __kbuildsycoca_h__ 00019 #define __kbuildsycoca_h__ 00020 00021 #include <sys/stat.h> 00022 00023 #include <qobject.h> 00024 #include <qstring.h> 00025 #include <qdict.h> 00026 00027 #include <kservice.h> 00028 #include <ksycoca.h> 00029 #include <ksycocatype.h> 00030 #include <ksycocaentry.h> 00031 #include <kservicegroup.h> 00032 00033 #include "vfolder_menu.h" 00034 00035 class QDataStream; 00036 00037 // No need for this in libkio - apps only get readonly access 00038 class KBuildSycoca : public KSycoca 00039 { 00040 Q_OBJECT 00041 public: 00042 KBuildSycoca(); 00043 virtual ~KBuildSycoca(); 00044 00048 bool recreate(); 00049 00050 static bool checkTimestamps( Q_UINT32 timestamp, const QStringList &dirs ); 00051 00052 static QStringList existingResourceDirs(); 00053 00054 void setTrackId(const QString &id) { m_trackId = id; } 00055 00056 protected slots: 00057 void slotCreateEntry(const QString &file, KService **entry); 00058 00059 protected: 00060 00064 void processGnomeVfs(); 00065 00070 KSycocaEntry *createEntry(const QString &file, bool addToFactory); 00071 00075 void createMenu(QString caption, QString name, VFolderMenu::SubMenu *menu); 00076 00080 bool build(); 00081 00085 void save(); 00086 00090 void clear(); 00091 00092 static bool checkDirTimestamps( const QString& dir, const QDateTime& stamp, bool top ); 00093 00098 virtual bool isBuilding() { return true; } 00099 00100 QStringList m_allResourceDirs; 00101 QString m_trackId; 00102 }; 00103 00104 #endif