Diffstat (limited to 'noncore/net/opietooth/manager/obexftpdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/obexftpdialog.cpp | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/noncore/net/opietooth/manager/obexftpdialog.cpp b/noncore/net/opietooth/manager/obexftpdialog.cpp index f479ca2..fd2015e 100644 --- a/noncore/net/opietooth/manager/obexftpdialog.cpp +++ b/noncore/net/opietooth/manager/obexftpdialog.cpp | |||
@@ -92,2 +92,5 @@ ObexFtpDialog::ObexFtpDialog(const QString& device, int port, | |||
92 | SLOT(putFile())); | 92 | SLOT(putFile())); |
93 | connect(delButton, | ||
94 | SIGNAL(clicked()), | ||
95 | SLOT(delFile())); | ||
93 | connect(destFile, | 96 | connect(destFile, |
@@ -244,3 +247,3 @@ void ObexFtpDialog::slotCd(QListViewItem* item) | |||
244 | /* | 247 | /* |
245 | * Get the file | 248 | * Copy file from a remote device to the local device |
246 | */ | 249 | */ |
@@ -277,3 +280,3 @@ void ObexFtpDialog::getFile() | |||
277 | if (result < 0) { | 280 | if (result < 0) { |
278 | log(file2get + QString(" receive ERROR: ") + tr(strerror(errno))); | 281 | log(file2get + QString(" receive ERROR:\n") + tr(strerror(errno))); |
279 | errBox(file2get + QString(" receive ERROR")); | 282 | errBox(file2get + QString(" receive ERROR")); |
@@ -290,3 +293,3 @@ void ObexFtpDialog::getFile() | |||
290 | /* | 293 | /* |
291 | * Put the file | 294 | * Copy file from the local device to a remote device |
292 | */ | 295 | */ |
@@ -327,3 +330,3 @@ void ObexFtpDialog::putFile() | |||
327 | if (result < 0) { | 330 | if (result < 0) { |
328 | log(local + QString(" send ERROR: ") + tr(strerror(errno))); | 331 | log(local + QString(" send ERROR:\n") + tr(strerror(errno))); |
329 | errBox(local + QString(" send ERROR")); | 332 | errBox(local + QString(" send ERROR")); |
@@ -332,2 +335,3 @@ void ObexFtpDialog::putFile() | |||
332 | else { | 335 | else { |
336 | slotBrowse(); | ||
333 | log(local + QString(" sent")); | 337 | log(local + QString(" sent")); |
@@ -337,2 +341,40 @@ void ObexFtpDialog::putFile() | |||
337 | 341 | ||
342 | /* | ||
343 | * Delete file on a remote device | ||
344 | */ | ||
345 | void ObexFtpDialog::delFile() | ||
346 | { | ||
347 | FileListItem* file = (FileListItem*)fileList->selectedItem(); | ||
348 | int result; | ||
349 | if (file == NULL) | ||
350 | return; | ||
351 | file2get = "/"; | ||
352 | if (file->gettype() == IS_FILE) { | ||
353 | if (client == NULL) { | ||
354 | errBox("No connection established"); | ||
355 | return; | ||
356 | } | ||
357 | file2get += curdir; | ||
358 | if (curdir != "" && curdir.right(1) != "/") | ||
359 | file2get += "/"; | ||
360 | file2get += file->text(0); | ||
361 | } | ||
362 | result = QMessageBox::warning(this, tr("Remove File"), | ||
363 | tr("Do you want to remove\n") + file2get, "Yes", "No"); | ||
364 | if (result != 0) | ||
365 | return; | ||
366 | odebug << "Remove " << file2get << oendl; | ||
367 | result = obexftp_del(client, file2get); | ||
368 | if (result < 0) { | ||
369 | log(file2get + QString(" remove ERROR\n") + tr(strerror(errno))); | ||
370 | errBox(file2get + QString(" remove ERROR")); | ||
371 | status(file2get + QString(" remove ERROR")); | ||
372 | } | ||
373 | else { | ||
374 | slotBrowse(); | ||
375 | log(file2get + QString(" removed")); | ||
376 | status(file2get + QString(" removed")); | ||
377 | } | ||
378 | } | ||
379 | |||
338 | /* connect with given uuid. re-connect every time */ | 380 | /* connect with given uuid. re-connect every time */ |