Changeset View
Changeset View
Standalone View
Standalone View
kio/kiokdeconnect.cpp
Show All 21 Lines | |||||
22 | #include "kiokdeconnect.h" | 22 | #include "kiokdeconnect.h" | ||
23 | 23 | | |||
24 | #include <QThread> | 24 | #include <QThread> | ||
25 | #include <QDBusMetaType> | 25 | #include <QDBusMetaType> | ||
26 | 26 | | |||
27 | #include <KLocalizedString> | 27 | #include <KLocalizedString> | ||
28 | 28 | | |||
29 | #include <QDebug> | 29 | #include <QDebug> | ||
30 | #include <QtPlugin> | ||||
30 | 31 | | |||
31 | Q_LOGGING_CATEGORY(KDECONNECT_KIO, "kdeconnect.kio") | 32 | Q_LOGGING_CATEGORY(KDECONNECT_KIO, "kdeconnect.kio") | ||
32 | 33 | | |||
34 | class KIOPluginForMetaData : public QObject | ||||
35 | { | ||||
36 | Q_OBJECT | ||||
37 | Q_PLUGIN_METADATA(IID "org.kde.kio.slave.kdeconnect" FILE "kdeconnect.json") | ||||
38 | }; | ||||
39 | | ||||
33 | extern "C" int Q_DECL_EXPORT kdemain(int argc, char** argv) | 40 | extern "C" int Q_DECL_EXPORT kdemain(int argc, char** argv) | ||
34 | { | 41 | { | ||
42 | QCoreApplication app(argc, argv); | ||||
43 | app.setApplicationName(QStringLiteral("kio_kdeconnect")); | ||||
44 | | ||||
35 | if (argc != 4) { | 45 | if (argc != 4) { | ||
36 | fprintf(stderr, "Usage: kio_kdeconnect protocol pool app\n"); | 46 | fprintf(stderr, "Usage: kio_kdeconnect protocol pool app\n"); | ||
37 | exit(-1); | 47 | exit(-1); | ||
38 | } | 48 | } | ||
39 | 49 | | |||
40 | KioKdeconnect slave(argv[2], argv[3]); | 50 | KioKdeconnect slave(argv[2], argv[3]); | ||
41 | slave.dispatchLoop(); | 51 | slave.dispatchLoop(); | ||
42 | return 0; | 52 | return 0; | ||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 132 | { | |||
147 | 157 | | |||
148 | for (QVariantMap::iterator it = urls.begin(); it != urls.end(); ++it) { | 158 | for (QVariantMap::iterator it = urls.begin(); it != urls.end(); ++it) { | ||
149 | 159 | | |||
150 | const QString path = it.key(); | 160 | const QString path = it.key(); | ||
151 | const QString name = it.value().toString(); | 161 | const QString name = it.value().toString(); | ||
152 | const QString icon = QStringLiteral("folder"); | 162 | const QString icon = QStringLiteral("folder"); | ||
153 | 163 | | |||
154 | KIO::UDSEntry entry; | 164 | KIO::UDSEntry entry; | ||
155 | entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral("files")); | 165 | entry.insert(KIO::UDSEntry::UDS_NAME, QStringLiteral("files")); | ||
albertvaka: Also don't change insert to fastInsert, as it requires KIO 5.48 and we want to support older… | |||||
156 | entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, name); | 166 | entry.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, name); | ||
157 | entry.insert(KIO::UDSEntry::UDS_ICON_NAME, icon); | 167 | entry.insert(KIO::UDSEntry::UDS_ICON_NAME, icon); | ||
158 | entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); | 168 | entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); | ||
159 | entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); | 169 | entry.insert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); | ||
160 | entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String("")); | 170 | entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String("")); | ||
161 | entry.insert(KIO::UDSEntry::UDS_URL, QUrl::fromLocalFile(path).toString()); | 171 | entry.insert(KIO::UDSEntry::UDS_URL, QUrl::fromLocalFile(path).toString()); | ||
162 | listEntry(entry); | 172 | listEntry(entry); | ||
163 | } | 173 | } | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 230 | { | |||
227 | Q_UNUSED(port) | 237 | Q_UNUSED(port) | ||
228 | Q_UNUSED(user) | 238 | Q_UNUSED(user) | ||
229 | Q_UNUSED(pass) | 239 | Q_UNUSED(pass) | ||
230 | 240 | | |||
231 | m_currentDevice = hostName; | 241 | m_currentDevice = hostName; | ||
232 | 242 | | |||
233 | } | 243 | } | ||
234 | 244 | | |||
245 | //needed for JSON file embedding | ||||
246 | #include "kiokdeconnect.moc" |
Also don't change insert to fastInsert, as it requires KIO 5.48 and we want to support older than that.