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 "kbuildsycocainterface.h" 00022 00023 #include <sys/stat.h> 00024 00025 #include <QtCore/QObject> 00026 #include <QtCore/QString> 00027 00028 #include <kservice.h> 00029 #include <ksycoca.h> 00030 #include <ksycocatype.h> 00031 #include <ksycocaentry.h> 00032 #include <kservicegroup.h> 00033 00034 #include "vfolder_menu.h" 00035 00036 class QDataStream; 00037 00038 // No need for this in libkio - apps only get readonly access 00039 class KBuildSycoca : public KSycoca, public KBuildSycocaInterface 00040 { 00041 Q_OBJECT 00042 public: 00043 KBuildSycoca(); 00044 virtual ~KBuildSycoca(); 00045 00049 bool recreate(); 00050 00051 static bool checkTimestamps( quint32 timestamp, const QStringList &dirs ); 00052 00053 static QStringList existingResourceDirs(); 00054 00055 void setTrackId(const QString &id) { m_trackId = id; } 00056 00057 QStringList changedResources() const { return m_changedResources; } 00058 00059 // Use our friendly-access-to-KSycoca to make this public 00060 static void clearCaches() { KSycoca::clearCaches(); } 00061 00062 private: 00067 KSycocaEntry::Ptr createEntry(const QString &file, bool addToFactory); 00068 KService::Ptr createService(const QString& path); 00074 00078 void createMenu(const QString &caption, const QString &name, VFolderMenu::SubMenu *menu); 00079 00083 bool build(); 00084 00088 void save(QDataStream* str); 00089 00093 void clear(); 00094 00095 static bool checkDirTimestamps( const QString& dir, const QDateTime& stamp, bool top ); 00096 00101 virtual bool isBuilding() { return true; } 00102 00103 QStringList m_changedResources; 00104 QStringList m_allResourceDirs; 00105 QString m_trackId; 00106 }; 00107 00108 #endif
KDE 4.6 API Reference