Skip to content
Permalink
Browse files

[layouts] Fix messagebar link with special characters does not open o…

…n win

Fixes #19727
  • Loading branch information
nyalldawson committed Sep 17, 2018
1 parent d37a799 commit a0dceb1d835a482ad5ad76723ec61d90bb6578f4
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/native/win/qgswinnative.cpp
@@ -68,12 +68,19 @@ void QgsWinNative::cleanup()
void QgsWinNative::openFileExplorerAndSelectFile( const QString &path )
{
const QString nativePath = QDir::toNativeSeparators( path );
ITEMIDLIST *pidl = ILCreateFromPath( nativePath.toUtf8().constData() );

wchar_t *pathArray = new wchar_t[static_cast< uint>( nativePath.length() + 1 )];
nativePath.toWCharArray(pathArray);
pathArray[nativePath.length()] = 0;

ITEMIDLIST *pidl = ILCreateFromPathW( pathArray );
if ( pidl )
{
SHOpenFolderAndSelectItems( pidl, 0, 0, 0 );
SHOpenFolderAndSelectItems( pidl, 0, nullptr, 0 );
ILFree( pidl );
}

delete[] pathArray;
}

void QgsWinNative::showUndefinedApplicationProgress()

0 comments on commit a0dceb1

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