Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kamm <mail@ckamm.de>2017-05-17 11:55:42 +0300
committerckamm <mail@ckamm.de>2017-05-17 13:26:27 +0300
commitc8d0f788e00bdae125a26d9159ce9efdd6325cd2 (patch)
treead77cb515fe650984e6b76dfffe09838090d77bd /src/gui/logbrowser.cpp
parentae263d60bd6d1bc0eb0c3712bab11de120b8cdd3 (diff)
Apply clang-format
Diffstat (limited to 'src/gui/logbrowser.cpp')
-rw-r--r--src/gui/logbrowser.cpp74
1 files changed, 36 insertions, 38 deletions
diff --git a/src/gui/logbrowser.cpp b/src/gui/logbrowser.cpp
index b4971bf45..41b526a3c 100644
--- a/src/gui/logbrowser.cpp
+++ b/src/gui/logbrowser.cpp
@@ -38,20 +38,20 @@ namespace OCC {
// ==============================================================================
LogWidget::LogWidget(QWidget *parent)
- :QPlainTextEdit(parent)
+ : QPlainTextEdit(parent)
{
- setReadOnly( true );
+ setReadOnly(true);
QFont font;
font.setFamily(QLatin1String("Courier New"));
font.setFixedPitch(true);
- document()->setDefaultFont( font );
+ document()->setDefaultFont(font);
}
// ==============================================================================
-LogBrowser::LogBrowser(QWidget *parent) :
- QDialog(parent),
- _logWidget( new LogWidget(parent) )
+LogBrowser::LogBrowser(QWidget *parent)
+ : QDialog(parent)
+ , _logWidget(new LogWidget(parent))
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setObjectName("LogBrowser"); // for save/restoreGeometry()
@@ -61,62 +61,62 @@ LogBrowser::LogBrowser(QWidget *parent) :
QVBoxLayout *mainLayout = new QVBoxLayout;
// mainLayout->setMargin(0);
- mainLayout->addWidget( _logWidget );
+ mainLayout->addWidget(_logWidget);
QHBoxLayout *toolLayout = new QHBoxLayout;
- mainLayout->addLayout( toolLayout );
+ mainLayout->addLayout(toolLayout);
// Search input field
QLabel *lab = new QLabel(tr("&Search:") + " ");
_findTermEdit = new QLineEdit;
- lab->setBuddy( _findTermEdit );
+ lab->setBuddy(_findTermEdit);
toolLayout->addWidget(lab);
- toolLayout->addWidget( _findTermEdit );
+ toolLayout->addWidget(_findTermEdit);
// find button
QPushButton *findBtn = new QPushButton;
- findBtn->setText( tr("&Find") );
- connect( findBtn, SIGNAL(clicked()), this, SLOT(slotFind()));
- toolLayout->addWidget( findBtn );
+ findBtn->setText(tr("&Find"));
+ connect(findBtn, SIGNAL(clicked()), this, SLOT(slotFind()));
+ toolLayout->addWidget(findBtn);
// stretch
toolLayout->addStretch(1);
_statusLabel = new QLabel;
- toolLayout->addWidget( _statusLabel );
+ toolLayout->addWidget(_statusLabel);
toolLayout->addStretch(5);
// Debug logging
_logDebugCheckBox = new QCheckBox(tr("&Capture debug messages") + " ");
connect(_logDebugCheckBox, SIGNAL(stateChanged(int)), SLOT(slotDebugCheckStateChanged(int)));
- toolLayout->addWidget( _logDebugCheckBox );
+ toolLayout->addWidget(_logDebugCheckBox);
QDialogButtonBox *btnbox = new QDialogButtonBox;
- QPushButton *closeBtn = btnbox->addButton( QDialogButtonBox::Close );
- connect(closeBtn,SIGNAL(clicked()),this,SLOT(close()));
+ QPushButton *closeBtn = btnbox->addButton(QDialogButtonBox::Close);
+ connect(closeBtn, SIGNAL(clicked()), this, SLOT(close()));
- mainLayout->addWidget( btnbox );
+ mainLayout->addWidget(btnbox);
// clear button
_clearBtn = new QPushButton;
- _clearBtn->setText( tr("Clear") );
- _clearBtn->setToolTip( tr("Clear the log display.") );
+ _clearBtn->setText(tr("Clear"));
+ _clearBtn->setToolTip(tr("Clear the log display."));
btnbox->addButton(_clearBtn, QDialogButtonBox::ActionRole);
- connect( _clearBtn, SIGNAL(clicked()), this, SLOT(slotClearLog()));
+ connect(_clearBtn, SIGNAL(clicked()), this, SLOT(slotClearLog()));
// save Button
_saveBtn = new QPushButton;
- _saveBtn->setText( tr("S&ave") );
+ _saveBtn->setText(tr("S&ave"));
_saveBtn->setToolTip(tr("Save the log file to a file on disk for debugging."));
btnbox->addButton(_saveBtn, QDialogButtonBox::ActionRole);
- connect( _saveBtn, SIGNAL(clicked()),this, SLOT(slotSave()));
+ connect(_saveBtn, SIGNAL(clicked()), this, SLOT(slotSave()));
- setLayout( mainLayout );
+ setLayout(mainLayout);
setModal(false);
Logger::instance()->setLogWindowActivated(true);
// Direct connection for log coming from this thread, and queued for the one in a different thread
- connect(Logger::instance(), SIGNAL(logWindowLog(QString)),this,SLOT(slotNewLog(QString)), Qt::AutoConnection);
+ connect(Logger::instance(), SIGNAL(logWindowLog(QString)), this, SLOT(slotNewLog(QString)), Qt::AutoConnection);
QAction *showLogWindow = new QAction(this);
showLogWindow->setShortcut(QKeySequence("F12"));
@@ -126,8 +126,7 @@ LogBrowser::LogBrowser(QWidget *parent) :
ConfigFile cfg;
cfg.restoreGeometry(this);
int lines = cfg.maxLogLines();
- _logWidget->document()->setMaximumBlockCount( lines );
-
+ _logWidget->document()->setMaximumBlockCount(lines);
}
LogBrowser::~LogBrowser()
@@ -147,10 +146,10 @@ void LogBrowser::closeEvent(QCloseEvent *)
}
-void LogBrowser::slotNewLog( const QString& msg )
+void LogBrowser::slotNewLog(const QString &msg)
{
- if( _logWidget->isVisible() ) {
- _logWidget->appendPlainText( msg );
+ if (_logWidget->isVisible()) {
+ _logWidget->appendPlainText(msg);
}
}
@@ -159,9 +158,10 @@ void LogBrowser::slotFind()
{
QString searchText = _findTermEdit->text();
- if( searchText.isEmpty() ) return;
+ if (searchText.isEmpty())
+ return;
- search( searchText );
+ search(searchText);
}
void LogBrowser::slotDebugCheckStateChanged(int checkState)
@@ -169,7 +169,7 @@ void LogBrowser::slotDebugCheckStateChanged(int checkState)
Logger::instance()->setLogDebug(checkState == Qt::Checked);
}
-void LogBrowser::search( const QString& str )
+void LogBrowser::search(const QString &str)
{
QList<QTextEdit::ExtraSelection> extraSelections;
@@ -177,8 +177,7 @@ void LogBrowser::search( const QString& str )
QColor color = QColor(Qt::gray).lighter(130);
_statusLabel->clear();
- while(_logWidget->find(str))
- {
+ while (_logWidget->find(str)) {
QTextEdit::ExtraSelection extra;
extra.format.setBackground(color);
@@ -196,9 +195,9 @@ void LogBrowser::slotSave()
{
_saveBtn->setEnabled(false);
- QString saveFile = QFileDialog::getSaveFileName( this, tr("Save log file"), QDir::homePath() );
+ QString saveFile = QFileDialog::getSaveFileName(this, tr("Save log file"), QDir::homePath());
- if( ! saveFile.isEmpty() ) {
+ if (!saveFile.isEmpty()) {
QFile file(saveFile);
if (file.open(QIODevice::WriteOnly)) {
@@ -210,7 +209,6 @@ void LogBrowser::slotSave()
}
}
_saveBtn->setEnabled(true);
-
}
void LogBrowser::slotClearLog()