Skip to content
Permalink
Browse files

Only use the native openFileExplorerAndSelectFile for files

  • Loading branch information
nirvn committed Aug 3, 2018
1 parent 1fc6aab commit 9eb25bca29e8d7e03eb9ba472eec7a090017e6fc
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/gui/qgsmessagebaritem.cpp
@@ -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 )
@@ -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 );

0 comments on commit 9eb25bc

Please sign in to comment.
You can’t perform that action at this time.