aboutsummaryrefslogtreecommitdiff
path: root/lib/downloads
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-01-07 23:28:42 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-01-07 23:28:42 +0100
commitb984992fc92b6dd607732d6dad1c533b36f1ba3a (patch)
tree984c5ede072c2ebb10ad32acb5d5928162feb97f /lib/downloads
parentSearching through BookmarkModel elements (diff)
downloadsmolbote-b984992fc92b6dd607732d6dad1c533b36f1ba3a.tar.xz
Added .clang-format
Diffstat (limited to 'lib/downloads')
-rw-r--r--lib/downloads/downloadswidget.cpp18
-rw-r--r--lib/downloads/downloadswidget.h3
-rw-r--r--lib/downloads/widgets/downloaditemwidget.cpp8
-rw-r--r--lib/downloads/widgets/downloaditemwidget.h5
-rw-r--r--lib/downloads/widgets/elidedlabel.h6
5 files changed, 22 insertions, 18 deletions
diff --git a/lib/downloads/downloadswidget.cpp b/lib/downloads/downloadswidget.cpp
index 1a5f268..b3bad67 100644
--- a/lib/downloads/downloadswidget.cpp
+++ b/lib/downloads/downloadswidget.cpp
@@ -9,14 +9,14 @@
#include "downloadswidget.h"
#include "ui_downloadsform.h"
-#include <QWebEngineDownloadItem>
+#include "widgets/downloaditemwidget.h"
#include <QFileDialog>
#include <QListWidget>
-#include "widgets/downloaditemwidget.h"
+#include <QWebEngineDownloadItem>
-DownloadsWidget::DownloadsWidget(const QString &downloadPath, QWidget *parent) :
- QDialog(parent),
- ui(new Ui::DownloadDialog)
+DownloadsWidget::DownloadsWidget(const QString &downloadPath, QWidget *parent)
+ : QDialog(parent)
+ , ui(new Ui::DownloadDialog)
{
// make sure this dialog does not get deleted on close
setAttribute(Qt::WA_DeleteOnClose, false);
@@ -27,13 +27,13 @@ DownloadsWidget::DownloadsWidget(const QString &downloadPath, QWidget *parent) :
m_downloadPath = downloadPath;
connect(ui->listWidget, &QListWidget::currentItemChanged, this, [this](QListWidgetItem *current, QListWidgetItem *previous) {
- DownloadItemWidget *currentWidget = qobject_cast<DownloadItemWidget*>(ui->listWidget->itemWidget(current));
+ DownloadItemWidget *currentWidget = qobject_cast<DownloadItemWidget *>(ui->listWidget->itemWidget(current));
currentWidget->showDetails();
currentWidget->setFixedWidth(ui->listWidget->viewport()->width());
currentWidget->adjustSize();
current->setSizeHint(currentWidget->size());
- DownloadItemWidget *previousWidget = qobject_cast<DownloadItemWidget*>(ui->listWidget->itemWidget(previous));
+ DownloadItemWidget *previousWidget = qobject_cast<DownloadItemWidget *>(ui->listWidget->itemWidget(previous));
if(previousWidget != nullptr) {
previousWidget->hideDetails();
previousWidget->setFixedWidth(ui->listWidget->viewport()->width());
@@ -53,8 +53,8 @@ void DownloadsWidget::addDownload(QWebEngineDownloadItem *item)
this->show();
QString filepath = QFileDialog::getSaveFileName(this,
- tr("Save"),
- m_downloadPath + "/" + QFileInfo(item->path()).fileName());
+ tr("Save"),
+ m_downloadPath + "/" + QFileInfo(item->path()).fileName());
if(filepath.isEmpty()) {
// user cancelled the save dialog
diff --git a/lib/downloads/downloadswidget.h b/lib/downloads/downloadswidget.h
index 8c9ea21..d724e08 100644
--- a/lib/downloads/downloadswidget.h
+++ b/lib/downloads/downloadswidget.h
@@ -11,7 +11,8 @@
#include <QDialog>
-namespace Ui {
+namespace Ui
+{
class DownloadDialog;
}
diff --git a/lib/downloads/widgets/downloaditemwidget.cpp b/lib/downloads/widgets/downloaditemwidget.cpp
index a51275e..6860c16 100644
--- a/lib/downloads/widgets/downloaditemwidget.cpp
+++ b/lib/downloads/widgets/downloaditemwidget.cpp
@@ -11,9 +11,9 @@
#include <QUrl>
-DownloadItemWidget::DownloadItemWidget(QWebEngineDownloadItem *item, QWidget *parent) :
- QWidget(parent),
- ui(new Ui::DownloadItemForm)
+DownloadItemWidget::DownloadItemWidget(QWebEngineDownloadItem *item, QWidget *parent)
+ : QWidget(parent)
+ , ui(new Ui::DownloadItemForm)
{
m_item = item;
@@ -68,7 +68,7 @@ QString DownloadItemWidget::sizeString(int size) const
void DownloadItemWidget::updateState(QWebEngineDownloadItem::DownloadState state)
{
- switch (state) {
+ switch(state) {
case QWebEngineDownloadItem::DownloadRequested:
ui->status_label->setText(tr("Requested"));
break;
diff --git a/lib/downloads/widgets/downloaditemwidget.h b/lib/downloads/widgets/downloaditemwidget.h
index c6246da..09a7370 100644
--- a/lib/downloads/widgets/downloaditemwidget.h
+++ b/lib/downloads/widgets/downloaditemwidget.h
@@ -9,10 +9,11 @@
#ifndef DOWNLOADITEMFORM_H
#define DOWNLOADITEMFORM_H
-#include <QWidget>
#include <QWebEngineDownloadItem>
+#include <QWidget>
-namespace Ui {
+namespace Ui
+{
class DownloadItemForm;
}
diff --git a/lib/downloads/widgets/elidedlabel.h b/lib/downloads/widgets/elidedlabel.h
index d0f6221..d6c06c5 100644
--- a/lib/downloads/widgets/elidedlabel.h
+++ b/lib/downloads/widgets/elidedlabel.h
@@ -67,10 +67,12 @@ public:
explicit ElidedLabel(QWidget *parent = nullptr);
void setContent(const QString &text);
- const QString & text() const {
+ const QString &text() const
+ {
return content;
}
- bool isElided() const {
+ bool isElided() const
+ {
return elided;
}