Changeset View
Changeset View
Standalone View
Standalone View
kio/kiokdeconnect.cpp
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | |||||
84 | 84 | | |||
85 | KioKdeconnect::KioKdeconnect(const QByteArray& pool, const QByteArray& app) | 85 | KioKdeconnect::KioKdeconnect(const QByteArray& pool, const QByteArray& app) | ||
86 | : SlaveBase("kdeconnect", pool, app), | 86 | : SlaveBase("kdeconnect", pool, app), | ||
87 | m_dbusInterface(new DaemonDbusInterface(this)) | 87 | m_dbusInterface(new DaemonDbusInterface(this)) | ||
88 | { | 88 | { | ||
89 | 89 | | |||
90 | } | 90 | } | ||
91 | 91 | | |||
92 | void KioKdeconnect::listAllDevices() | 92 | void KioKdeconnect::listAllDevices() | ||
albertvaka: It can still be accessed through `kdeconnect://` without a device id following. | |||||
93 | { | 93 | { | ||
94 | infoMessage(i18n("Listing devices...")); | 94 | infoMessage(i18n("Listing devices...")); | ||
95 | 95 | | |||
96 | //TODO: Change to all devices and show different icons for connected and disconnected? | 96 | //TODO: Change to all devices and show different icons for connected and disconnected? | ||
97 | const QStringList devices = m_dbusInterface->devices(true, true); | 97 | const QStringList devices = m_dbusInterface->devices(true, true); | ||
98 | 98 | | |||
99 | for (const QString& deviceId : devices) { | 99 | for (const QString& deviceId : devices) { | ||
100 | 100 | | |||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 132 | { | |||
157 | 157 | | |||
158 | for (QVariantMap::iterator it = urls.begin(); it != urls.end(); ++it) { | 158 | for (QVariantMap::iterator it = urls.begin(); it != urls.end(); ++it) { | ||
159 | 159 | | |||
160 | const QString path = it.key(); | 160 | const QString path = it.key(); | ||
161 | const QString name = it.value().toString(); | 161 | const QString name = it.value().toString(); | ||
162 | const QString icon = QStringLiteral("folder"); | 162 | const QString icon = QStringLiteral("folder"); | ||
163 | 163 | | |||
164 | KIO::UDSEntry entry; | 164 | KIO::UDSEntry entry; | ||
165 | entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral("files")); | 165 | entry.insert(KIO::UDSEntry::UDS_NAME, name); | ||
166 | entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, name); | | |||
167 | entry.insert(KIO::UDSEntry::UDS_ICON_NAME, icon); | 166 | entry.insert(KIO::UDSEntry::UDS_ICON_NAME, icon); | ||
168 | entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); | 167 | entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); | ||
169 | entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); | 168 | entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); | ||
170 | entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String("")); | 169 | entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String("")); | ||
171 | entry.insert(KIO::UDSEntry::UDS_URL, QUrl::fromLocalFile(path).toString()); | 170 | entry.insert(KIO::UDSEntry::UDS_URL, QUrl::fromLocalFile(path).toString()); | ||
172 | listEntry(entry); | 171 | listEntry(entry); | ||
173 | } | 172 | } | ||
174 | 173 | | |||
175 | // We also need a non-null and writable UDSentry for "." | 174 | // We also need a non-null and writable UDSentry for "." | ||
176 | KIO::UDSEntry entry; | 175 | KIO::UDSEntry entry; | ||
177 | entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral(".")); | 176 | entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral(".")); | ||
178 | entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); | 177 | entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); | ||
179 | entry.insert(KIO::UDSEntry::UDS_SIZE, 0); | 178 | entry.insert(KIO::UDSEntry::UDS_SIZE, 0); | ||
180 | entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH); | 179 | entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH); | ||
180 | | ||||
181 | listEntry(entry); | 181 | listEntry(entry); | ||
182 | 182 | | |||
183 | infoMessage(QLatin1String("")); | 183 | infoMessage(QLatin1String("")); | ||
184 | finished(); | 184 | finished(); | ||
185 | 185 | | |||
186 | } | 186 | } | ||
187 | 187 | | |||
188 | 188 | | |||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |
It can still be accessed through kdeconnect:// without a device id following.