summaryrefslogtreecommitdiff
authorkorovkin <korovkin>2006-03-20 21:43:19 (UTC)
committer korovkin <korovkin>2006-03-20 21:43:19 (UTC)
commit14fc21051eb3ff92527fd9ddeaf117009bd74af2 (patch) (unidiff)
treea4a949967e4452d8943ddfb04c92e5fbcd42b04e
parent39fedaa847ed64b2c0113a75d0f1de29da5876db (diff)
downloadopie-14fc21051eb3ff92527fd9ddeaf117009bd74af2.zip
opie-14fc21051eb3ff92527fd9ddeaf117009bd74af2.tar.gz
opie-14fc21051eb3ff92527fd9ddeaf117009bd74af2.tar.bz2
Added file size.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/filelistitem.cpp5
-rw-r--r--noncore/net/opietooth/manager/filelistitem.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/filelistitem.cpp b/noncore/net/opietooth/manager/filelistitem.cpp
index 86fcc54..a6d6bb5 100644
--- a/noncore/net/opietooth/manager/filelistitem.cpp
+++ b/noncore/net/opietooth/manager/filelistitem.cpp
@@ -47,25 +47,30 @@ void FileListItem::init(stat_entry_t* ent, int size)
47 else { 47 else {
48 setPixmap(0, Resource::loadPixmap("c_src")); 48 setPixmap(0, Resource::loadPixmap("c_src"));
49 setText(0, m_name); 49 setText(0, m_name);
50 m_size = size; 50 m_size = size;
51 setText(1, QString::number(m_size)); 51 setText(1, QString::number(m_size));
52 } 52 }
53} 53}
54 54
55QString FileListItem::key(int, bool) const 55QString FileListItem::key(int, bool) const
56{ 56{
57 QString str; //resulting string 57 QString str; //resulting string
58 if (type == IS_DIR) 58 if (type == IS_DIR)
59 str = "0"; 59 str = "0";
60 else 60 else
61 str = "1"; 61 str = "1";
62 str += m_name; 62 str += m_name;
63 return str; 63 return str;
64} 64}
65 65
66enum dtype FileListItem::gettype() 66enum dtype FileListItem::gettype()
67{ 67{
68 return type; 68 return type;
69} 69}
70 70
71int FileListItem::getsize()
72{
73 return m_size;
74}
75
71//eof 76//eof
diff --git a/noncore/net/opietooth/manager/filelistitem.h b/noncore/net/opietooth/manager/filelistitem.h
index a45d196..d4019bf 100644
--- a/noncore/net/opietooth/manager/filelistitem.h
+++ b/noncore/net/opietooth/manager/filelistitem.h
@@ -5,34 +5,35 @@
5 * This program is free software; you can redistribute it and/or modify * 5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by * 6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or * 7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. * 8 * (at your option) any later version. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11#ifndef FILELISTITEM_H 11#ifndef FILELISTITEM_H
12#define FILELISTITEM_H 12#define FILELISTITEM_H
13 13
14#include <qlistview.h> 14#include <qlistview.h>
15#include <sys/stat.h> 15#include <sys/stat.h>
16#include <client.h> 16#include <client.h>
17 17
18enum dtype { IS_DIR = 0, IS_FILE = 1 }; 18enum dtype { IS_DIR = 0, IS_FILE = 1 };
19 19
20namespace OpieTooth { 20namespace OpieTooth {
21 21
22 class FileListItem : public QListViewItem { 22 class FileListItem : public QListViewItem {
23 Q_OBJECT 23 Q_OBJECT
24 public: 24 public:
25 FileListItem(QListView * parent, stat_entry_t* ent, int size = 0); 25 FileListItem(QListView * parent, stat_entry_t* ent, int size = 0);
26 FileListItem(QListViewItem * parent, stat_entry_t* ent, int size = 0); 26 FileListItem(QListViewItem * parent, stat_entry_t* ent, int size = 0);
27 virtual QString key ( int, bool ) const; 27 virtual QString key ( int, bool ) const;
28 virtual enum dtype gettype(); 28 virtual enum dtype gettype();
29 virtual int getsize();
29 protected: 30 protected:
30 void init(stat_entry_t* ent, int size); 31 void init(stat_entry_t* ent, int size);
31 protected: 32 protected:
32 QString m_name; //name 33 QString m_name; //name
33 int m_size; //file (not directory) size 34 int m_size; //file (not directory) size
34 enum dtype type; //type: file or directory 35 enum dtype type; //type: file or directory
35 }; 36 };
36}; 37};
37 38
38#endif 39#endif