Skip to content

Commit

Permalink
clang-format code format
Browse files Browse the repository at this point in the history
  • Loading branch information
kapitainsky committed Oct 27, 2019
1 parent 5627532 commit 5db8842
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
32 changes: 17 additions & 15 deletions src/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
MainWindow::MainWindow() {
ui.setupUi(this);

#if defined(Q_OS_WIN)
#if defined(Q_OS_WIN)
// disable "?" WindowContextHelpButton
QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
#endif
#endif

mSystemTray.setIcon(qApp->windowIcon());
{
Expand Down Expand Up @@ -57,7 +57,6 @@ MainWindow::MainWindow() {
}

QObject::connect(ui.preferences, &QAction::triggered, this, [=]() {

PreferencesDialog dialog(this);
if (dialog.exec() == QDialog::Accepted) {
auto settings = GetSettings();
Expand Down Expand Up @@ -242,17 +241,19 @@ MainWindow::MainWindow() {
});

QMenu *trayMenu = new QMenu(this);
QObject::connect(trayMenu->addAction("&Show"), &QAction::triggered, this,
[=]() {
MainWindow::setWindowState( (windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
MainWindow::show(); //bring window to top on OSX
MainWindow::raise(); //bring window from minimized state on OSX
MainWindow::activateWindow(); //bring window to front/unminimize on windows
mSystemTray.setVisible(mAlwaysShowInTray);
QObject::connect(
trayMenu->addAction("&Show"), &QAction::triggered, this, [=]() {
MainWindow::setWindowState((windowState() & ~Qt::WindowMinimized) |
Qt::WindowActive);
MainWindow::show(); // bring window to top on OSX
MainWindow::raise(); // bring window from minimized state on OSX
MainWindow::activateWindow(); // bring window to front/unminimize on
// windows
mSystemTray.setVisible(mAlwaysShowInTray);
#ifdef Q_OS_OSX
osxShowDockIcon();
osxShowDockIcon();
#endif
});
});
QObject::connect(trayMenu->addAction("&Quit"), &QAction::triggered, this,
&QWidget::close);
mSystemTray.setContextMenu(trayMenu);
Expand Down Expand Up @@ -404,7 +405,7 @@ void MainWindow::rcloneGetVersion() {
};

// dont check if already checked today (once per day only)
if (!(last_check == current_date)) {
if (!(last_check == current_date)) {
// remmber when last checked
settings->setValue("Settings/lastRcloneUpdateCheck", current_date);

Expand Down Expand Up @@ -484,7 +485,7 @@ void MainWindow::rcloneGetVersion() {
};

// dont check if already checked today (once per day only)
if (!(last_check == current_date)) {
if (!(last_check == current_date)) {
// remmber when last checked
settings->setValue("Settings/lastRcloneBrowserUpdateCheck",
current_date);
Expand Down Expand Up @@ -786,7 +787,8 @@ void MainWindow::editSelectedTask() {
QString path = isDownload ? jo->dest : jo->source;
qDebug() << "remote:" + remote;
qDebug() << "path:" + path;
TransferDialog td(isDownload, false, remote, path, jo->isFolder, this, jo, true);
TransferDialog td(isDownload, false, remote, path, jo->isFolder, this, jo,
true);
td.exec();
// restore the selection to help user keep track of what s/he was doing
ui.tasksListWidget->selectionModel()->select(selection,
Expand Down
6 changes: 3 additions & 3 deletions src/mount_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void MountWidget::cancel() {
#ifdef Q_OS_OSX
QProcess::startDetached("umount", QStringList() << ui.folder->text());
#else
#if defined(Q_OS_WIN32)
#if defined(Q_OS_WIN32)
QProcess *p = new QProcess();
QStringList args;
args << "rc";
Expand All @@ -102,10 +102,10 @@ void MountWidget::cancel() {

UseRclonePassword(p);
p->start(GetRclone(), args, QIODevice::ReadOnly);
#else
#else
QProcess::startDetached("fusermount", QStringList()
<< "-u" << ui.folder->text());
#endif
#endif
#endif

mProcess->waitForFinished();
Expand Down
2 changes: 1 addition & 1 deletion src/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <QtCore>
#include <QtDebug>
#include <QtGui>
#include <QtWidgets>
#include <QtNetwork>
#include <QtWidgets>

#if defined(Q_OS_WIN32)
#include <QtWinExtras>
Expand Down
6 changes: 2 additions & 4 deletions src/transfer_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ TransferDialog::TransferDialog(bool isDownload, bool isDrop,
ui.buttonSourceFolder->setIcon(style->standardIcon(QStyle::SP_DirIcon));
ui.buttonDest->setIcon(style->standardIcon(QStyle::SP_DirIcon));

ui.buttonDefaultSource->setIcon(
style->standardIcon(QStyle::SP_DirHomeIcon));
ui.buttonDefaultDest->setIcon(
style->standardIcon(QStyle::SP_DirHomeIcon));
ui.buttonDefaultSource->setIcon(style->standardIcon(QStyle::SP_DirHomeIcon));
ui.buttonDefaultDest->setIcon(style->standardIcon(QStyle::SP_DirHomeIcon));

if (!mIsEditMode) {
QPushButton *dryRun =
Expand Down
4 changes: 2 additions & 2 deletions src/transfer_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class TransferDialog : public QDialog {
Q_OBJECT

public:
TransferDialog(bool isDownload, bool isDrop, const QString &remote, const QDir &path,
bool isFolder, QWidget *parent = nullptr,
TransferDialog(bool isDownload, bool isDrop, const QString &remote,
const QDir &path, bool isFolder, QWidget *parent = nullptr,
JobOptions *task = nullptr, bool editMode = false);
~TransferDialog();

Expand Down

0 comments on commit 5db8842

Please sign in to comment.