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 KDED_KBUILDSYCOCA_H 00019 #define KDED_KBUILDSYCOCA_H 00020 00021 #include <sys/stat.h> 00022 00023 #include <QtCore/QObject> 00024 #include <QtCore/QString> 00025 00026 #include <kservice.h> 00027 #include <ksycoca.h> 00028 #include <ksycocatype.h> 00029 #include <ksycocaentry.h> 00030 #include <kservicegroup.h> 00031 00032 #include "vfolder_menu.h" 00033 00034 class QDataStream; 00035 00036 // No need for this in libkio - apps only get readonly access 00037 class KBuildSycoca : public KSycoca 00038 { 00039 Q_OBJECT 00040 public: 00041 KBuildSycoca(); 00042 virtual ~KBuildSycoca(); 00043 00047 bool recreate(); 00048 00049 static bool checkTimestamps( quint32 timestamp, const QStringList &dirs ); 00050 00051 static QStringList existingResourceDirs(); 00052 00053 void setTrackId(const QString &id) { m_trackId = id; } 00054 00055 protected Q_SLOTS: 00056 void slotCreateEntry(const QString &file, KService::Ptr *entry); 00057 00058 protected: 00059 00063 void processGnomeVfs(); 00064 00069 KSycocaEntry::Ptr createEntry(const QString &file, bool addToFactory); 00070 00074 void createMenu(const QString &caption, const QString &name, VFolderMenu::SubMenu *menu); 00075 00079 bool build(); 00080 00084 void save(); 00085 00089 void clear(); 00090 00091 static bool checkDirTimestamps( const QString& dir, const QDateTime& stamp, bool top ); 00092 00097 virtual bool isBuilding() { return true; } 00098 00099 QStringList m_allResourceDirs; 00100 QString m_trackId; 00101 }; 00102 00103 #endif