From b984992fc92b6dd607732d6dad1c533b36f1ba3a Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 7 Jan 2018 23:28:42 +0100 Subject: Added .clang-format --- lib/downloads/downloadswidget.cpp | 18 +++++++++--------- lib/downloads/downloadswidget.h | 3 ++- lib/downloads/widgets/downloaditemwidget.cpp | 8 ++++---- lib/downloads/widgets/downloaditemwidget.h | 5 +++-- lib/downloads/widgets/elidedlabel.h | 6 ++++-- 5 files changed, 22 insertions(+), 18 deletions(-) (limited to 'lib/downloads') 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 +#include "widgets/downloaditemwidget.h" #include #include -#include "widgets/downloaditemwidget.h" +#include -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(ui->listWidget->itemWidget(current)); + DownloadItemWidget *currentWidget = qobject_cast(ui->listWidget->itemWidget(current)); currentWidget->showDetails(); currentWidget->setFixedWidth(ui->listWidget->viewport()->width()); currentWidget->adjustSize(); current->setSizeHint(currentWidget->size()); - DownloadItemWidget *previousWidget = qobject_cast(ui->listWidget->itemWidget(previous)); + DownloadItemWidget *previousWidget = qobject_cast(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 -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 -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 #include +#include -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; } -- cgit v1.2.1