Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/knewfilemenu.cpp
Show All 32 Lines | |||||
33 | #include <QStandardPaths> | 33 | #include <QStandardPaths> | ||
34 | 34 | | |||
35 | #include <qtemporaryfile.h> | 35 | #include <qtemporaryfile.h> | ||
36 | #include <kactioncollection.h> | 36 | #include <kactioncollection.h> | ||
37 | #include <kconfiggroup.h> | 37 | #include <kconfiggroup.h> | ||
38 | #include <QDebug> | 38 | #include <QDebug> | ||
39 | #include <kdesktopfile.h> | 39 | #include <kdesktopfile.h> | ||
40 | #include <kdirwatch.h> | 40 | #include <kdirwatch.h> | ||
41 | #include <kdirnotify.h> | ||||
41 | #include <kjobwidgets.h> | 42 | #include <kjobwidgets.h> | ||
42 | #include <klocalizedstring.h> | 43 | #include <klocalizedstring.h> | ||
43 | #include <kmessagebox.h> | 44 | #include <kmessagebox.h> | ||
44 | #include <kprotocolinfo.h> | 45 | #include <kprotocolinfo.h> | ||
45 | #include <kprotocolmanager.h> | 46 | #include <kprotocolmanager.h> | ||
46 | #include <krun.h> | 47 | #include <krun.h> | ||
47 | #include <kshell.h> | 48 | #include <kshell.h> | ||
48 | #include <kio/job.h> | 49 | #include <kio/job.h> | ||
▲ Show 20 Lines • Show All 1188 Lines • ▼ Show 20 Line(s) | 1236 | if (copyJob) { | |||
1237 | const QUrl localUrl = d->mostLocalUrl(destUrl); | 1238 | const QUrl localUrl = d->mostLocalUrl(destUrl); | ||
1238 | if (localUrl.isLocalFile()) { | 1239 | if (localUrl.isLocalFile()) { | ||
1239 | // Normal (local) file. Need to "touch" it, kio_file copied the mtime. | 1240 | // Normal (local) file. Need to "touch" it, kio_file copied the mtime. | ||
1240 | (void) ::utime(QFile::encodeName(localUrl.toLocalFile()).constData(), nullptr); | 1241 | (void) ::utime(QFile::encodeName(localUrl.toLocalFile()).constData(), nullptr); | ||
1241 | } | 1242 | } | ||
1242 | emit fileCreated(destUrl); | 1243 | emit fileCreated(destUrl); | ||
1243 | } else if (KIO::SimpleJob *simpleJob = ::qobject_cast<KIO::SimpleJob *>(job)) { | 1244 | } else if (KIO::SimpleJob *simpleJob = ::qobject_cast<KIO::SimpleJob *>(job)) { | ||
1244 | // Called in the storedPut() case | 1245 | // Called in the storedPut() case | ||
1246 | org::kde::KDirNotify::emitFilesAdded(simpleJob->url().adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash)); | ||||
1245 | emit fileCreated(simpleJob->url()); | 1247 | emit fileCreated(simpleJob->url()); | ||
1246 | } else { | 1248 | } else { | ||
1247 | // Can be mkdir | 1249 | // Can be mkdir | ||
1248 | QUrl mkpathUrl = job->property("mkpathUrl").toUrl(); | 1250 | QUrl mkpathUrl = job->property("mkpathUrl").toUrl(); | ||
1249 | if (mkpathUrl.isValid()) { | 1251 | if (mkpathUrl.isValid()) { | ||
1250 | emit directoryCreated(mkpathUrl); | 1252 | emit directoryCreated(mkpathUrl); | ||
1251 | } else { | 1253 | } else { | ||
1252 | qWarning() << "Neither copy, put nor mkdir, internal error"; | 1254 | qWarning() << "Neither copy, put nor mkdir, internal error"; | ||
Show All 15 Lines |