mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-19 21:04:32 -05:00
* Fixed icons in Files Dialog to add only icons to column 0
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@817 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
939815a62b
commit
c2e85b3f17
@ -234,20 +234,30 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||||||
|
|
||||||
if (details.type == DIR_TYPE_PERSON)
|
if (details.type == DIR_TYPE_PERSON)
|
||||||
{
|
{
|
||||||
//setData(QIcon(":/images/user/identity16.png"));
|
switch(coln)
|
||||||
QIcon icon1(":/images/user/identity16.png");
|
{
|
||||||
return icon1;
|
case 0:
|
||||||
|
QIcon icon(":/images/user/identity16.png");
|
||||||
|
return icon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (details.type == DIR_TYPE_DIR)
|
else if (details.type == DIR_TYPE_DIR)
|
||||||
{
|
{
|
||||||
//setData(QIcon(":/images/folder_green16.png"));
|
switch(coln)
|
||||||
QIcon icon(":/images/folder16.png");
|
{
|
||||||
return icon;
|
case 0:
|
||||||
|
return(QIcon(":/images/folder16.png"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (details.type == DIR_TYPE_FILE) /* File */
|
else if (details.type == DIR_TYPE_FILE) /* File */
|
||||||
{
|
{
|
||||||
// extensions predefined
|
// extensions predefined
|
||||||
//QString name;
|
//QString name;
|
||||||
|
switch(coln)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
QString ext = QFileInfo(QString::fromStdString(details.name)).suffix();
|
QString ext = QFileInfo(QString::fromStdString(details.name)).suffix();
|
||||||
if (ext == "jpg" || ext == "jpeg" || ext == "png" || ext == "gif"
|
if (ext == "jpg" || ext == "jpeg" || ext == "png" || ext == "gif"
|
||||||
|| ext == "bmp" || ext == "ico" || ext == "svg")
|
|| ext == "bmp" || ext == "ico" || ext == "svg")
|
||||||
@ -287,7 +297,7 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||||||
|| ext == "sxc" || ext == "odt" || ext == "ods")
|
|| ext == "sxc" || ext == "odt" || ext == "ods")
|
||||||
{
|
{
|
||||||
//setIcon(0, QIcon(":/images/docfile.png"));
|
//setIcon(0, QIcon(":/images/docfile.png"));
|
||||||
QIcon icon(":/images/FileTypeDocument.png");
|
QIcon icon(":/images/FileTypeDocument.png");
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
else if (ext == "html" || ext == "htm" || ext == "php")
|
else if (ext == "html" || ext == "htm" || ext == "php")
|
||||||
@ -302,6 +312,8 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||||||
QIcon icon(":/images/FileTypeAny.png");
|
QIcon icon(":/images/FileTypeAny.png");
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -368,8 +380,10 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << details.age;
|
QDateTime datum = QDateTime::fromTime_t(details.age);
|
||||||
return QString::fromStdString(out.str());
|
QString stime = datum.toString(Qt::LocalDate);
|
||||||
|
//out << details.age;
|
||||||
|
return QString(stime);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user