Commit 1a05112b authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

CI: enable clazy incorrect-emit

parent 96f00a4d
......@@ -70,7 +70,7 @@ bool pageSize::setPageSize(const QString& name)
// Set page width/height accordingly
pageWidth.setLength_in_mm(staticList[currentSize].width);
pageHeight.setLength_in_mm(staticList[currentSize].height);
emit(sizeChanged(*this));
emit sizeChanged(*this);
return true;
}
}
......@@ -88,7 +88,7 @@ bool pageSize::setPageSize(const QString& name)
rectifySizes();
reconstructCurrentSize();
emit(sizeChanged(*this));
emit sizeChanged(*this);
return true;
}
}
......@@ -106,7 +106,7 @@ bool pageSize::setPageSize(const QString& name)
rectifySizes();
reconstructCurrentSize();
emit(sizeChanged(*this));
emit sizeChanged(*this);
return true;
}
}
......@@ -117,7 +117,7 @@ bool pageSize::setPageSize(const QString& name)
pageWidth.setLength_in_mm(staticList[currentSize].width);
pageHeight.setLength_in_mm(staticList[currentSize].height);
qCCritical(OkularDviShellDebug) << "pageSize::setPageSize: could not parse '" << name << "'. Using " << staticList[currentSize].name << " as a default." << endl;
emit(sizeChanged(*this));
emit sizeChanged(*this);
return false;
}
......@@ -132,7 +132,7 @@ void pageSize::setPageSize(double width, double height)
rectifySizes();
reconstructCurrentSize();
if ( !isNearlyEqual(oldPage))
emit(sizeChanged(*this));
emit sizeChanged(*this);
}
......@@ -168,7 +168,7 @@ void pageSize::setPageSize(const QString& width, const QString& _widthUnits, con
rectifySizes();
reconstructCurrentSize();
if ( !isNearlyEqual(oldPage))
emit(sizeChanged(*this));
emit sizeChanged(*this);
}
......@@ -181,7 +181,7 @@ pageSize &pageSize::operator= (const pageSize &src)
pageHeight = src.pageHeight;
if ( !isNearlyEqual(oldPage))
emit(sizeChanged(*this));
emit sizeChanged(*this);
return *this;
}
......@@ -293,7 +293,7 @@ void pageSize::setOrientation(int orient)
pageWidth.setLength_in_mm(staticList[currentSize].width);
pageHeight.setLength_in_mm(staticList[currentSize].height);
}
emit(sizeChanged(*this));
emit sizeChanged(*this);
}
......
......@@ -37,11 +37,11 @@ void Converter::handleMetadata(const QMap<Mobipocket::Document::MetaKey,QString>
while (it.hasNext()) {
it.next();
switch (it.key()) {
case Mobipocket::Document::Title: addMetaData(Okular::DocumentInfo::Title, it.value()); break;
case Mobipocket::Document::Author: addMetaData(Okular::DocumentInfo::Author, it.value()); break;
case Mobipocket::Document::Description: addMetaData(Okular::DocumentInfo::Description, it.value()); break;
case Mobipocket::Document::Subject: addMetaData(Okular::DocumentInfo::Subject, it.value()); break;
case Mobipocket::Document::Copyright: addMetaData(Okular::DocumentInfo::Copyright, it.value()); break;
case Mobipocket::Document::Title: emit addMetaData(Okular::DocumentInfo::Title, it.value()); break;
case Mobipocket::Document::Author: emit addMetaData(Okular::DocumentInfo::Author, it.value()); break;
case Mobipocket::Document::Description: emit addMetaData(Okular::DocumentInfo::Description, it.value()); break;
case Mobipocket::Document::Subject: emit addMetaData(Okular::DocumentInfo::Subject, it.value()); break;
case Mobipocket::Document::Copyright: emit addMetaData(Okular::DocumentInfo::Copyright, it.value()); break;
}
}
}
......
......@@ -1123,8 +1123,8 @@ void Part::openUrlFromDocument(const QUrl &url)
}
}
m_bExtension->openUrlNotify();
m_bExtension->setLocationBarUrl(url.toDisplayString());
emit m_bExtension->openUrlNotify();
emit m_bExtension->setLocationBarUrl(url.toDisplayString());
openUrl(url);
}
......
......@@ -838,7 +838,7 @@ void Shell::slotFitWindowToPage(const QSize& pageViewSize, const QSize& pageSize
const int yOffset = pageViewSize.height() - pageSize.height();
showNormal();
resize( width() - xOffset, height() - yOffset);
moveSplitter(pageSize.width());
emit moveSplitter(pageSize.width());
}
/* kate: replace-tabs on; indent-width 4; */
/***************************************************************************
/***************************************************************************
* Copyright (C) 2006 by Chu Xiaodong <xiaodongchu@gmail.com> *
* Copyright (C) 2006 by Pino Toscano <pino@kde.org> *
* Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group *
......@@ -232,7 +232,9 @@ AnnotWindow::AnnotWindow( QWidget * parent, Okular::Annotation * annot, Okular::
lowerlay->addWidget( sb );
m_latexRenderer = new GuiUtils::LatexRenderer();
emit containsLatex( GuiUtils::LatexRenderer::mightContainLatex( m_annot->contents() ) );
// The emit below is not wrong even if emitting signals from the constructor it's usually wrong
// in this case the signal it's connected to inside MovableTitle constructor a few lines above
emit containsLatex( GuiUtils::LatexRenderer::mightContainLatex( m_annot->contents() ) ); // clazy:exclude=incorrect-emit
m_title->setTitle( m_annot->window().summary() );
m_title->connectOptionButton( this, SLOT(slotOptionBtn()) );
......
......@@ -607,12 +607,12 @@ void FormLineEdit::slotChanged()
if ( contents != form->text() )
{
m_controller->formTextChangedByWidget( pageItem()->pageNumber(),
form,
contents,
cursorPos,
m_prevCursorPos,
m_prevAnchorPos );
emit m_controller->formTextChangedByWidget( pageItem()->pageNumber(),
form,
contents,
cursorPos,
m_prevCursorPos,
m_prevAnchorPos );
}
m_prevCursorPos = cursorPos;
......@@ -794,12 +794,12 @@ void TextAreaEdit::slotChanged()
if (contents != form->text())
{
m_controller->formTextChangedByWidget( pageItem()->pageNumber(),
form,
contents,
cursorPos,
m_prevCursorPos,
m_prevAnchorPos );
emit m_controller->formTextChangedByWidget( pageItem()->pageNumber(),
form,
contents,
cursorPos,
m_prevCursorPos,
m_prevAnchorPos );
}
m_prevCursorPos = cursorPos;
m_prevAnchorPos = textCursor().anchor();
......@@ -903,12 +903,12 @@ void FileEdit::slotChanged()
int cursorPos = lineEdit()->cursorPosition();
if (contents != form->text())
{
m_controller->formTextChangedByWidget( pageItem()->pageNumber(),
form,
contents,
cursorPos,
m_prevCursorPos,
m_prevAnchorPos );
emit m_controller->formTextChangedByWidget( pageItem()->pageNumber(),
form,
contents,
cursorPos,
m_prevCursorPos,
m_prevAnchorPos );
}
m_prevCursorPos = cursorPos;
......@@ -987,9 +987,9 @@ void ListEdit::slotSelectionChanged()
}
Okular::FormFieldChoice *form = static_cast<Okular::FormFieldChoice *>(m_ff);
if ( rows != form->currentChoices() ) {
m_controller->formListChangedByWidget( pageItem()->pageNumber(),
form,
rows );
emit m_controller->formListChangedByWidget( pageItem()->pageNumber(),
form,
rows );
}
}
......@@ -1064,13 +1064,13 @@ void ComboEdit::slotValueChanged()
int cursorPos = lineEdit()->cursorPosition();
if ( text != prevText )
{
m_controller->formComboChangedByWidget( pageItem()->pageNumber(),
form,
currentText(),
cursorPos,
m_prevCursorPos,
m_prevAnchorPos
);
emit m_controller->formComboChangedByWidget( pageItem()->pageNumber(),
form,
currentText(),
cursorPos,
m_prevCursorPos,
m_prevAnchorPos
);
}
prevText = text;
m_prevCursorPos = cursorPos;
......
......@@ -37,7 +37,6 @@ Layers::Layers(QWidget *parent, Okular::Document *document) : QWidget(parent), m
m_treeView = new QTreeView( this );
mainlay->addWidget( m_treeView );
emit hasLayers( false );
m_treeView->setSortingEnabled( false );
m_treeView->setRootIsDecorated( true );
m_treeView->setAlternatingRowColors( true );
......
......@@ -284,13 +284,13 @@ void MiniBar::slotChangePage( int pageNumber )
void MiniBar::slotEmitNextPage()
{
// emit signal
nextPage();
emit nextPage();
}
void MiniBar::slotEmitPrevPage()
{
// emit signal
prevPage();
emit prevPage();
}
void MiniBar::slotToolBarIconSizeChanged()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment