Skip to content

Commit

Permalink
fixed browser symlink icons
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed May 21, 2015
1 parent e3a832c commit c0361ba
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/core/qgsdataitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,8 @@ QgsDirectoryParamWidget::QgsDirectoryParamWidget( QString path, QWidget* parent
QStyle* style = QApplication::style();
QIcon iconDirectory = QIcon( style->standardPixmap( QStyle::SP_DirClosedIcon ) );
QIcon iconFile = QIcon( style->standardPixmap( QStyle::SP_FileIcon ) );
QIcon iconLink = QIcon( style->standardPixmap( QStyle::SP_FileLinkIcon ) ); // TODO: symlink to directory?
QIcon iconDirLink = QIcon( style->standardPixmap( QStyle::SP_DirLinkIcon ) );
QIcon iconFileLink = QIcon( style->standardPixmap( QStyle::SP_FileLinkIcon ) );

QList<QTreeWidgetItem *> items;

Expand Down Expand Up @@ -932,20 +933,25 @@ QgsDirectoryParamWidget::QgsDirectoryParamWidget( QString path, QWidget* parent

QString type;
QIcon icon;
if ( fi.isDir() )
if ( fi.isDir() && fi.isSymLink() )
{
type = tr( "folder" );
icon = iconDirLink;
}
else if ( fi.isDir() )
{
type = tr( "folder" );
icon = iconDirectory;
}
else if ( fi.isFile() )
else if ( fi.isFile() && fi.isSymLink() )
{
type = tr( "file" );
icon = iconFile;
icon = iconFileLink;
}
else if ( fi.isSymLink() )
else if ( fi.isFile() )
{
type = tr( "link" );
icon = iconLink;
type = tr( "file" );
icon = iconFile;
}

texts << type;
Expand Down

0 comments on commit c0361ba

Please sign in to comment.