189 | 189 |
fileInfo.lastModified().toTime_t(),
|
190 | 190 |
channel->lastModificationTime().toTime_t());
|
191 | 191 |
|
192 | |
q->connect(q, SIGNAL(cancelled()),
|
|
192 |
q->connect(q, SIGNAL(finished(KJob*)),
|
193 | 193 |
renameDialog.data(), SLOT(reject()));
|
194 | 194 |
|
195 | 195 |
q->connect(renameDialog.data(),
|
|
225 | 225 |
url = renameDialog.data()->newDestUrl();
|
226 | 226 |
break;
|
227 | 227 |
case KIO::R_OVERWRITE:
|
|
228 |
{
|
|
229 |
// Delete the old file if exists
|
|
230 |
QFile oldFile(url.toLocalFile(), 0);
|
|
231 |
if (oldFile.exists()) {
|
|
232 |
oldFile.remove();
|
|
233 |
}
|
|
234 |
}
|
228 | 235 |
break;
|
229 | 236 |
default:
|
230 | 237 |
kWarning() << "Unknown Error";
|
|
258 | 265 |
fileInfo.lastModified().toTime_t(),
|
259 | 266 |
channel->lastModificationTime().toTime_t());
|
260 | 267 |
|
261 | |
q->connect(q, SIGNAL(cancelled()),
|
|
268 |
q->connect(q, SIGNAL(finished(KJob*)),
|
262 | 269 |
renameDialog.data(), SLOT(reject()));
|
263 | 270 |
|
264 | 271 |
q->connect(renameDialog.data(),
|
|
429 | 436 |
q->setError(KTp::FileTransferCancelled);
|
430 | 437 |
q->setErrorText(i18n("Incoming file transfer was canceled."));
|
431 | 438 |
// Close .part file if open
|
432 | |
if (file->isOpen()) {
|
|
439 |
if (file && file->isOpen()) {
|
433 | 440 |
file->close();
|
434 | |
}
|
435 | |
// Delete the old file if exists
|
436 | |
QFile oldFile(url.toLocalFile(), 0);
|
437 | |
if (oldFile.exists()) {
|
438 | |
oldFile.remove();
|
439 | 441 |
}
|
440 | 442 |
q->kill(KJob::Quietly);
|
441 | 443 |
break;
|