mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 02:55:18 -04:00
made the age indicator functional, by recursively changing color of directory/files
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2244 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
38b0c578bb
commit
024e7f4b44
10 changed files with 114 additions and 62 deletions
|
@ -30,11 +30,10 @@
|
|||
#include "util/misc.h"
|
||||
#include "rsiface/rstypes.h"
|
||||
|
||||
#define IND_DEFAULT 0
|
||||
#define IND_LAST_DAY 1
|
||||
#define IND_LAST_WEEK 2
|
||||
#define IND_LAST_MONTH 3
|
||||
#define IND_OLDER 4
|
||||
static const uint32_t IND_LAST_DAY = 3600*24 ;
|
||||
static const uint32_t IND_LAST_WEEK = 3600*24*7 ;
|
||||
static const uint32_t IND_LAST_MONTH = 3600*24*31 ; // I know, this is approximate
|
||||
static const uint32_t IND_ALWAYS = ~(uint32_t)0 ;
|
||||
|
||||
class RemoteDirModel : public QAbstractItemModel
|
||||
{
|
||||
|
@ -82,13 +81,13 @@ class RemoteDirModel : public QAbstractItemModel
|
|||
|
||||
void getFilePaths(QModelIndexList list, std::list<std::string> &fullpaths);
|
||||
|
||||
void changeAgeIndicator(int indicator) { ageIndicator = indicator; }
|
||||
void changeAgeIndicator(uint32_t indicator) { ageIndicator = indicator; }
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
void collapsed ( const QModelIndex & index ) { update(index); }
|
||||
void expanded ( const QModelIndex & index ) { update(index); }
|
||||
// void collapsed ( const QModelIndex & index ) { update(index); }
|
||||
// void expanded ( const QModelIndex & index ) { update(index); }
|
||||
|
||||
/* Drag and Drop Functionality */
|
||||
public:
|
||||
|
@ -97,14 +96,14 @@ class RemoteDirModel : public QAbstractItemModel
|
|||
virtual QStringList mimeTypes () const;
|
||||
|
||||
private:
|
||||
void update (const QModelIndex &index );
|
||||
// void update (const QModelIndex &index );
|
||||
void treeStyle();
|
||||
void downloadDirectory(const DirDetails & details, int prefixLen);
|
||||
static QString getFlagsString(uint32_t) ;
|
||||
QString getAgeIndicatorString(const DirDetails &) const;
|
||||
void getAgeIndicatorRec(DirDetails &details, QString &ret) const;
|
||||
|
||||
int ageIndicator;
|
||||
uint32_t ageIndicator;
|
||||
|
||||
QIcon categoryIcon;
|
||||
QIcon peerIcon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue