[Sv1-commits] SF.net SVN: sv1: [883] sonic-visualiser/branches/1.2-stable
Brought to you by:
cannam
From: <ca...@us...> - 2007-11-29 17:16:08
|
Revision: 883 http://sv1.svn.sourceforge.net/sv1/?rev=883&view=rev Author: cannam Date: 2007-11-29 09:16:02 -0800 (Thu, 29 Nov 2007) Log Message: ----------- * merge fixes from trunk Modified Paths: -------------- sonic-visualiser/branches/1.2-stable/data/fileio/FileFinder.cpp sonic-visualiser/branches/1.2-stable/framework/Document.cpp Modified: sonic-visualiser/branches/1.2-stable/data/fileio/FileFinder.cpp =================================================================== --- sonic-visualiser/branches/1.2-stable/data/fileio/FileFinder.cpp 2007-11-29 17:10:53 UTC (rev 882) +++ sonic-visualiser/branches/1.2-stable/data/fileio/FileFinder.cpp 2007-11-29 17:16:02 UTC (rev 883) @@ -378,15 +378,15 @@ QString FileFinder::find(FileType type, QString location, QString lastKnownLocation) { - if (QFileInfo(location).exists()) return location; - - if (FileSource::isRemote(location)) { + if (FileSource::canHandleScheme(location)) { if (FileSource(location).isAvailable()) { std::cerr << "FileFinder::find: ok, it's available... returning" << std::endl; return location; } } + if (QFileInfo(location).exists()) return location; + QString foundAt = ""; if ((foundAt = findRelative(location, lastKnownLocation)) != "") { @@ -415,6 +415,9 @@ fileName = QUrl(location).path().section('/', -1, -1, QString::SectionSkipEmpty); } else { + if (QUrl(location).scheme() == "file") { + location = QUrl(location).toLocalFile(); + } fileName = QFileInfo(location).fileName(); } @@ -423,6 +426,9 @@ if (!FileSource(resolved).isAvailable()) resolved = ""; std::cerr << "resolved: " << resolved.toStdString() << std::endl; } else { + if (QUrl(relativeTo).scheme() == "file") { + relativeTo = QUrl(relativeTo).toLocalFile(); + } resolved = QFileInfo(relativeTo).dir().filePath(fileName); if (!QFileInfo(resolved).exists() || !QFileInfo(resolved).isFile() || Modified: sonic-visualiser/branches/1.2-stable/framework/Document.cpp =================================================================== --- sonic-visualiser/branches/1.2-stable/framework/Document.cpp 2007-11-29 17:10:53 UTC (rev 882) +++ sonic-visualiser/branches/1.2-stable/framework/Document.cpp 2007-11-29 17:16:02 UTC (rev 883) @@ -271,7 +271,7 @@ // << (model ? model->objectName().toStdString() : "(null)") << " in layer " // << layer->objectName().toStdString() << std::endl; - if (model == oldMainModel) { + if (model && (model == oldMainModel)) { // std::cerr << "... it uses the old main model, replacing" << std::endl; LayerFactory::getInstance()->setModel(layer, m_mainModel); continue; @@ -285,7 +285,7 @@ continue; } - if (m_models[model].source == oldMainModel) { + if (m_models[model].source && (m_models[model].source == oldMainModel)) { // std::cerr << "... it uses a model derived from the old main model, regenerating" << std::endl; @@ -334,7 +334,8 @@ } for (ModelMap::iterator i = m_models.begin(); i != m_models.end(); ++i) { - if (i->first->getAlignmentReference() == oldMainModel) { + if (oldMainModel && + (i->first->getAlignmentReference() == oldMainModel)) { alignModel(i->first); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |