added functionality when collapse tree change treeicon

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1286 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-05-31 23:06:14 +00:00
parent 8688e19c24
commit 39319f8345
2 changed files with 23 additions and 11 deletions

View File

@ -5,6 +5,7 @@
#include <QtGui>
#include <QIcon>
#include <QPixmap>
#include <iostream>
#include <sstream>
#include <math.h>
@ -20,11 +21,18 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
RemoteMode(mode), nIndex(1), indexSet(1) /* ass zero index cant be used */
{
setSupportedDragActions(Qt::CopyAction);
treeStyle();
}
void RemoteDirModel::treeStyle()
{
categoryIcon.addPixmap(QPixmap(":/images/folder16.png"),
QIcon::Normal, QIcon::Off);
categoryIcon.addPixmap(QPixmap(":/images/folder_video.png"),
QIcon::Normal, QIcon::On);
peerIcon = QIcon(":/images/user/identity16.png");
}
bool RemoteDirModel::hasChildren(const QModelIndex &parent) const
{
@ -245,14 +253,14 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
{
if (details.type == DIR_TYPE_PERSON)
{
switch(coln)
{
case 0:
return(QIcon(":/images/user/identity16.png"));
break;
}
}
{
switch(coln)
{
case 0:
return (QIcon(peerIcon));
break;
}
}
else if (details.type == DIR_TYPE_DIR)
{
switch(coln)
@ -266,7 +274,7 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
}
else
{
return(QIcon(":/images/folder16.png"));
return(QIcon(categoryIcon));
}
break;
}

View File

@ -68,7 +68,11 @@ virtual QStringList mimeTypes () const;
private:
void update (const QModelIndex &index );
void treeStyle();
QIcon categoryIcon;
QIcon peerIcon;
class RemoteIndex
{
public: