summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/obexftpdialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/manager/obexftpdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/obexftpdialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/opietooth/manager/obexftpdialog.cpp b/noncore/net/opietooth/manager/obexftpdialog.cpp
index efb3ff2..2a578ac 100644
--- a/noncore/net/opietooth/manager/obexftpdialog.cpp
+++ b/noncore/net/opietooth/manager/obexftpdialog.cpp
@@ -198,97 +198,97 @@ int ObexFtpDialog::errBox(const char* msg)
return QMessageBox::critical(this, tr("ObexFTP error"), tr(msg));
}
//Text in the status bar
void ObexFtpDialog::status(QCString msg)
{
statusBar->setText(msg);
statusBar->repaint();
}
void ObexFtpDialog::status(QString msg)
{
statusBar->setText(msg);
statusBar->repaint();
}
void ObexFtpDialog::status(const char* msg)
{
statusBar->setText(msg);
statusBar->repaint();
}
/*
* Change directory with item under the cursor
*/
void ObexFtpDialog::slotCd(QListViewItem* item)
{
FileListItem* file = (FileListItem*)item;
int idx;
if (file == NULL)
return;
odebug << "Item " << file->text(0) << " clicked" << oendl;
if (file->gettype() == IS_DIR) {
if (file->text(0) == "../") {
if (curdir.right(1) == "/")
curdir.remove(curdir.length() - 1, 1);
idx = curdir.findRev('/');
if (idx >= 0)
curdir.remove(idx, curdir.length() - idx);
else
curdir = "";
}
else {
if (curdir != "" && curdir.right(1) != "/")
curdir += "/";
curdir += file->text(0);
}
odebug << "Browse " << curdir << oendl;
- if (obexftp_setpath(client, curdir, 0) < 0)
+ if (obexftp_setpath(client, QFile::encodeName(curdir), 0) < 0)
log(tr("CD failed: ") + tr(strerror(errno)));
doBrowse();
}
}
/*
* Copy file from a remote device to the local device
*/
void ObexFtpDialog::getFile()
{
FileListItem* file = (FileListItem*)fileList->selectedItem();
int result;
if (file == NULL)
return;
file2get = "/";
local = localCurdir;
if (local == "") {
errBox("Select a destination first");
return;
}
if (local.right(1) != "/")
local += "/";
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);
local += file->text(0);
odebug << "Copy " << file2get << " to " << local << oendl;
progressStatus = 0;
fileProgress->setTotalSteps(file->getsize() / 1024);
fileProgress->reset();
status(tr("Receiving file ") + file2get);
result = obexftp_get(client, local, file2get);
if (result < 0) {
log(file2get + QString(" receive ERROR:\n") + tr(strerror(errno)));
errBox(file2get + QString(" receive ERROR"));
status(file2get + QString(" receive ERROR"));
}
else {
log(file2get + QString(" received"));
status(file2get + QString(" received"));
destFile->reread();
}