summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/filelistitem.h
blob: a45d1962a52c65288f71595e01342595b8d119f9 (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
/* $Id$ */
/* Directory tree entry */
/***************************************************************************
 *                                                                         *
 *   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 FILELISTITEM_H
#define FILELISTITEM_H

#include <qlistview.h>
#include <sys/stat.h>
#include <client.h>

enum dtype { IS_DIR = 0, IS_FILE = 1 };

namespace OpieTooth {

    class FileListItem : public QListViewItem {
        Q_OBJECT
    public:
        FileListItem(QListView * parent, stat_entry_t* ent, int size = 0);
        FileListItem(QListViewItem * parent, stat_entry_t* ent, int size = 0);
        virtual QString key ( int, bool ) const;
        virtual enum dtype gettype();
    protected:
        void init(stat_entry_t* ent, int size);
    protected:
        QString m_name; //name
        int m_size; //file (not directory) size
        enum dtype type; //type: file or directory
    };
};

#endif