• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDED

  • kded
kctimefactory.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2000 Waldo Bastian <bastian@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 2as 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
19#ifndef KDED_KCTIME_FACTORY_H
20#define KDED_KCTIME_FACTORY_H
21
22#include <ksycocafactory.h>
23#include <QtCore/QHash>
24
28class KCTimeDict
29{
30public:
31 void addCTime(const QString &path, const QByteArray& resource, quint32 ctime);
32 quint32 ctime(const QString &path, const QByteArray& resource) const;
33 void remove(const QString &path, const QByteArray& resource);
34 void dump() const;
35 bool isEmpty() const { return m_hash.isEmpty(); }
36 QStringList resourceList() const;
37
38 void load(QDataStream &str);
39 void save(QDataStream &str) const;
40private:
41 typedef QHash<QString, quint32> Hash;
42 Hash m_hash;
43};
44
49class KCTimeInfo : public KSycocaFactory // TODO rename to KCTimeFactory
50{
51 K_SYCOCAFACTORY( KST_CTimeInfo )
52public:
56 KCTimeInfo();
57
58 virtual ~KCTimeInfo();
59
63 virtual void saveHeader(QDataStream &str);
64
68 virtual void save(QDataStream &str);
69
70 KSycocaEntry * createEntry(const QString &, const char *) const { return 0; }
71 KSycocaEntry * createEntry(int) const { return 0; }
72
73 // Loads the dict and returns it; does not set m_ctimeDict;
74 // this is only used in incremental mode for loading the old timestamps.
75 KCTimeDict loadDict() const;
76
77 // The API for inserting/looking up entries is in KCTimeDict.
78 KCTimeDict* dict() { return &m_ctimeDict; }
79
80private:
81 KCTimeDict m_ctimeDict;
82 int m_dictOffset;
83};
84
85#endif
KCTimeDict
Simple dict for assocating a timestamp with each file in ksycoca.
Definition: kctimefactory.h:29
KCTimeDict::ctime
quint32 ctime(const QString &path, const QByteArray &resource) const
Definition: kctimefactory.cpp:37
KCTimeDict::isEmpty
bool isEmpty() const
Definition: kctimefactory.h:35
KCTimeDict::resourceList
QStringList resourceList() const
Definition: kctimefactory.cpp:52
KCTimeDict::remove
void remove(const QString &path, const QByteArray &resource)
Definition: kctimefactory.cpp:42
KCTimeDict::addCTime
void addCTime(const QString &path, const QByteArray &resource, quint32 ctime)
Definition: kctimefactory.cpp:31
KCTimeDict::dump
void dump() const
Definition: kctimefactory.cpp:47
KCTimeDict::load
void load(QDataStream &str)
Definition: kctimefactory.cpp:65
KCTimeInfo
Internal factory for storing the timestamp of each file in ksycoca.
Definition: kctimefactory.h:50
KCTimeInfo::save
virtual void save(QDataStream &str)
Write out data.
Definition: kctimefactory.cpp:113
KCTimeInfo::saveHeader
virtual void saveHeader(QDataStream &str)
Write out header information.
Definition: kctimefactory.cpp:106
KCTimeInfo::~KCTimeInfo
virtual ~KCTimeInfo()
Definition: kctimefactory.cpp:101
KCTimeInfo::dict
KCTimeDict * dict()
Definition: kctimefactory.h:78
KCTimeInfo::createEntry
KSycocaEntry * createEntry(const QString &, const char *) const
Definition: kctimefactory.h:70
KCTimeInfo::KCTimeInfo
KCTimeInfo()
Create factory.
Definition: kctimefactory.cpp:90
KCTimeInfo::createEntry
KSycocaEntry * createEntry(int) const
Definition: kctimefactory.h:71
KCTimeInfo::loadDict
KCTimeDict loadDict() const
Definition: kctimefactory.cpp:124
KSycocaEntry
KSycocaFactory
QHash
ksycocafactory.h
K_SYCOCAFACTORY
#define K_SYCOCAFACTORY(factory_id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDED

Skip menu "KDED"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal