author | korovkin <korovkin> | 2006-04-25 20:17:22 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-04-25 20:17:22 (UTC) |
commit | c5e86199c46839e6952b8ec3dec1447e5f60a279 (patch) (side-by-side diff) | |
tree | 9cf9c5b247022ab1135c673456871f4604f9f369 /noncore/net/opietooth/manager/obexftpdialog.cpp | |
parent | 8856190fa34ad67488adc137dc7c8646d0689795 (diff) | |
download | opie-c5e86199c46839e6952b8ec3dec1447e5f60a279.zip opie-c5e86199c46839e6952b8ec3dec1447e5f60a279.tar.gz opie-c5e86199c46839e6952b8ec3dec1447e5f60a279.tar.bz2 |
Dedicated to Natalia Korovkina, my best friend and wife.
Added remove file functionality to OBEX FT dialog.
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, SLOT(putFile())); + connect(delButton, + SIGNAL(clicked()), + SLOT(delFile())); connect(destFile, @@ -244,3 +247,3 @@ void ObexFtpDialog::slotCd(QListViewItem* item) /* - * Get the file + * Copy file from a remote device to the local device */ @@ -277,3 +280,3 @@ void ObexFtpDialog::getFile() if (result < 0) { - log(file2get + QString(" receive ERROR: ") + tr(strerror(errno))); + log(file2get + QString(" receive ERROR:\n") + tr(strerror(errno))); errBox(file2get + QString(" receive ERROR")); @@ -290,3 +293,3 @@ void ObexFtpDialog::getFile() /* - * Put the file + * Copy file from the local device to a remote device */ @@ -327,3 +330,3 @@ void ObexFtpDialog::putFile() if (result < 0) { - log(local + QString(" send ERROR: ") + tr(strerror(errno))); + log(local + QString(" send ERROR:\n") + tr(strerror(errno))); errBox(local + QString(" send ERROR")); @@ -332,2 +335,3 @@ void ObexFtpDialog::putFile() else { + slotBrowse(); log(local + QString(" sent")); @@ -337,2 +341,40 @@ void ObexFtpDialog::putFile() +/* + * Delete file on a remote device + */ +void ObexFtpDialog::delFile() +{ + FileListItem* file = (FileListItem*)fileList->selectedItem(); + int result; + if (file == NULL) + return; + file2get = "/"; + if (file->gettype() == IS_FILE) { + if (client == NULL) { + errBox("No connection established"); + return; + } + file2get += curdir; + if (curdir != "" && curdir.right(1) != "/") + file2get += "/"; + file2get += file->text(0); + } + result = QMessageBox::warning(this, tr("Remove File"), + tr("Do you want to remove\n") + file2get, "Yes", "No"); + if (result != 0) + return; + odebug << "Remove " << file2get << oendl; + result = obexftp_del(client, file2get); + if (result < 0) { + log(file2get + QString(" remove ERROR\n") + tr(strerror(errno))); + errBox(file2get + QString(" remove ERROR")); + status(file2get + QString(" remove ERROR")); + } + else { + slotBrowse(); + log(file2get + QString(" removed")); + status(file2get + QString(" removed")); + } +} + /* connect with given uuid. re-connect every time */ |