Changeset View
Changeset View
Standalone View
Standalone View
src/kioexec/main.cpp
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | 143 | if (job->error()) { | |||
---|---|---|---|---|---|
155 | } | 155 | } | ||
156 | } | 156 | } | ||
157 | else | 157 | else | ||
158 | { | 158 | { | ||
159 | // Tell kioexecd to watch the file for changes. | 159 | // Tell kioexecd to watch the file for changes. | ||
160 | const QString dest = copyJob->srcUrl().toString(); | 160 | const QString dest = copyJob->srcUrl().toString(); | ||
161 | qDebug() << "Telling kioexecd to watch path" << path << "dest" << dest; | 161 | qDebug() << "Telling kioexecd to watch path" << path << "dest" << dest; | ||
162 | OrgKdeKIOExecdInterface kioexecd(QStringLiteral("org.kde.kioexecd"), QStringLiteral("/modules/kioexecd"), QDBusConnection::sessionBus()); | 162 | OrgKdeKIOExecdInterface kioexecd(QStringLiteral("org.kde.kioexecd"), QStringLiteral("/modules/kioexecd"), QDBusConnection::sessionBus()); | ||
163 | kioexecd.watch(path, dest); | 163 | kioexecd.watchCommand(path, dest, command.left(command.indexOf(QLatin1Char(' ')))); | ||
164 | mUseDaemon = !kioexecd.lastError().isValid(); | 164 | mUseDaemon = !kioexecd.lastError().isValid(); | ||
165 | if (!mUseDaemon) { | 165 | if (!mUseDaemon) { | ||
166 | qDebug() << "Not using kioexecd"; | 166 | qDebug() << "Not using kioexecd"; | ||
167 | } | 167 | } | ||
168 | } | 168 | } | ||
169 | } | 169 | } | ||
170 | 170 | | |||
171 | counter++; | 171 | counter++; | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 229 | for (it = fileList.begin(); it != fileList.end(); ++it) { | |||
253 | } | 253 | } | ||
254 | 254 | | |||
255 | if ((uploadChanges || mTempFiles) && exit_code == 0) { // Wait for a reasonable time so that even if the application forks on startup (like OOo or amarok) | 255 | if ((uploadChanges || mTempFiles) && exit_code == 0) { // Wait for a reasonable time so that even if the application forks on startup (like OOo or amarok) | ||
256 | // it will have time to start up and read the file before it gets deleted. #130709. | 256 | // it will have time to start up and read the file before it gets deleted. #130709. | ||
257 | qDebug() << "sleeping..."; | 257 | qDebug() << "sleeping..."; | ||
258 | QThread::currentThread()->sleep(180); // 3 mn | 258 | QThread::currentThread()->sleep(180); // 3 mn | ||
259 | const QString parentDir = info.path(); | 259 | const QString parentDir = info.path(); | ||
260 | qDebug() << "about to delete" << parentDir << "containing" << info.fileName(); | 260 | qDebug() << "about to delete" << parentDir << "containing" << info.fileName(); | ||
261 | QFile(QFile::encodeName(src)).remove(); | 261 | QDir(parentDir).removeRecursively(); | ||
anthonyfieroni: Indentation | |||||
262 | QDir().rmdir(parentDir); | | |||
263 | } | 262 | } | ||
263 | if (mUseDaemon && exit_code == 0) { | ||||
anthonyfieroni: Extra space after && | |||||
264 | OrgKdeKIOExecdInterface kioexecd(QStringLiteral("org.kde.kioexecd"), QStringLiteral("/modules/kioexecd"), QDBusConnection::sessionBus()); | ||||
265 | kioexecd.removeWatchAndDirectory(src, command.left(command.indexOf(QLatin1Char(' ')))); | ||||
266 | } | ||||
267 | | ||||
264 | } | 268 | } | ||
265 | 269 | | |||
266 | mExited = true; | 270 | mExited = true; | ||
267 | QApplication::exit(exit_code); | 271 | QApplication::exit(exit_code); | ||
268 | } | 272 | } | ||
269 | 273 | | |||
270 | int main(int argc, char **argv) | 274 | int main(int argc, char **argv) | ||
271 | { | 275 | { | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
Indentation