TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tdebuildsycoca.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* This file is part of the KDE libraries
  2. * Copyright (C) 1999 David Faure <faure@kde.org>
  3. *
  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;
  7. *
  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.
  12. *
  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.
  17. **/
  18. #ifndef __tdebuildsycoca_h__
  19. #define __tdebuildsycoca_h__
  20. #include <sys/stat.h>
  21. #include <tqobject.h>
  22. #include <tqstring.h>
  23. #include <tqdict.h>
  24. #include <kservice.h>
  25. #include <tdesycoca.h>
  26. #include <tdesycocatype.h>
  27. #include <tdesycocaentry.h>
  28. #include <kservicegroup.h>
  29. #include "vfolder_menu.h"
  30. class TQDataStream;
  31. // No need for this in libtdeio - apps only get readonly access
  32. class KBuildSycoca : public KSycoca
  33. {
  34. Q_OBJECT
  35. public:
  36. KBuildSycoca();
  37. virtual ~KBuildSycoca();
  38. /**
  39. * Recreate the database file
  40. */
  41. bool recreate();
  42. static bool checkTimestamps( TQ_UINT32 timestamp, const TQStringList &dirs );
  43. static TQStringList existingResourceDirs();
  44. void setTrackId(const TQString &id) { m_trackId = id; }
  45. protected slots:
  46. void slotCreateEntry(const TQString &file, KService **entry);
  47. protected:
  48. /**
  49. * Look up gnome mimetypes.
  50. */
  51. void processGnomeVfs();
  52. /**
  53. * Add single entry to the sycoca database.
  54. * Either from a previous database or regenerated from file.
  55. */
  56. KSycocaEntry *createEntry(const TQString &file, bool addToFactory);
  57. /**
  58. * Convert a VFolderMenu::SubMenu to KServiceGroups.
  59. */
  60. void createMenu(TQString caption, TQString name, VFolderMenu::SubMenu *menu);
  61. /**
  62. * Build the whole system cache, from .desktop files
  63. */
  64. bool build();
  65. /**
  66. * Save the tdesycoca file
  67. */
  68. void save();
  69. /**
  70. * Clear the factories
  71. */
  72. void clear();
  73. static bool checkDirTimestamps( const TQString& dir, const TQDateTime& stamp, bool top );
  74. /**
  75. * @internal
  76. * @return true if building (i.e. if a KBuildSycoca);
  77. */
  78. virtual bool isBuilding() { return true; }
  79. TQStringList m_allResourceDirs;
  80. TQString m_trackId;
  81. };
  82. #endif