| 57 | #endif |
| 58 | |
| 59 | NATRON_NAMESPACE_ENTER |
| 60 | |
| 61 | static QStringList |
| 62 | getSplitPath(const QString& path) |
| 63 | { |
| 64 | if ( path.isEmpty() ) { |
| 65 | return QStringList(); |
| 66 | } |
| 67 | QString pathCpy = path; |
| 68 | bool isdriveOrRoot; |
| 69 | #ifdef __NATRON_WIN32__ |
| 70 | QString startPath = pathCpy.mid(0, 3); |
| 71 | isdriveOrRoot = FileSystemModel::isDriveName(startPath); |
| 72 | if (isdriveOrRoot) { |
| 73 | pathCpy = pathCpy.remove(0, 3); |
| 74 | } |
| 75 | if ( (pathCpy.size() > 0) && ( pathCpy[pathCpy.size() - 1] == QChar::fromLatin1('/') ) ) { |
| 76 | pathCpy = pathCpy.mid(0, pathCpy.size() - 1); |
| 77 | } |
| 78 | QStringList splitPath = pathCpy.split( QChar::fromLatin1('/') ); |
| 79 | if (isdriveOrRoot) { |
| 80 | splitPath.prepend( startPath.mid(0, 3) ); |
| 81 | } |
| 82 | |
| 83 | #else |
| 84 | isdriveOrRoot = pathCpy.startsWith( QChar::fromLatin1('/') ); |
| 85 | if (isdriveOrRoot) { |
| 86 | pathCpy = pathCpy.remove(0, 1); |
| 87 | } |
| 88 | if ( (pathCpy.size() > 0) && ( pathCpy[pathCpy.size() - 1] == QChar::fromLatin1('/') ) ) { |
| 89 | pathCpy = pathCpy.mid(0, pathCpy.size() - 1); |
| 90 | } |
| 91 | QStringList splitPath = pathCpy.split( QChar::fromLatin1('/') ); |
| 92 | if (isdriveOrRoot) { |
| 93 | splitPath.prepend( QChar::fromLatin1('/') ); |
| 94 | } |
| 95 | |
| 96 | #endif |
| 97 | |
| 98 | return splitPath; |
| 99 | } |
| 100 | |
| 101 | struct FileSystemModelPrivate |
| 102 | { |
nothing calls this directly
no test coverage detected