Skip to content

Commit

Permalink
Only use the native openFileExplorerAndSelectFile for files
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Aug 3, 2018
1 parent 1fc6aab commit 9eb25bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/qgsmessagebaritem.cpp
Expand Up @@ -24,7 +24,7 @@
#include <QLabel>
#include <QTextBrowser>
#include <QDesktopServices>
#include <QFile>
#include <QFileInfo>

QgsMessageBarItem::QgsMessageBarItem( const QString &text, Qgis::MessageLevel level, int duration, QWidget *parent )
: QWidget( parent )
Expand Down Expand Up @@ -271,8 +271,8 @@ QgsMessageBarItem *QgsMessageBarItem::setDuration( int duration )

void QgsMessageBarItem::urlClicked( const QUrl &url )
{
const bool isFile = QFile::exists( url.toLocalFile() );
if ( isFile )
QFileInfo file( url.toLocalFile() );
if ( file.exists() && !file.isDir() )
QgsGui::instance()->nativePlatformInterface()->openFileExplorerAndSelectFile( url.toLocalFile() );
else
QDesktopServices::openUrl( url );
Expand Down

0 comments on commit 9eb25bc

Please sign in to comment.