When KLayout 0.25 is built with Qt 5.8.0 or later, this workaround is not required.

This refs #1.
This commit is contained in:
Kazunari Sekigawa 2017-12-12 20:50:23 +09:00
parent 9e3b4681e2
commit bded8f9fa4
1 changed files with 230 additions and 225 deletions

View File

@ -37,7 +37,7 @@
#include <QUrl> #include <QUrl>
#include <QMimeData> #include <QMimeData>
#if defined(__APPLE__) #if defined(__APPLE__) && (QT_VERSION < 0x050401)
// A workaround for the issue of Qt 4.8.x when handling "File Reference URL" in OSX // A workaround for the issue of Qt 4.8.x when handling "File Reference URL" in OSX
// By Kazunari Sekigawa (November 12, 2015) // By Kazunari Sekigawa (November 12, 2015)
// Search down for my name for more details! // Search down for my name for more details!
@ -5492,12 +5492,12 @@ MainWindow::dropEvent(QDropEvent *event)
if (eff_url.scheme () == QString::fromUtf8 ("file")) { if (eff_url.scheme () == QString::fromUtf8 ("file")) {
path = url->toLocalFile (); path = url->toLocalFile ();
#if defined(__APPLE__) #if defined(__APPLE__) && (QT_VERSION < 0x050401)
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
// By Kazunari Sekigawa (November 12, 2015) // By Kazunari Sekigawa (November 12, 2015)
// //
// [Issue] // [Issue]
// When drag & dropping an GDS2/OASIS file from Finder, an error like below flags on: // When drag & dropping a GDS2/OASIS file from Finder, an error like below flags on:
// Unable to open file: /.file/id=6571367.1783076 (errno=20) // Unable to open file: /.file/id=6571367.1783076 (errno=20)
// http://klayout.de/forum/comments.php?DiscussionID=733&page=1#Item_0 // http://klayout.de/forum/comments.php?DiscussionID=733&page=1#Item_0
// //
@ -5509,6 +5509,11 @@ MainWindow::dropEvent(QDropEvent *event)
// https://bugreports.qt.io/browse/QTBUG-40449 // https://bugreports.qt.io/browse/QTBUG-40449
// Sub: OS X Yosemite drag and drop file QUrl in this format: "file:///.file/id=......" // Sub: OS X Yosemite drag and drop file QUrl in this format: "file:///.file/id=......"
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
// By Kazunari Sekigawa (December 12, 2017)
//
// This bug has been fixed in Qt 5.4.1.
// When KLayout 0.25 is built with Qt 5.8.0 or later, this workaround is not required.
//----------------------------------------------------------------------------------------
QString keystring = QString::fromUtf8("/.file/id="); QString keystring = QString::fromUtf8("/.file/id=");
if ( path.startsWith(keystring) ) { if ( path.startsWith(keystring) ) {