Changeset View
Changeset View
Standalone View
Standalone View
plugins/share/shareplugin.cpp
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Line(s) | 151 | if(url.isLocalFile()) { | |||
---|---|---|---|---|---|
153 | package.setPayload(ioFile, ioFile->size()); | 153 | package.setPayload(ioFile, ioFile->size()); | ||
154 | package.set<QString>(QStringLiteral("filename"), QUrl(url).fileName()); | 154 | package.set<QString>(QStringLiteral("filename"), QUrl(url).fileName()); | ||
155 | } else { | 155 | } else { | ||
156 | package.set<QString>(QStringLiteral("url"), url.toString()); | 156 | package.set<QString>(QStringLiteral("url"), url.toString()); | ||
157 | } | 157 | } | ||
158 | sendPackage(package); | 158 | sendPackage(package); | ||
159 | } | 159 | } | ||
160 | 160 | | |||
161 | void SharePlugin::connected() | | |||
162 | { | | |||
163 | QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableInvokables); | | |||
164 | } | | |||
165 | | ||||
166 | QString SharePlugin::dbusPath() const | 161 | QString SharePlugin::dbusPath() const | ||
167 | { | 162 | { | ||
168 | return "/modules/kdeconnect/devices/" + device()->id() + "/share"; | 163 | return "/modules/kdeconnect/devices/" + device()->id() + "/share"; | ||
169 | } | 164 | } | ||
170 | 165 | | |||
171 | #include "shareplugin.moc" | 166 | #include "shareplugin.moc" |