File: kcmtrash.h

package info (click to toggle)
kio-extras 4%3A25.04.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 31,928 kB
  • sloc: cpp: 28,852; ansic: 3,084; perl: 1,048; xml: 116; sh: 92; python: 28; makefile: 9
file content (67 lines) | stat: -rw-r--r-- 1,309 bytes parent folder | download
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
57
58
59
60
61
62
63
64
65
66
67
/*
    SPDX-FileCopyrightText: 2008 Tobias Koenig <tokoe@kde.org>

    SPDX-License-Identifier: GPL-2.0-or-later
*/

#ifndef KCMTRASH_H
#define KCMTRASH_H

#include <KCModule>

class QCheckBox;
class QComboBox;
class QDoubleSpinBox;
class QFrame;
class QLabel;
class QListWidgetItem;
class QSpinBox;

/**
 * @brief Allow to configure the trash.
 */
class TrashConfigModule : public KCModule
{
    Q_OBJECT

public:
    TrashConfigModule(QObject *parent, const KPluginMetaData &data);
    ~TrashConfigModule() override;

    void save() override;
    void defaults() override;

private Q_SLOTS:
    void percentChanged(double);
    void trashChanged(int);
    void useTypeChanged();

private:
    void readConfig();
    void writeConfig();
    void setupGui();

    QCheckBox *mUseTimeLimit;
    QSpinBox *mDays;
    QCheckBox *mUseSizeLimit;
    QWidget *mSizeWidget;
    QDoubleSpinBox *mPercent;
    QLabel *mSizeLabel;
    QComboBox *mLimitReachedAction;

    QString mCurrentTrash;
    bool trashInitialize;
    typedef struct {
        bool useTimeLimit;
        int days;
        bool useSizeLimit;
        double percent;
        int actionType;
    } ConfigEntry;

    typedef QMap<QString, ConfigEntry> ConfigMap;
    ConfigMap mConfigMap;
    QMap<int, QString> m_trashMap;
};

#endif // KCMTRASH_H