X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fdebugbufferviewoverlay.cpp;h=c299523d27b7aab4e5dd86488aef3bc2616234d9;hp=529a75ad57d0dc4aec9d43ffccea15c6789387ca;hb=9188f1a4880dc7f4c26612a265c1d874f6df5a8c;hpb=c230f7bd892b78b09710cf5746c2bf12a73d6b9b diff --git a/src/qtui/debugbufferviewoverlay.cpp b/src/qtui/debugbufferviewoverlay.cpp index 529a75ad..c299523d 100644 --- a/src/qtui/debugbufferviewoverlay.cpp +++ b/src/qtui/debugbufferviewoverlay.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "debugbufferviewoverlay.h" @@ -30,80 +30,77 @@ #include "bufferviewoverlayfilter.h" #include "client.h" -DebugBufferViewOverlay::DebugBufferViewOverlay(QWidget *parent) - : QWidget(parent) +DebugBufferViewOverlay::DebugBufferViewOverlay(QWidget* parent) + : QWidget(parent) { - ui.setupUi(this); + ui.setupUi(this); - BufferViewOverlayFilter *filter = new BufferViewOverlayFilter(Client::bufferModel(), Client::bufferViewOverlay()); + auto* filter = new BufferViewOverlayFilter(Client::bufferModel(), Client::bufferViewOverlay()); - filter->setParent(ui.bufferView); + filter->setParent(ui.bufferView); - ui.bufferView->setModel(filter); - ui.bufferView->setColumnWidth(0, 250); - ui.bufferView->setColumnWidth(1, 250); - ui.bufferView->setColumnWidth(2, 80); - ui.bufferView->resize(610, 300); - ui.bufferView->show(); + ui.bufferView->setModel(filter); + ui.bufferView->setColumnWidth(0, 250); + ui.bufferView->setColumnWidth(1, 250); + ui.bufferView->setColumnWidth(2, 80); + ui.bufferView->resize(610, 300); + ui.bufferView->show(); - QFormLayout *layout = new QFormLayout(ui.overlayProperties); - layout->addRow(tr("BufferViews:"), _bufferViews = new QLineEdit(this)); - layout->addRow(tr("All Networks:"), _allNetworks = new QLabel(this)); - layout->addRow(tr("Networks:"), _networks = new QLineEdit(this)); - layout->addRow(tr("Buffers:"), _bufferIds = new QTextEdit(this)); - layout->addRow(tr("Removed buffers:"), _removedBufferIds = new QTextEdit(this)); - layout->addRow(tr("Temp. removed buffers:"), _tempRemovedBufferIds = new QTextEdit(this)); + auto* layout = new QFormLayout(ui.overlayProperties); + layout->addRow(tr("BufferViews:"), _bufferViews = new QLineEdit(this)); + layout->addRow(tr("All Networks:"), _allNetworks = new QLabel(this)); + layout->addRow(tr("Networks:"), _networks = new QLineEdit(this)); + layout->addRow(tr("Buffers:"), _bufferIds = new QTextEdit(this)); + layout->addRow(tr("Removed buffers:"), _removedBufferIds = new QTextEdit(this)); + layout->addRow(tr("Temp. removed buffers:"), _tempRemovedBufferIds = new QTextEdit(this)); - layout->addRow(tr("Add Bufers Automatically:"), _addBuffersAutomatically = new QLabel(this)); - layout->addRow(tr("Hide inactive buffers:"), _hideInactiveBuffers = new QLabel(this)); - layout->addRow(tr("Allowed buffer types:"), _allowedBufferTypes = new QLabel(this)); - layout->addRow(tr("Minimum activity:"), _minimumActivity = new QLabel(this)); + layout->addRow(tr("Allowed buffer types:"), _allowedBufferTypes = new QLabel(this)); + layout->addRow(tr("Minimum activity:"), _minimumActivity = new QLabel(this)); - layout->addRow(tr("Is initialized:"), _isInitialized = new QLabel(this)); + layout->addRow(tr("Is initialized:"), _isInitialized = new QLabel(this)); - update(); - connect(Client::bufferViewOverlay(), SIGNAL(hasChanged()), this, SLOT(update())); + update(); + connect(Client::bufferViewOverlay(), &BufferViewOverlay::hasChanged, this, &DebugBufferViewOverlay::update); } -void DebugBufferViewOverlay::update() { - BufferViewOverlay *overlay = Client::bufferViewOverlay(); - - _allNetworks->setText(overlay->allNetworks() ? "yes" : "no"); - - QStringList ids; - foreach(int bufferViewId, overlay->bufferViewIds()) { - ids << QString::number(bufferViewId); - } - _bufferViews->setText(ids.join(", ")); - - ids.clear(); - foreach(NetworkId networkId, overlay->networkIds()) { - ids << QString::number(networkId.toInt()); - } - _networks->setText(ids.join(", ")); - - ids.clear(); - foreach(BufferId bufferId, overlay->bufferIds()) { - ids << QString::number(bufferId.toInt()); - } - _bufferIds->setText(ids.join(", ")); - - ids.clear(); - foreach(BufferId bufferId, overlay->removedBufferIds()) { - ids << QString::number(bufferId.toInt()); - } - _removedBufferIds->setText(ids.join(", ")); - - ids.clear(); - foreach(BufferId bufferId, overlay->tempRemovedBufferIds()) { - ids << QString::number(bufferId.toInt()); - } - _tempRemovedBufferIds->setText(ids.join(", ")); - - _addBuffersAutomatically->setText(overlay->addBuffersAutomatically() ? "yes" : "no"); - _hideInactiveBuffers->setText(overlay->hideInactiveBuffers() ? "yes" : "no"); - _allowedBufferTypes->setText(QString::number(overlay->allowedBufferTypes())); - _minimumActivity->setText(QString::number(overlay->minimumActivity())); - - _isInitialized->setText(overlay->isInitialized() ? "yes" : "no"); +void DebugBufferViewOverlay::update() +{ + BufferViewOverlay* overlay = Client::bufferViewOverlay(); + + _allNetworks->setText(overlay->allNetworks() ? "yes" : "no"); + + QStringList ids; + foreach (int bufferViewId, overlay->bufferViewIds()) { + ids << QString::number(bufferViewId); + } + _bufferViews->setText(ids.join(", ")); + + ids.clear(); + foreach (NetworkId networkId, overlay->networkIds()) { + ids << QString::number(networkId.toInt()); + } + _networks->setText(ids.join(", ")); + + ids.clear(); + foreach (BufferId bufferId, overlay->bufferIds()) { + ids << QString::number(bufferId.toInt()); + } + _bufferIds->setText(ids.join(", ")); + + ids.clear(); + foreach (BufferId bufferId, overlay->removedBufferIds()) { + ids << QString::number(bufferId.toInt()); + } + _removedBufferIds->setText(ids.join(", ")); + + ids.clear(); + foreach (BufferId bufferId, overlay->tempRemovedBufferIds()) { + ids << QString::number(bufferId.toInt()); + } + _tempRemovedBufferIds->setText(ids.join(", ")); + + _allowedBufferTypes->setText(QString::number(overlay->allowedBufferTypes())); + _minimumActivity->setText(QString::number(overlay->minimumActivity())); + + _isInitialized->setText(overlay->isInitialized() ? "yes" : "no"); }