mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 01:10:19 -05:00
added for files icons too
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@668 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3bdd429200
commit
3cdb34ed02
@ -241,6 +241,63 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||||||
QIcon icon(":/images/folder16.png");
|
QIcon icon(":/images/folder16.png");
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
else if (details.type == DIR_TYPE_FILE) /* File */
|
||||||
|
{
|
||||||
|
// extensions predefined
|
||||||
|
QString name;
|
||||||
|
QString ext = QFileInfo(name).suffix();
|
||||||
|
if (ext == "jpg" || ext == "jpeg" || ext == "png" || ext == "gif"
|
||||||
|
|| ext == "bmp" || ext == "ico" || ext == "svg")
|
||||||
|
{
|
||||||
|
//setIcon(0, QIcon(":/images/FileTypePicture.png"));
|
||||||
|
QIcon icon(":/images/FileTypePicture.png");
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
else if (ext == "avi" || ext == "mpg" || ext == "mpeg" || ext == "wmv")
|
||||||
|
{
|
||||||
|
//setIcon(0, QIcon(":/images/videofile.png"));
|
||||||
|
QIcon icon(":/images/FileTypeVideo.png");
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
else if (ext == "ogg" || ext == "mp3" || ext == "wav" || ext == "wma")
|
||||||
|
{
|
||||||
|
//setIcon(0, QIcon(":/images/soundfile.png"));
|
||||||
|
QIcon icon(":/images/FileTypeAudio.png");
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
else if (ext == "tar" || ext == "bz2" || ext == "zip" || ext == "gz"
|
||||||
|
|| ext == "rar" || ext == "rpm" || ext == "deb")
|
||||||
|
{
|
||||||
|
//setIcon(0, QIcon(":/images/compressedfile.png"));
|
||||||
|
QIcon icon(":/images/FileTypeArchive.png");
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
else if (ext == "txt" || ext == "cpp" || ext == "c" || ext == "h")
|
||||||
|
{
|
||||||
|
//setIcon(0, QIcon(":/images/txtfile.png"));
|
||||||
|
QIcon icon(":/images/FileTypeDocument.png");
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
else if (ext == "doc" || ext == "rtf" || ext == "sxw" || ext == "xls"
|
||||||
|
|| ext == "sxc" || ext == "odt" || ext == "ods")
|
||||||
|
{
|
||||||
|
//setIcon(0, QIcon(":/images/docfile.png"));
|
||||||
|
QIcon icon(":/images/FileTypeDocument.png");
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
else if (ext == "html" || ext == "htm" || ext == "php")
|
||||||
|
{
|
||||||
|
//setIcon(0, QIcon(":/images/netfile.png"));
|
||||||
|
QIcon icon(":/images/FileTypeDocument.png");
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//setIcon(0, QIcon(":/images/file.png"));
|
||||||
|
QIcon icon(":/images/FileTypeAny.png");
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user