https://issues.qgis.org/https://issues.qgis.org/favicon.ico2014-10-19T01:14:31ZQGIS Issue TrackingQGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=564592014-10-19T01:14:31ZAnita Graseranitagraser@gmx.at
<ul></ul><p>The path to the file looks very fishy, especially with the = sign ...</p>
<p>/.file/id=6571367</p>
<p>Have you tried moving the files to a clean path like /home/temp?</p> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=564622014-10-19T01:58:31Zdavid dellatoredave@orangutans-sos.org
<ul></ul><p>Greetings and thank you for the response.</p>
<p>I have tried moving files (which were in dropbox folder) to the desktop, to my home directory, and to /home/public, all with the same result with drag/drop:</p>
<blockquote>
<p>Invalid Data Source: /.file/id=6571367.3678663 is not a valid or recognized data source</p>
</blockquote>
<p>However when double clicking the same .shp from the finder, the files open up fine in QGIS - so that the functionality is partly there, but still something missing.</p>
<blockquote>
<p>The path to the file looks very fishy, especially with the = sign ...</p>
<p>/.file/id=6571367</p>
<p>Have you tried moving the files to a clean path like /home/temp?</p>
</blockquote> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=564632014-10-19T02:18:07Zdavid dellatoredave@orangutans-sos.org
<ul><li><strong>File</strong> <a href="/attachments/download/7973/Screen_Shot_2014-10-19_at_13.15.36.png">Screen_Shot_2014-10-19_at_13.15.36.png</a> added</li></ul><p>Just for info - have tried installing qgis-22, and the same error remains. Have attached a screenshot for context.</p> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=565442014-10-20T06:16:17ZJohn Tull
<ul></ul><p>This issue exists in trunk also. It has been present for some time. I was just looking to post a bug report, but this bug covers it.</p>
<p>To summarize, the browser in qgis works fine for adding files. Double-clicking a shapefile in the Finder will add it to qgis. Using the 'Add vector layer...' menu item and browsing to your file will work. Dragging a shapefile (or any suitable raster or vector layer) results in an error, "Invalid data source ...".</p>
<p>My OS X version is 10.10, had the problem during beta testing of 10.10 also. I do not recall if this issue existed on 10.9.</p> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=565452014-10-20T06:17:20ZJohn Tull
<ul><li><strong>Target version</strong> set to <i>Version 2.6</i></li><li><strong>Operating System</strong> set to <i>OSX</i></li></ul> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=570392014-10-31T04:55:26ZJürgen Fischerjef@norbit.de
<ul><li><strong>Target version</strong> changed from <i>Version 2.6</i> to <i>Future Release - High Priority</i></li></ul> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=571452014-11-04T07:41:17ZJohn Tull
<ul><li><strong>Subject</strong> changed from <i>Unable to add shapefiles via drag and drop</i> to <i>Unable to add raster and vector files via drag and drop on OS X 10.10</i></li></ul><p>I updated the title of this bug to properly reflect the greater issue, i.e., the inability to load both vector and raster files via drag and drop on OS X 10.10. If others with older OS versions can confirm this issue is not specific to Yosemite (10.10), please update the title.</p>
<p>Here is further information on this as it has been documented in the Qt bug tracker:<br /><a class="external" href="https://bugreports.qt-project.org/browse/QTBUG-40449">https://bugreports.qt-project.org/browse/QTBUG-40449</a></p>
<p>Perhaps a solution lies therein?</p> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=586202015-01-13T00:24:55ZBenoit de Cabissole
<ul><li><strong>Operating System</strong> changed from <i>OSX</i> to <i>OSX, WIN8.1</i></li></ul><p>Also happens on Dev. versions since at least beginning of December 2014, on Windows 8.1.</p> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=621892015-06-08T18:04:55ZLarry Shaffer
<ul></ul><p>Hi,</p>
<p>This can be fixed for Qt 4.8.x, but requires direct access to the Cocoa API when needed to introduce the workarounds noted in the QTBUG-40449.</p>
<p>Btw, this is an example of <a href="https://github.com/qgis/QGIS/pull/1084" class="external">my old PR</a> to introduce abstracted calls to the OS (Mac for example, with Objective-C++) to handle changes in OS API libraries and keep such workarounds in one place instead of peppered throughout the source tree.</p>
<p>I suppose the same could be done for Win as well.</p> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=642262015-10-07T08:03:26ZJohn Tull
<ul></ul><p>The references qt bug has a comment from Aug 2015 with the following workaround code that should work with recent qt4. Perhaps this can be worked into qgis code to fix this issue that is quite the show-stopper on OS X:</p>
<pre>
QString localFileQString = url.toLocalFile();
// [pzion 20150805] Work around
// https://bugreports.qt.io/browse/QTBUG-40449
if ( localFileQString.startsWith("/.file/id=") )
{
CFStringRef relCFStringRef =
CFStringCreateWithCString(
kCFAllocatorDefault,
localFileQString.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
) )
{
localFileQString = QString( absPathCStr );
}
}
CFRelease( absCFURL );
CFRelease( relCFURL );
CFRelease( relCFStringRef );
}
</pre> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=642292015-10-07T09:09:54ZLarry Shaffer
<ul><li><strong>Assignee</strong> set to <i>Larry Shaffer</i></li></ul> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=642322015-10-07T11:25:45ZLarry Shaffer
<ul></ul><p>Hi John,</p>
<p>Have you verified that the fix you note works for OS X 10.10?</p> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=642822015-10-08T06:46:24ZJohn Tull
<ul></ul><p>Hi Larry,</p>
<p>No, I don't have the coding skills to apply this to qgis code. I was hoping someone else would come up with a way to implement this workaround and we could test from there.</p> QGIS Application - Bug report #11399: Unable to add raster and vector files via drag and drop on OS X 10.10https://issues.qgis.org/issues/11399?journal_id=648312015-10-23T00:15:09ZLarry Shaffer
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Fixed in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/220affbf9c74391bd13be5173368e3e2e043ccac" title="Fix #11399; fix up Mac OS X 10.10+ dropped file URLs">220affbf9c74391bd13be5173368e3e2e043ccac</a>.</p>