Changeset View
Changeset View
Standalone View
Standalone View
src/fileaccess.cpp
Context not available. | |||||
116 | 116 | | |||
---|---|---|---|---|---|
117 | if(m_url.isLocalFile() || !m_url.isValid() ) // Treat invalid urls as local files. | 117 | if(m_url.isLocalFile() || !m_url.isValid() ) // Treat invalid urls as local files. | ||
118 | { | 118 | { | ||
119 | #if defined(Q_OS_WIN) | ||||
120 | // Workaround: The filePath in the QUrl can become of the from "/C:/some/path/file.ext" | ||||
121 | // when it goes through QUrl::fromUserInput("C:/some/path/file.ext"); | ||||
122 | QString ufp = m_url.path(); | ||||
123 | QString ufpAbs = ufp; | ||||
124 | if (ufp.length() >= 4 && ufp.at(0) == QLatin1Char('/') && | ||||
125 | ufp.at(1).isLetter() && ufp.at(2) == QLatin1Char(':') && ufp.at(3) == QLatin1Char('/')) | ||||
126 | { | ||||
127 | ufpAbs = ufp.mid(1); // Drop the first '/' | ||||
128 | } | ||||
129 | | ||||
130 | m_fileInfo = QFileInfo(ufpAbs); | ||||
131 | #else | ||||
119 | m_fileInfo = QFileInfo(m_url.path()); | 132 | m_fileInfo = QFileInfo(m_url.path()); | ||
133 | #endif | ||||
120 | m_pParent = nullptr; | 134 | m_pParent = nullptr; | ||
121 | 135 | | |||
122 | loadData(); | 136 | loadData(); | ||
Context not available. |