summaryrefslogtreecommitdiffstats
path: root/ksquirrel/sq_thumbnailsunused.h
blob: a20122051ed70e8ea1c06d2e607cf7d2675898db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/***************************************************************************
                          sq_thumbnailsunused.h  -  description
                             -------------------
    begin                : Fri Jul 20 2007
    copyright            : (C) 2007 by Baryshev Dmitry
    email                : ksquirrel.iv@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SQ_THUMBNAILSUNUSED_H
#define SQ_THUMBNAILSUNUSED_H

#include <tqmap.h>
#include <tqobject.h>

#include <kurl.h>

#include <ctime>

class KConfig;

/*
 *  This is small helper class for thumbnail loader. It is used only on
 *  non-local filesystems to cache information on unsupported file
 *  types to avoid downloading them from [possibly] slow kio-slave
 *  (for example, smb:/ on slow network).
 */

class SQ_ThumbnailsUnused : public TQObject, public TQMap<KURL, time_t>
{
    public:
        SQ_ThumbnailsUnused(TQObject *tqparent = 0);
        ~SQ_ThumbnailsUnused();

        bool needUpdate(const KURL &u, time_t t);

        static SQ_ThumbnailsUnused* instance() { return m_instance; };

    private:
        void load();
        void save();

    private:
        static SQ_ThumbnailsUnused *m_instance;
        KConfig *cache;
};

#endif