Uncrustify

This commit is contained in:
Chocobo1 2017-04-05 15:21:12 +08:00
parent a86f189f53
commit 812bd4c83a
8 changed files with 83 additions and 80 deletions

View file

@ -100,7 +100,7 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent)
m_resolveCountries = Preferences::instance()->resolvePeerCountries();
if (!m_resolveCountries)
hideColumn(PeerListDelegate::COUNTRY);
//Ensure that at least one column is visible at all times
// Ensure that at least one column is visible at all times
bool atLeastOne = false;
for (unsigned int i = 0; i < PeerListDelegate::IP_HIDDEN; i++) {
if (!isColumnHidden(i)) {
@ -110,9 +110,9 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent)
}
if (!atLeastOne)
setColumnHidden(PeerListDelegate::IP, false);
//To also mitigate the above issue, we have to resize each column when
//its size is 0, because explicitly 'showing' the column isn't enough
//in the above scenario.
// To also mitigate the above issue, we have to resize each column when
// its size is 0, because explicitly 'showing' the column isn't enough
// in the above scenario.
for (unsigned int i = 0; i < PeerListDelegate::IP_HIDDEN; i++)
if ((columnWidth(i) <= 0) && !isColumnHidden(i))
resizeColumnToContents(i);
@ -128,7 +128,7 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent)
updatePeerHostNameResolutionState();
// SIGNAL/SLOT
header()->setContextMenuPolicy(Qt::CustomContextMenu);
connect(header(), SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(displayToggleColumnsMenu(const QPoint &)));
connect(header(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayToggleColumnsMenu(const QPoint&)));
connect(header(), SIGNAL(sectionClicked(int)), SLOT(handleSortColumnChanged(int)));
handleSortColumnChanged(header()->sortIndicatorSection());
m_copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copySelectedPeers()), 0, Qt::WidgetShortcut);
@ -148,11 +148,11 @@ PeerListWidget::~PeerListWidget()
delete m_resolver;
}
void PeerListWidget::displayToggleColumnsMenu(const QPoint&)
void PeerListWidget::displayToggleColumnsMenu(const QPoint &)
{
QMenu hideshowColumn(this);
hideshowColumn.setTitle(tr("Column visibility"));
QList<QAction*> actions;
QList<QAction *> actions;
for (int i = 0; i < PeerListDelegate::IP_HIDDEN; ++i) {
if ((i == PeerListDelegate::COUNTRY) && !Preferences::instance()->resolvePeerCountries()) {
actions.append(nullptr); // keep the index in sync
@ -193,7 +193,7 @@ void PeerListWidget::updatePeerHostNameResolutionState()
if (Preferences::instance()->resolvePeerHostNames()) {
if (!m_resolver) {
m_resolver = new Net::ReverseResolution(this);
connect(m_resolver, SIGNAL(ipResolved(QString, QString)), SLOT(handleResolved(QString, QString)));
connect(m_resolver, SIGNAL(ipResolved(QString,QString)), SLOT(handleResolved(QString,QString)));
loadPeers(m_properties->getCurrentTorrent(), true);
}
}
@ -218,7 +218,7 @@ void PeerListWidget::updatePeerCountryResolutionState()
}
}
void PeerListWidget::showPeerListMenu(const QPoint&)
void PeerListWidget::showPeerListMenu(const QPoint &)
{
QMenu menu;
bool emptyMenu = true;
@ -362,7 +362,7 @@ void PeerListWidget::loadPeers(BitTorrent::TorrentHandle *const torrent, bool fo
// Delete peers that are gone
QSetIterator<QString> it(oldeersSet);
while (it.hasNext()) {
const QString& ip = it.next();
const QString &ip = it.next();
m_missingFlags.remove(ip);
m_peerAddresses.remove(ip);
QStandardItem *item = m_peerItems.take(ip);
@ -370,7 +370,7 @@ void PeerListWidget::loadPeers(BitTorrent::TorrentHandle *const torrent, bool fo
}
}
QStandardItem* PeerListWidget::addPeer(const QString& ip, BitTorrent::TorrentHandle *const torrent, const BitTorrent::PeerInfo &peer)
QStandardItem *PeerListWidget::addPeer(const QString &ip, BitTorrent::TorrentHandle *const torrent, const BitTorrent::PeerInfo &peer)
{
int row = m_listModel->rowCount();
// Adding Peer to peer list
@ -460,7 +460,7 @@ void PeerListWidget::wheelEvent(QWheelEvent *event)
{
event->accept();
if(event->modifiers() & Qt::ShiftModifier) {
if (event->modifiers() & Qt::ShiftModifier) {
// Shift + scroll = horizontal scroll
QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal);
QTreeView::wheelEvent(&scrollHEvent);