Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove old hack for Qt 4.8
upstream issue has been fixed
see https://bugreports.qt.io/browse/QTBUG-40449
  • Loading branch information
3nids committed May 23, 2019
1 parent f000956 commit 282ad5f
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/app/qgisapp.cpp
Expand Up @@ -1654,51 +1654,6 @@ void QgisApp::dropEvent( QDropEvent *event )
for ( i = urls.begin(); i != urls.end(); ++i )
{
QString fileName = i->toLocalFile();
#ifdef Q_OS_MAC
// Mac OS X 10.10, under Qt4.8 ,changes dropped URL format
// https://bugreports.qt.io/browse/QTBUG-40449
// [pzion 20150805] Work around
if ( fileName.startsWith( "/.file/id=" ) )
{
QgsDebugMsg( QStringLiteral( "Mac dropped URL with /.file/id= (converting)" ) );
CFStringRef relCFStringRef =
CFStringCreateWithCString(
kCFAllocatorDefault,
fileName.toUtf8().constData(),
kCFStringEncodingUTF8
);
CFURLRef relCFURL =
CFURLCreateWithFileSystemPath(
kCFAllocatorDefault,
relCFStringRef,
kCFURLPOSIXPathStyle,
false // isDirectory
);
CFErrorRef error = 0;
CFURLRef absCFURL =
CFURLCreateFilePathURL(
kCFAllocatorDefault,
relCFURL,
&error
);
if ( !error )
{
static const CFIndex maxAbsPathCStrBufLen = 4096;
char absPathCStr[maxAbsPathCStrBufLen];
if ( CFURLGetFileSystemRepresentation(
absCFURL,
true, // resolveAgainstBase
reinterpret_cast<UInt8 *>( &absPathCStr[0] ),
maxAbsPathCStrBufLen ) )
{
fileName = QString( absPathCStr );
}
}
CFRelease( absCFURL );
CFRelease( relCFURL );
CFRelease( relCFStringRef );
}
#endif
// seems that some drag and drop operations include an empty url
// so we test for length to make sure we have something
if ( !fileName.isEmpty() )
Expand Down

0 comments on commit 282ad5f

Please sign in to comment.