Changeset View
Changeset View
Standalone View
Standalone View
smb/smburl.cpp
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 58 | { | |||
---|---|---|---|---|---|
59 | if (path().length() > 0 && path().at(path().length() - 1) != QLatin1Char('/')) { | 59 | if (path().length() > 0 && path().at(path().length() - 1) != QLatin1Char('/')) { | ||
60 | QUrl::setPath(path() + QLatin1Char('/') + filedir); | 60 | QUrl::setPath(path() + QLatin1Char('/') + filedir); | ||
61 | } else { | 61 | } else { | ||
62 | QUrl::setPath(path() + filedir); | 62 | QUrl::setPath(path() + filedir); | ||
63 | } | 63 | } | ||
64 | updateCache(); | 64 | updateCache(); | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | bool SMBUrl::cd(const QString &filedir) | 67 | void SMBUrl::cdUp() | ||
apol: Can't we then just rename the method to `::cdUp()`? | |||||
apol: it can return void too, nobody is checking it anyway. | |||||
68 | { | 68 | { | ||
69 | if (filedir == "..") { | | |||
70 | setUrl(KIO::upUrl(*this).url()); | 69 | setUrl(KIO::upUrl(*this).url()); | ||
71 | } else { | | |||
72 | setUrl(filedir); | | |||
73 | } | | |||
74 | updateCache(); | 70 | updateCache(); | ||
75 | return true; | | |||
76 | } | 71 | } | ||
77 | 72 | | |||
78 | void SMBUrl::updateCache() | 73 | void SMBUrl::updateCache() | ||
79 | { | 74 | { | ||
80 | QUrl::setPath(QDir::cleanPath(path())); | 75 | QUrl::setPath(QDir::cleanPath(path())); | ||
81 | 76 | | |||
82 | // SMB URLs are UTF-8 encoded | 77 | // SMB URLs are UTF-8 encoded | ||
83 | qCDebug(KIO_SMB_LOG) << "updateCache " << QUrl::path(); | 78 | qCDebug(KIO_SMB_LOG) << "updateCache " << QUrl::path(); | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Can't we then just rename the method to ::cdUp()?