aboutsummaryrefslogtreecommitdiff
path: root/src/forms/downloaddialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/forms/downloaddialog.cpp')
-rw-r--r--src/forms/downloaddialog.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/forms/downloaddialog.cpp b/src/forms/downloaddialog.cpp
index 7d26c4b..950fa96 100644
--- a/src/forms/downloaddialog.cpp
+++ b/src/forms/downloaddialog.cpp
@@ -34,6 +34,7 @@ DownloadDialog::DownloadDialog(QWidget *parent) :
ui(new Ui::DownloadDialog)
{
ui->setupUi(this);
+ ui->filePath->setWordWrap(true);
connect(ui->listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(showItemDetails(int)));
}
@@ -47,10 +48,7 @@ void DownloadDialog::addDownload(QWebEngineDownloadItem *item)
{
Settings settings;
- qDebug("download item: %s", qUtf8Printable(item->url().toString()));
- qDebug("download path: %s", qUtf8Printable(settings.value("downloads/path").toString()));
-
- QString filepath = QFileDialog::getSaveFileName(this, tr("Save"), settings.value("downloads/path").toString());
+ QString filepath = QFileDialog::getSaveFileName(this, tr("Save"), settings.value("downloads/path").toString() + "/" + QFileInfo(item->path()).fileName());
if(filepath.isEmpty()) {
// user cancelled the save dialog
@@ -76,5 +74,6 @@ void DownloadDialog::showItemDetails(int index)
{
DownloadItemForm *form = qobject_cast<DownloadItemForm *>(ui->listWidget->itemWidget(ui->listWidget->item(index)));
ui->mimeType_label->setText(form->item()->mimeType());
- ui->path_label->setText(form->item()->path());
+ ui->filePath_label->setText(form->item()->path());
+ ui->fileSize_label->setText(QString("%1 bytes").arg(form->item()->totalBytes()));
}