Changeset View
Changeset View
Standalone View
Standalone View
smb/kio_smb_browse.cpp
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | 178 | default: | |||
---|---|---|---|---|---|
181 | return; | 181 | return; | ||
182 | } | 182 | } | ||
183 | 183 | | |||
184 | statEntry(udsentry); | 184 | statEntry(udsentry); | ||
185 | finished(); | 185 | finished(); | ||
186 | } | 186 | } | ||
187 | 187 | | |||
188 | //=========================================================================== | 188 | //=========================================================================== | ||
189 | // TODO: complete checking | 189 | // TODO: complete checking <-- what does that even mean? | ||
190 | QUrl SMBSlave::checkURL(const QUrl& kurl) const | 190 | // TODO: why is this not part of SMBUrl or at the very least URL validation should | ||
191 | { | 191 | // be 100% shared between this and SMBUrl. Notably SMBUrl has code that looks | ||
192 | qCDebug(KIO_SMB) << "checkURL " << kurl; | 192 | // to do a similar thing but is much less complete. | ||
193 | QUrl SMBSlave::checkURL(const QUrl &kurl_) const | ||||
194 | { | ||||
195 | qCDebug(KIO_SMB) << "checkURL " << kurl_; | ||||
196 | | ||||
197 | QUrl kurl(kurl_); | ||||
198 | // We treat cifs as an alias but need to translate it to smb. | ||||
199 | // https://bugs.kde.org/show_bug.cgi?id=327295 | ||||
200 | // It's not IANA registered and also libsmbc internally expects | ||||
201 | // smb URIs so we do very broadly coerce cifs to smb. | ||||
202 | // Also see SMBUrl. | ||||
203 | if (kurl.scheme() == "cifs") { | ||||
204 | kurl.setScheme("smb"); | ||||
205 | } | ||||
206 | | ||||
193 | QString surl = kurl.url(); | 207 | QString surl = kurl.url(); | ||
194 | //transform any links in the form smb:/ into smb:// | 208 | //transform any links in the form smb:/ into smb:// | ||
195 | if (surl.startsWith(QLatin1String("smb:/"))) { | 209 | if (surl.startsWith(QLatin1String("smb:/"))) { | ||
196 | if (surl.length() == 5) { | 210 | if (surl.length() == 5) { | ||
197 | return QUrl("smb://"); | 211 | return QUrl("smb://"); | ||
198 | } | 212 | } | ||
199 | if (surl.at(5) != '/') { | 213 | if (surl.at(5) != '/') { | ||
200 | surl = "smb://" + surl.mid(5); | 214 | surl = "smb://" + surl.mid(5); | ||
▲ Show 20 Lines • Show All 480 Lines • Show Last 20 Lines |