Changeset View
Changeset View
Standalone View
Standalone View
plugins/sftp/sftpplugin.cpp
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | |||||
120 | { | 120 | { | ||
121 | if (mountAndWait()) { | 121 | if (mountAndWait()) { | ||
122 | //return new KRun(QUrl::fromLocalFile(mountPoint()), 0); | 122 | //return new KRun(QUrl::fromLocalFile(mountPoint()), 0); | ||
123 | return new KRun(QUrl("kdeconnect://"+deviceId), nullptr); | 123 | return new KRun(QUrl("kdeconnect://"+deviceId), nullptr); | ||
124 | } | 124 | } | ||
125 | return false; | 125 | return false; | ||
126 | } | 126 | } | ||
127 | 127 | | |||
128 | bool SftpPlugin::receivePackage(const NetworkPackage& np) | 128 | bool SftpPlugin::receivePacket(const NetworkPacket& np) | ||
129 | { | 129 | { | ||
130 | if (!(fields_c - np.body().keys().toSet()).isEmpty()) { | 130 | if (!(fields_c - np.body().keys().toSet()).isEmpty()) { | ||
131 | // package is invalid | 131 | // packet is invalid | ||
132 | return false; | 132 | return false; | ||
133 | } | 133 | } | ||
134 | 134 | | |||
135 | Q_EMIT packageReceived(np); | 135 | Q_EMIT packetReceived(np); | ||
136 | 136 | | |||
137 | remoteDirectories.clear(); | 137 | remoteDirectories.clear(); | ||
138 | if (np.has(QStringLiteral("multiPaths"))) { | 138 | if (np.has(QStringLiteral("multiPaths"))) { | ||
139 | QStringList paths = np.get<QStringList>(QStringLiteral("multiPaths"),QStringList()); | 139 | QStringList paths = np.get<QStringList>(QStringLiteral("multiPaths"),QStringList()); | ||
140 | QStringList names = np.get<QStringList>(QStringLiteral("pathNames"),QStringList()); | 140 | QStringList names = np.get<QStringList>(QStringLiteral("pathNames"),QStringList()); | ||
141 | int size = qMin<int>(names.size(), paths.size()); | 141 | int size = qMin<int>(names.size(), paths.size()); | ||
142 | for (int i = 0; i < size; i++) { | 142 | for (int i = 0; i < size; i++) { | ||
143 | remoteDirectories.insert(mountPoint() + paths.at(i), names.at(i)); | 143 | remoteDirectories.insert(mountPoint() + paths.at(i), names.at(i)); | ||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |