Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/fstab/fstabdevice.cpp
Show All 36 Lines | 35 | { | |||
---|---|---|---|---|---|
37 | m_device.remove(parentUdi() + "/"); | 37 | m_device.remove(parentUdi() + "/"); | ||
38 | 38 | | |||
39 | if (m_device.startsWith("//")) { | 39 | if (m_device.startsWith("//")) { | ||
40 | m_vendor = m_device.mid(2, m_device.indexOf("/", 2) - 2); | 40 | m_vendor = m_device.mid(2, m_device.indexOf("/", 2) - 2); | ||
41 | m_product = m_device.mid(m_device.indexOf("/", 2) + 1); | 41 | m_product = m_device.mid(m_device.indexOf("/", 2) + 1); | ||
42 | } else { | 42 | } else { | ||
43 | m_vendor = m_device.left(m_device.indexOf(":/")); | 43 | m_vendor = m_device.left(m_device.indexOf(":/")); | ||
44 | m_product = m_device.mid(m_device.indexOf(":/") + 2); | 44 | m_product = m_device.mid(m_device.indexOf(":/") + 2); | ||
45 | if (m_product.isEmpty()) { | ||||
broulik: This should probably be moved outside this if, you get the same bug when you do ``//server/` | |||||
SMB/Cifs share names can never be empty, i.e. you always have //server/<nonempty-string> bruns: SMB/Cifs share names can never be empty, i.e. you always have `//server/<nonempty-string>` | |||||
46 | m_product = QStringLiteral("/"); | ||||
47 | } | ||||
45 | } | 48 | } | ||
46 | 49 | | |||
47 | const QStringList& gvfsOptions = FstabHandling::options(m_device); | 50 | const QStringList& gvfsOptions = FstabHandling::options(m_device); | ||
48 | 51 | | |||
49 | foreach (const QString& option, gvfsOptions) { | 52 | foreach (const QString& option, gvfsOptions) { | ||
50 | if (option.startsWith(QLatin1String("x-gvfs-name="))) { | 53 | if (option.startsWith(QLatin1String("x-gvfs-name="))) { | ||
51 | QStringRef encoded = option.midRef(12); | 54 | QStringRef encoded = option.midRef(12); | ||
52 | m_description = QUrl::fromPercentEncoding(encoded.toLatin1()); | 55 | m_description = QUrl::fromPercentEncoding(encoded.toLatin1()); | ||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |
This should probably be moved outside this if, you get the same bug when you do `//server/