Skip to content

Commit 282ad5f

Browse files
authoredMay 23, 2019
remove old hack for Qt 4.8
upstream issue has been fixed see https://bugreports.qt.io/browse/QTBUG-40449
1 parent f000956 commit 282ad5f

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,51 +1654,6 @@ void QgisApp::dropEvent( QDropEvent *event )
16541654
for ( i = urls.begin(); i != urls.end(); ++i )
16551655
{
16561656
QString fileName = i->toLocalFile();
1657-
#ifdef Q_OS_MAC
1658-
// Mac OS X 10.10, under Qt4.8 ,changes dropped URL format
1659-
// https://bugreports.qt.io/browse/QTBUG-40449
1660-
// [pzion 20150805] Work around
1661-
if ( fileName.startsWith( "/.file/id=" ) )
1662-
{
1663-
QgsDebugMsg( QStringLiteral( "Mac dropped URL with /.file/id= (converting)" ) );
1664-
CFStringRef relCFStringRef =
1665-
CFStringCreateWithCString(
1666-
kCFAllocatorDefault,
1667-
fileName.toUtf8().constData(),
1668-
kCFStringEncodingUTF8
1669-
);
1670-
CFURLRef relCFURL =
1671-
CFURLCreateWithFileSystemPath(
1672-
kCFAllocatorDefault,
1673-
relCFStringRef,
1674-
kCFURLPOSIXPathStyle,
1675-
false // isDirectory
1676-
);
1677-
CFErrorRef error = 0;
1678-
CFURLRef absCFURL =
1679-
CFURLCreateFilePathURL(
1680-
kCFAllocatorDefault,
1681-
relCFURL,
1682-
&error
1683-
);
1684-
if ( !error )
1685-
{
1686-
static const CFIndex maxAbsPathCStrBufLen = 4096;
1687-
char absPathCStr[maxAbsPathCStrBufLen];
1688-
if ( CFURLGetFileSystemRepresentation(
1689-
absCFURL,
1690-
true, // resolveAgainstBase
1691-
reinterpret_cast<UInt8 *>( &absPathCStr[0] ),
1692-
maxAbsPathCStrBufLen ) )
1693-
{
1694-
fileName = QString( absPathCStr );
1695-
}
1696-
}
1697-
CFRelease( absCFURL );
1698-
CFRelease( relCFURL );
1699-
CFRelease( relCFStringRef );
1700-
}
1701-
#endif
17021657
// seems that some drag and drop operations include an empty url
17031658
// so we test for length to make sure we have something
17041659
if ( !fileName.isEmpty() )

0 commit comments

Comments
 (0)
Please sign in to comment.