emit -> Q_EMIT

A future ECM is going to force that on us, so do it early
This commit is contained in:
Albert Astals Cid 2022-03-18 22:35:45 +01:00
parent 0a0687be99
commit ba35bbd9e6
58 changed files with 321 additions and 321 deletions

View File

@ -199,7 +199,7 @@ bool BookmarkManager::Private::enableOption(BookmarkOption option) const
void BookmarkManager::Private::openBookmark(const KBookmark &bm, Qt::MouseButtons, Qt::KeyboardModifiers)
{
emit q->openUrl(bm.url());
Q_EMIT q->openUrl(bm.url());
}
// END Reimplementations from KBookmarkOwner
@ -230,7 +230,7 @@ void BookmarkManager::Private::_o_changed(const QString &groupAddress, const QSt
referurl = urlForGroup(bm);
}
Q_ASSERT(referurl.isValid());
emit q->bookmarksChanged(referurl);
Q_EMIT q->bookmarksChanged(referurl);
// case for the url representing the current document
// (this might happen if the same document is open in another place;
// in such case, make really sure to be in sync)
@ -251,7 +251,7 @@ void BookmarkManager::Private::_o_changed(const QString &groupAddress, const QSt
}
}
}
emit q->saved();
Q_EMIT q->saved();
}
QList<QUrl> BookmarkManager::files() const
@ -352,7 +352,7 @@ KBookmark BookmarkManager::bookmark(const DocumentViewport &viewport) const
void BookmarkManager::save() const
{
d->manager->emitChanged();
emit const_cast<BookmarkManager *>(this)->saved();
Q_EMIT const_cast<BookmarkManager *>(this)->saved();
}
QHash<QUrl, QString>::iterator BookmarkManager::Private::bookmarkFind(const QUrl &url, bool doCreate, KBookmarkGroup *result)

View File

@ -802,7 +802,7 @@ bool DocumentPrivate::openRelativeFile(const QString &fileName)
qCDebug(OkularCoreDebug).nospace() << "openRelativeFile: '" << newUrl << "'";
emit m_parent->openUrl(newUrl);
Q_EMIT m_parent->openUrl(newUrl);
return m_url == newUrl;
}
@ -969,7 +969,7 @@ Document::OpenResult DocumentPrivate::openDocumentInternal(const KPluginMetaData
delete m_tempFile;
m_tempFile = nullptr;
// TODO: emit a message telling the document is empty
// TODO: Q_EMIT a message telling the document is empty
if (openResult == Document::OpenSuccess) {
openResult = Document::OpenError;
}
@ -1206,7 +1206,7 @@ void DocumentPrivate::recalculateForms()
// The format action handles the refresh.
m_parent->processFormatAction(action, fft);
} else {
emit m_parent->refreshFormWidget(fft);
Q_EMIT m_parent->refreshFormWidget(fft);
pageNeedsRefresh = true;
}
}
@ -1522,10 +1522,10 @@ void DocumentPrivate::rotationFinished(int page, Okular::Page *okularPage)
void DocumentPrivate::slotFontReadingProgress(int page)
{
emit m_parent->fontReadingProgress(page);
Q_EMIT m_parent->fontReadingProgress(page);
if (page >= (int)m_parent->pages() - 1) {
emit m_parent->fontReadingEnded();
Q_EMIT m_parent->fontReadingEnded();
m_fontThread = nullptr;
m_fontsCached = true;
}
@ -1537,7 +1537,7 @@ void DocumentPrivate::fontReadingGotFont(const Okular::FontInfo &font)
if (m_fontsCache.indexOf(font) == -1) {
m_fontsCache.append(font);
emit m_parent->gotFont(font);
Q_EMIT m_parent->gotFont(font);
}
}
@ -1661,7 +1661,7 @@ void DocumentPrivate::doContinueDirectionMatchSearch(void *doContinueDirectionMa
search->isCurrentlySearching = false;
}
emit m_parent->searchFinished(searchStruct->searchID, Document::SearchCancelled);
Q_EMIT m_parent->searchFinished(searchStruct->searchID, Document::SearchCancelled);
delete searchStruct->pagesToNotify;
delete searchStruct;
return;
@ -1676,10 +1676,10 @@ void DocumentPrivate::doContinueDirectionMatchSearch(void *doContinueDirectionMa
doContinue = true;
if (searchStruct->currentPage >= pageCount) {
searchStruct->currentPage = 0;
emit m_parent->notice(i18n("Continuing search from beginning"), 3000);
Q_EMIT m_parent->notice(i18n("Continuing search from beginning"), 3000);
} else if (searchStruct->currentPage < 0) {
searchStruct->currentPage = pageCount - 1;
emit m_parent->notice(i18n("Continuing search from bottom"), 3000);
Q_EMIT m_parent->notice(i18n("Continuing search from bottom"), 3000);
}
}
}
@ -1757,9 +1757,9 @@ void DocumentPrivate::doProcessSearchMatch(RegularAreaRect *match, RunningSearch
observer->notifyPageChanged(pageNumber, DocumentObserver::Highlights);
if (foundAMatch) {
emit m_parent->searchFinished(searchID, Document::MatchFound);
Q_EMIT m_parent->searchFinished(searchID, Document::MatchFound);
} else {
emit m_parent->searchFinished(searchID, Document::NoMatchFound);
Q_EMIT m_parent->searchFinished(searchID, Document::NoMatchFound);
}
delete pagesToNotify;
@ -1780,7 +1780,7 @@ void DocumentPrivate::doContinueAllDocumentSearch(void *pagesToNotifySet, void *
search->isCurrentlySearching = false;
}
emit m_parent->searchFinished(searchID, Document::SearchCancelled);
Q_EMIT m_parent->searchFinished(searchID, Document::SearchCancelled);
foreach (const MatchesVector &mv, *pageMatches)
qDeleteAll(mv);
delete pageMatches;
@ -1844,9 +1844,9 @@ void DocumentPrivate::doContinueAllDocumentSearch(void *pagesToNotifySet, void *
observer->notifyPageChanged(pageNumber, DocumentObserver::Highlights);
if (foundAMatch) {
emit m_parent->searchFinished(searchID, Document::MatchFound);
Q_EMIT m_parent->searchFinished(searchID, Document::MatchFound);
} else {
emit m_parent->searchFinished(searchID, Document::NoMatchFound);
Q_EMIT m_parent->searchFinished(searchID, Document::NoMatchFound);
}
delete pageMatches;
@ -1870,7 +1870,7 @@ void DocumentPrivate::doContinueGooglesDocumentSearch(void *pagesToNotifySet, vo
search->isCurrentlySearching = false;
}
emit m_parent->searchFinished(searchID, Document::SearchCancelled);
Q_EMIT m_parent->searchFinished(searchID, Document::SearchCancelled);
foreach (const MatchesVector &mv, *pageMatches) {
foreach (const MatchColor &mc, mv)
@ -1965,9 +1965,9 @@ void DocumentPrivate::doContinueGooglesDocumentSearch(void *pagesToNotifySet, vo
observer->notifyPageChanged(pageNumber, DocumentObserver::Highlights);
if (foundAMatch) {
emit m_parent->searchFinished(searchID, Document::MatchFound);
Q_EMIT m_parent->searchFinished(searchID, Document::MatchFound);
} else {
emit m_parent->searchFinished(searchID, Document::NoMatchFound);
Q_EMIT m_parent->searchFinished(searchID, Document::NoMatchFound);
}
delete pageMatches;
@ -2429,7 +2429,7 @@ Document::OpenResult Document::openDocument(const QString &docFile, const QUrl &
}
if (!offer.isValid()) {
d->m_openError = i18n("Can not find a plugin which is able to handle the document being passed.");
emit error(d->m_openError, -1);
Q_EMIT error(d->m_openError, -1);
qCWarning(OkularCoreDebug).nospace() << "No plugin for mimetype '" << mime.name() << "'.";
return OpenError;
}
@ -2476,7 +2476,7 @@ Document::OpenResult Document::openDocument(const QString &docFile, const QUrl &
// but we finally succeeded
// TODO one can still see the error message animating out but since this is a very rare
// condition we can leave this for future work
emit error(QString(), -1);
Q_EMIT error(QString(), -1);
}
}
if (openResult != OpenSuccess) {
@ -2607,7 +2607,7 @@ void Document::closeDocument()
return;
}
emit aboutToClose();
Q_EMIT aboutToClose();
delete d->m_pageController;
d->m_pageController = nullptr;
@ -2943,10 +2943,10 @@ void Document::startFontReading()
// this way the API is the same, and users no need to care about the
// internal caching
for (int i = 0; i < d->m_fontsCache.count(); ++i) {
emit gotFont(d->m_fontsCache.at(i));
emit fontReadingProgress(i / pages());
Q_EMIT gotFont(d->m_fontsCache.at(i));
Q_EMIT fontReadingProgress(i / pages());
}
emit fontReadingEnded();
Q_EMIT fontReadingEnded();
return;
}
@ -3797,7 +3797,7 @@ void Document::searchText(int searchID, const QString &text, bool fromStart, Qt:
// safety checks: don't perform searches on empty or unsearchable docs
if (!d->m_generator || !d->m_generator->hasFeature(Generator::TextExtraction) || d->m_pagesVector.isEmpty()) {
emit searchFinished(searchID, NoMatchFound);
Q_EMIT searchFinished(searchID, NoMatchFound);
return;
}
@ -3893,7 +3893,7 @@ void Document::continueSearch(int searchID)
// check if searchID is present in runningSearches
QMap<int, RunningSearch *>::const_iterator it = d->m_searches.constFind(searchID);
if (it == d->m_searches.constEnd()) {
emit searchFinished(searchID, NoMatchFound);
Q_EMIT searchFinished(searchID, NoMatchFound);
return;
}
@ -3909,7 +3909,7 @@ void Document::continueSearch(int searchID, SearchType type)
// check if searchID is present in runningSearches
QMap<int, RunningSearch *>::const_iterator it = d->m_searches.constFind(searchID);
if (it == d->m_searches.constEnd()) {
emit searchFinished(searchID, NoMatchFound);
Q_EMIT searchFinished(searchID, NoMatchFound);
return;
}
@ -4146,13 +4146,13 @@ void Document::processAction(const Action *action)
if (KRun::isExecutableFile(url, mime.name())) {
// this case is a link pointing to an executable with a parameter
// that also is an executable, possibly a hand-crafted pdf
emit error(i18n("The document is trying to execute an external application and, for your safety, Okular does not allow that."), -1);
Q_EMIT error(i18n("The document is trying to execute an external application and, for your safety, Okular does not allow that."), -1);
break;
}
} else {
// this case is a link pointing to an executable with no parameters
// core developers find unacceptable executing it even after asking the user
emit error(i18n("The document is trying to execute an external application and, for your safety, Okular does not allow that."), -1);
Q_EMIT error(i18n("The document is trying to execute an external application and, for your safety, Okular does not allow that."), -1);
break;
}
}
@ -4163,7 +4163,7 @@ void Document::processAction(const Action *action)
lst.append(url);
KRun::runService(*ptr, lst, nullptr);
} else {
emit error(i18n("No application found for opening file of mimetype %1.", mime.name()), -1);
Q_EMIT error(i18n("No application found for opening file of mimetype %1.", mime.name()), -1);
}
} break;
@ -4193,28 +4193,28 @@ void Document::processAction(const Action *action)
setNextViewport();
break;
case DocumentAction::Quit:
emit quit();
Q_EMIT quit();
break;
case DocumentAction::Presentation:
emit linkPresentation();
Q_EMIT linkPresentation();
break;
case DocumentAction::EndPresentation:
emit linkEndPresentation();
Q_EMIT linkEndPresentation();
break;
case DocumentAction::Find:
emit linkFind();
Q_EMIT linkFind();
break;
case DocumentAction::GoToPage:
emit linkGoToPage();
Q_EMIT linkGoToPage();
break;
case DocumentAction::Close:
emit close();
Q_EMIT close();
break;
case DocumentAction::Print:
emit requestPrint();
Q_EMIT requestPrint();
break;
case DocumentAction::SaveAs:
emit requestSaveAs();
Q_EMIT requestSaveAs();
break;
}
} break;
@ -4262,7 +4262,7 @@ void Document::processAction(const Action *action)
} break;
case Action::Movie:
emit processMovieAction(static_cast<const MovieAction *>(action));
Q_EMIT processMovieAction(static_cast<const MovieAction *>(action));
break;
case Action::Rendition: {
const RenditionAction *linkrendition = static_cast<const RenditionAction *>(action);
@ -4273,7 +4273,7 @@ void Document::processAction(const Action *action)
d->m_scripter->execute(linkrendition->scriptType(), linkrendition->script());
}
emit processRenditionAction(static_cast<const RenditionAction *>(action));
Q_EMIT processRenditionAction(static_cast<const RenditionAction *>(action));
} break;
case Action::BackendOpaque: {
d->m_generator->opaqueAction(static_cast<const BackendOpaqueAction *>(action));
@ -4317,7 +4317,7 @@ void Document::processFormatAction(const Action *action, Okular::FormFieldText *
// It will set the QLineEdit to this formattedText
fft->setText(formattedText);
fft->setAppearanceText(formattedText);
emit refreshFormWidget(fft);
Q_EMIT refreshFormWidget(fft);
d->refreshPixmaps(foundPage);
// Then we make the form have the unformatted text, to use
// in calculations and other things.
@ -4327,7 +4327,7 @@ void Document::processFormatAction(const Action *action, Okular::FormFieldText *
// if the format script changed nothing. e.g. on error.
// This is because the recalculateForms function delegated
// the responsiblity for the refresh to us.
emit refreshFormWidget(fft);
Q_EMIT refreshFormWidget(fft);
d->refreshPixmaps(foundPage);
}
}
@ -4355,7 +4355,7 @@ void Document::processKeystrokeAction(const Action *action, Okular::FormFieldTex
if (event->returnCode()) {
fft->setText(newValue.toString());
} else {
emit refreshFormWidget(fft);
Q_EMIT refreshFormWidget(fft);
}
}
@ -4450,7 +4450,7 @@ void Document::processSourceReference(const SourceReference *ref)
}
bool handled = false;
emit sourceReferenceActivated(absFileName, ref->row(), ref->column(), &handled);
Q_EMIT sourceReferenceActivated(absFileName, ref->row(), ref->column(), &handled);
if (handled) {
return;
}
@ -5245,7 +5245,7 @@ QByteArray Document::requestSignedRevisionData(const Okular::SignatureInfo &info
{
QFile f(d->m_docFileName);
if (!f.open(QIODevice::ReadOnly)) {
emit error(i18n("Could not open '%1'. File does not exist", d->m_docFileName), -1);
Q_EMIT error(i18n("Could not open '%1'. File does not exist", d->m_docFileName), -1);
return {};
}

View File

@ -398,14 +398,14 @@ void EditAnnotationContentsCommand::undo()
{
moveViewportIfBoundingRectNotFullyVisible(m_annotation->boundingRectangle(), m_docPriv, m_pageNumber);
m_docPriv->performSetAnnotationContents(m_prevContents, m_annotation, m_pageNumber);
emit m_docPriv->m_parent->annotationContentsChangedByUndoRedo(m_annotation, m_prevContents, m_prevCursorPos, m_prevAnchorPos);
Q_EMIT m_docPriv->m_parent->annotationContentsChangedByUndoRedo(m_annotation, m_prevContents, m_prevCursorPos, m_prevAnchorPos);
}
void EditAnnotationContentsCommand::redo()
{
moveViewportIfBoundingRectNotFullyVisible(m_annotation->boundingRectangle(), m_docPriv, m_pageNumber);
m_docPriv->performSetAnnotationContents(m_newContents, m_annotation, m_pageNumber);
emit m_docPriv->m_parent->annotationContentsChangedByUndoRedo(m_annotation, m_newContents, m_newCursorPos, m_newCursorPos);
Q_EMIT m_docPriv->m_parent->annotationContentsChangedByUndoRedo(m_annotation, m_newContents, m_newCursorPos, m_newCursorPos);
}
int EditAnnotationContentsCommand::id() const
@ -447,7 +447,7 @@ void EditFormTextCommand::undo()
{
moveViewportIfBoundingRectNotFullyVisible(m_form->rect(), m_docPriv, m_pageNumber);
m_form->setText(m_prevContents);
emit m_docPriv->m_parent->formTextChangedByUndoRedo(m_pageNumber, m_form, m_prevContents, m_prevCursorPos, m_prevAnchorPos);
Q_EMIT m_docPriv->m_parent->formTextChangedByUndoRedo(m_pageNumber, m_form, m_prevContents, m_prevCursorPos, m_prevAnchorPos);
m_docPriv->notifyFormChanges(m_pageNumber);
}
@ -455,7 +455,7 @@ void EditFormTextCommand::redo()
{
moveViewportIfBoundingRectNotFullyVisible(m_form->rect(), m_docPriv, m_pageNumber);
m_form->setText(m_newContents);
emit m_docPriv->m_parent->formTextChangedByUndoRedo(m_pageNumber, m_form, m_newContents, m_newCursorPos, m_newCursorPos);
Q_EMIT m_docPriv->m_parent->formTextChangedByUndoRedo(m_pageNumber, m_form, m_newContents, m_newCursorPos, m_newCursorPos);
m_docPriv->notifyFormChanges(m_pageNumber);
}
@ -496,7 +496,7 @@ void EditFormListCommand::undo()
{
moveViewportIfBoundingRectNotFullyVisible(m_form->rect(), m_docPriv, m_pageNumber);
m_form->setCurrentChoices(m_prevChoices);
emit m_docPriv->m_parent->formListChangedByUndoRedo(m_pageNumber, m_form, m_prevChoices);
Q_EMIT m_docPriv->m_parent->formListChangedByUndoRedo(m_pageNumber, m_form, m_prevChoices);
m_docPriv->notifyFormChanges(m_pageNumber);
}
@ -504,7 +504,7 @@ void EditFormListCommand::redo()
{
moveViewportIfBoundingRectNotFullyVisible(m_form->rect(), m_docPriv, m_pageNumber);
m_form->setCurrentChoices(m_newChoices);
emit m_docPriv->m_parent->formListChangedByUndoRedo(m_pageNumber, m_form, m_newChoices);
Q_EMIT m_docPriv->m_parent->formListChangedByUndoRedo(m_pageNumber, m_form, m_newChoices);
m_docPriv->notifyFormChanges(m_pageNumber);
}
@ -545,7 +545,7 @@ void EditFormComboCommand::undo()
m_form->setEditChoice(m_prevContents);
}
moveViewportIfBoundingRectNotFullyVisible(m_form->rect(), m_docPriv, m_pageNumber);
emit m_docPriv->m_parent->formComboChangedByUndoRedo(m_pageNumber, m_form, m_prevContents, m_prevCursorPos, m_prevAnchorPos);
Q_EMIT m_docPriv->m_parent->formComboChangedByUndoRedo(m_pageNumber, m_form, m_prevContents, m_prevCursorPos, m_prevAnchorPos);
m_docPriv->notifyFormChanges(m_pageNumber);
}
@ -557,7 +557,7 @@ void EditFormComboCommand::redo()
m_form->setEditChoice(m_newContents);
}
moveViewportIfBoundingRectNotFullyVisible(m_form->rect(), m_docPriv, m_pageNumber);
emit m_docPriv->m_parent->formComboChangedByUndoRedo(m_pageNumber, m_form, m_newContents, m_newCursorPos, m_newCursorPos);
Q_EMIT m_docPriv->m_parent->formComboChangedByUndoRedo(m_pageNumber, m_form, m_newContents, m_newCursorPos, m_newCursorPos);
m_docPriv->notifyFormChanges(m_pageNumber);
}
@ -613,7 +613,7 @@ void EditFormButtonsCommand::undo()
Okular::NormalizedRect boundingRect = buildBoundingRectangleForButtons(m_formButtons);
moveViewportIfBoundingRectNotFullyVisible(boundingRect, m_docPriv, m_pageNumber);
emit m_docPriv->m_parent->formButtonsChangedByUndoRedo(m_pageNumber, m_formButtons);
Q_EMIT m_docPriv->m_parent->formButtonsChangedByUndoRedo(m_pageNumber, m_formButtons);
m_docPriv->notifyFormChanges(m_pageNumber);
}
@ -629,7 +629,7 @@ void EditFormButtonsCommand::redo()
Okular::NormalizedRect boundingRect = buildBoundingRectangleForButtons(m_formButtons);
moveViewportIfBoundingRectNotFullyVisible(boundingRect, m_docPriv, m_pageNumber);
emit m_docPriv->m_parent->formButtonsChangedByUndoRedo(m_pageNumber, m_formButtons);
Q_EMIT m_docPriv->m_parent->formButtonsChangedByUndoRedo(m_pageNumber, m_formButtons);
m_docPriv->notifyFormChanges(m_pageNumber);
}

View File

@ -160,8 +160,8 @@ void FontExtractionThread::run()
for (int i = -1; i < mNumOfPages && mGoOn; ++i) {
const FontInfo::List list = mGenerator->fontsForPage(i);
for (const FontInfo &fi : list) {
emit gotFont(fi);
Q_EMIT gotFont(fi);
}
emit progress(i);
Q_EMIT progress(i);
}
}

View File

@ -36,6 +36,6 @@ void PageController::imageRotationDone(const ThreadWeaver::JobPointer &j)
if (job->page()) {
job->page()->imageRotationDone(job);
emit rotationFinished(job->page()->m_number, job->page()->m_page);
Q_EMIT rotationFinished(job->page()->m_number, job->page()->m_page);
}
}

View File

@ -42,7 +42,7 @@ static void updateField(FormField *field)
Document *doc = PagePrivate::get(page)->m_doc->m_parent;
const int pageNumber = page->number();
QTimer::singleShot(0, doc, [doc, pageNumber] { doc->refreshPixmaps(pageNumber); });
emit doc->refreshFormWidget(field);
Q_EMIT doc->refreshFormWidget(field);
} else {
qWarning() << "Could not get page of field" << field;
}

View File

@ -258,7 +258,7 @@ void CHMGenerator::generatePixmap(Okular::PixmapRequest *request)
m_chmUrl = url;
m_syncGen->view()->resizeContents(requestWidth, requestHeight);
m_request = request;
// will emit openURL without problems
// will Q_EMIT openURL without problems
m_syncGen->openUrl(QUrl(pAddress));
}

View File

@ -85,7 +85,7 @@ bool EBookSearch::generateIndex(EBook *ebookFile, QDataStream &stream)
QList<QUrl> documents;
QList<QUrl> alldocuments;
emit progressStep(0, QStringLiteral("Generating the list of documents"));
Q_EMIT progressStep(0, QStringLiteral("Generating the list of documents"));
processEvents();
// Enumerate the documents
@ -128,7 +128,7 @@ void EBookSearch::cancelIndexGeneration()
void EBookSearch::updateProgress(int value, const QString &stepName)
{
emit progressStep(value, stepName);
Q_EMIT progressStep(value, stepName);
}
void EBookSearch::processEvents()

View File

@ -108,11 +108,11 @@ bool Index::makeIndex(const QList<QUrl> &docs, EBook *chmFile)
if (i % steps == 0) {
prog++;
prog = qMin(prog, 99);
emit indexingProgress(prog, tr("Processing document %1").arg((*it).path()));
Q_EMIT indexingProgress(prog, tr("Processing document %1").arg((*it).path()));
}
}
emit indexingProgress(100, tr("Processing completed"));
Q_EMIT indexingProgress(100, tr("Processing completed"));
return true;
}

View File

@ -37,7 +37,7 @@ bool ComicBookGenerator::loadDocument(const QString &fileName, QVector<Okular::P
if (!mDocument.open(fileName)) {
const QString errString = mDocument.lastErrorString();
if (!errString.isEmpty()) {
emit error(errString, -1);
Q_EMIT error(errString, -1);
}
return false;
}

View File

@ -200,7 +200,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap *page)
}
if (errorMsg.isEmpty() != true) {
emit error(i18n("File corruption. %1", errorMsg), -1);
Q_EMIT error(i18n("File corruption. %1", errorMsg), -1);
errorMsg.clear();
currentlyDrawnPage = nullptr;
return;
@ -323,10 +323,10 @@ void dviRenderer::embedPostScript()
embedPS_progress = nullptr;
if (!errorMsg.isEmpty()) {
emit warning(i18n("Not all PostScript files could be embedded into your document. %1", errorMsg), -1);
Q_EMIT warning(i18n("Not all PostScript files could be embedded into your document. %1", errorMsg), -1);
errorMsg.clear();
} else {
emit notice(i18n("All external PostScript files were embedded into your document."), -1);
Q_EMIT notice(i18n("All external PostScript files were embedded into your document."), -1);
}
// Prescan phase starts here
@ -416,7 +416,7 @@ bool dviRenderer::setFile(const QString &fname, const QUrl &base)
// Make sure the file actually exists.
if (!fi.exists() || fi.isDir()) {
emit error(i18n("The specified file '%1' does not exist.", filename), -1);
Q_EMIT error(i18n("The specified file '%1' does not exist.", filename), -1);
return false;
}
@ -432,7 +432,7 @@ bool dviRenderer::setFile(const QString &fname, const QUrl &base)
if ((dviFile_new->dvi_Data() == nullptr) || (dviFile_new->errorMsg.isEmpty() != true)) {
QApplication::restoreOverrideCursor();
if (dviFile_new->errorMsg.isEmpty() != true) {
emit error(i18n("File corruption. %1", dviFile_new->errorMsg), -1);
Q_EMIT error(i18n("File corruption. %1", dviFile_new->errorMsg), -1);
}
delete dviFile_new;
return false;
@ -562,12 +562,12 @@ Anchor dviRenderer::parseReference(const QString &reference)
QString refFileName = splitter.filePath();
if (sourceHyperLinkAnchors.isEmpty()) {
emit warning(i18n("You have asked Okular to locate the place in the DVI file which corresponds to "
"line %1 in the TeX-file %2. It seems, however, that the DVI file "
"does not contain the necessary source file information. ",
refLineNumber,
refFileName),
-1);
Q_EMIT warning(i18n("You have asked Okular to locate the place in the DVI file which corresponds to "
"line %1 in the TeX-file %2. It seems, however, that the DVI file "
"does not contain the necessary source file information. ",
refLineNumber,
refFileName),
-1);
return Anchor();
}
@ -601,11 +601,11 @@ Anchor dviRenderer::parseReference(const QString &reference)
if (bestMatch != sourceHyperLinkAnchors.end()) {
return Anchor(bestMatch->page, bestMatch->distance_from_top);
} else if (anchorForRefFileFound == false) {
emit warning(i18n("Okular was not able to locate the place in the DVI file which corresponds to "
"line %1 in the TeX-file %2.",
refLineNumber,
refFileName),
-1);
Q_EMIT warning(i18n("Okular was not able to locate the place in the DVI file which corresponds to "
"line %1 in the TeX-file %2.",
refLineNumber,
refFileName),
-1);
} else {
return Anchor();
}

View File

@ -457,7 +457,7 @@ void dviRenderer::prescan_ParsePSFileSpecial(const QString &cp)
QString convErrorMsg;
EPSfilename = dviFile->convertPDFtoPS(EPSfilename, &convErrorMsg);
if (convErrorMsg.isEmpty() != true) {
emit error(convErrorMsg, -1);
Q_EMIT error(convErrorMsg, -1);
return;
}
}

View File

@ -91,7 +91,7 @@ void DVIExport::abort_process_impl()
void DVIExport::finished_impl(int exit_code)
{
if (process_ && exit_code != 0) {
emit error(error_message_, -1);
Q_EMIT error(error_message_, -1);
}
// Remove this from the store of all export processes.
parent_->m_eventLoop->exit(exit_code);
@ -120,15 +120,15 @@ DVIExportToPDF::DVIExportToPDF(dviRenderer &parent, const QString &output_name)
}
if (QStandardPaths::findExecutable(QStringLiteral("dvipdfm")).isEmpty()) {
emit error(i18n("<qt><p>Okular could not locate the program <em>dvipdfm</em> on your computer. This program is "
"essential for the export function to work. You can, however, convert "
"the DVI-file to PDF using the print function of Okular, but that will often "
"produce documents which print okay, but are of inferior quality if viewed in "
"Acrobat Reader. It may be wise to upgrade to a more recent version of your "
"TeX distribution which includes the <em>dvipdfm</em> program.</p>"
"<p>Hint to the perplexed system administrator: Okular uses the PATH environment variable "
"when looking for programs.</p></qt>"),
-1);
Q_EMIT error(i18n("<qt><p>Okular could not locate the program <em>dvipdfm</em> on your computer. This program is "
"essential for the export function to work. You can, however, convert "
"the DVI-file to PDF using the print function of Okular, but that will often "
"produce documents which print okay, but are of inferior quality if viewed in "
"Acrobat Reader. It may be wise to upgrade to a more recent version of your "
"TeX distribution which includes the <em>dvipdfm</em> program.</p>"
"<p>Hint to the perplexed system administrator: Okular uses the PATH environment variable "
"when looking for programs.</p></qt>"),
-1);
return;
}
@ -165,19 +165,19 @@ DVIExportToPS::DVIExportToPS(dviRenderer &parent, const QString &output_name, co
}
if (dvi.numberOfExternalNONPSFiles != 0) {
emit error(i18n("<qt>This DVI file refers to external graphic files which are not in PostScript format, and cannot be handled by the "
"<em>dvips</em> program that Okular uses internally to print or to export to PostScript. The functionality that "
"you require is therefore unavailable in this version of Okular.</qt>"),
-1);
Q_EMIT error(i18n("<qt>This DVI file refers to external graphic files which are not in PostScript format, and cannot be handled by the "
"<em>dvips</em> program that Okular uses internally to print or to export to PostScript. The functionality that "
"you require is therefore unavailable in this version of Okular.</qt>"),
-1);
return;
}
if (QStandardPaths::findExecutable(QStringLiteral("dvips")).isEmpty()) {
emit error(i18n("<qt><p>Okular could not locate the program <em>dvips</em> on your computer. "
"That program is essential for the export function to work.</p>"
"<p>Hint to the perplexed system administrator: Okular uses the PATH environment "
"variable when looking for programs.</p></qt>"),
-1);
Q_EMIT error(i18n("<qt><p>Okular could not locate the program <em>dvips</em> on your computer. "
"That program is essential for the export function to work.</p>"
"<p>Hint to the perplexed system administrator: Okular uses the PATH environment "
"variable when looking for programs.</p></qt>"),
-1);
return;
}

View File

@ -206,14 +206,14 @@ void fontPool::locateFonts()
// present an error message to the user.
if (!areFontsLocated()) {
markFontsAsLocated();
emit error(i18n("<qt><p>Okular was not able to locate all the font files "
"which are necessary to display the current DVI file. "
"Your document might be unreadable.</p>"
"<p><small><b>PATH:</b> %1</small></p>"
"<p><small>%2</small></p></qt>",
QString::fromLocal8Bit(qgetenv("PATH")),
kpsewhichOutput.replace(QLatin1String("\n"), QLatin1String("<br/>"))),
-1);
Q_EMIT error(i18n("<qt><p>Okular was not able to locate all the font files "
"which are necessary to display the current DVI file. "
"Your document might be unreadable.</p>"
"<p><small><b>PATH:</b> %1</small></p>"
"<p><small>%2</small></p></qt>",
QString::fromLocal8Bit(qgetenv("PATH")),
kpsewhichOutput.replace(QLatin1String("\n"), QLatin1String("<br/>"))),
-1);
}
}
@ -281,15 +281,15 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
kpsewhich_->start(kpsewhichFullPath, kpsewhich_args, QIODevice::ReadOnly | QIODevice::Text);
if (!kpsewhich_->waitForStarted()) {
QApplication::restoreOverrideCursor();
emit error(i18n("<qt><p>There were problems running <em>kpsewhich</em>. As a result, "
"some font files could not be located, and your document might be unreadable.<br/>"
"Possible reason: the <em>kpsewhich</em> program is perhaps not installed on your system, "
"or it cannot be found in the current search path.</p>"
"<p><small><b>PATH:</b> %1</small></p>"
"<p><small>%2</small></p></qt>",
QString::fromLocal8Bit(qgetenv("PATH")),
kpsewhichOutput.replace(QLatin1String("\n"), QLatin1String("<br/>"))),
-1);
Q_EMIT error(i18n("<qt><p>There were problems running <em>kpsewhich</em>. As a result, "
"some font files could not be located, and your document might be unreadable.<br/>"
"Possible reason: the <em>kpsewhich</em> program is perhaps not installed on your system, "
"or it cannot be found in the current search path.</p>"
"<p><small><b>PATH:</b> %1</small></p>"
"<p><small>%2</small></p></qt>",
QString::fromLocal8Bit(qgetenv("PATH")),
kpsewhichOutput.replace(QLatin1String("\n"), QLatin1String("<br/>"))),
-1);
// This makes sure the we don't try to run kpsewhich again
markFontsAsLocated();
@ -302,11 +302,11 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
// Handle fatal errors.
int const kpsewhich_exit_code = kpsewhich_->exitCode();
if (kpsewhich_exit_code < 0) {
emit warning(i18n("<qt>The font generation by <em>kpsewhich</em> was aborted (exit code %1, error %2). As a "
"result, some font files could not be located, and your document might be unreadable.</qt>",
kpsewhich_exit_code,
kpsewhich_->errorString()),
-1);
Q_EMIT warning(i18n("<qt>The font generation by <em>kpsewhich</em> was aborted (exit code %1, error %2). As a "
"result, some font files could not be located, and your document might be unreadable.</qt>",
kpsewhich_exit_code,
kpsewhich_->errorString()),
-1);
// This makes sure the we don't try to run kpsewhich again
if (makePK == false) {
@ -404,7 +404,7 @@ void fontPool::setDisplayResolution(double _displayResolution_in_dpi)
// Do something that causes re-rendering of the dvi-window
/*@@@@
emit fonts_have_been_loaded(this);
Q_EMIT fonts_have_been_loaded(this);
*/
}
@ -478,7 +478,7 @@ void fontPool::mf_output_receiver()
int secondblank = startLine.lastIndexOf(QLatin1Char(' '), lastblank - 1);
QString dpi = startLine.mid(secondblank + 1, lastblank - secondblank - 1);
emit warning(i18n("Currently generating %1 at %2 dpi...", fontName, dpi), -1);
Q_EMIT warning(i18n("Currently generating %1 at %2 dpi...", fontName, dpi), -1);
}
MetafontOutput = MetafontOutput.remove(0, numleft + 1);
}

View File

@ -67,7 +67,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);
Q_EMIT sizeChanged(*this);
return true;
}
}
@ -85,7 +85,7 @@ bool pageSize::setPageSize(const QString &name)
rectifySizes();
reconstructCurrentSize();
emit sizeChanged(*this);
Q_EMIT sizeChanged(*this);
return true;
}
}
@ -103,7 +103,7 @@ bool pageSize::setPageSize(const QString &name)
rectifySizes();
reconstructCurrentSize();
emit sizeChanged(*this);
Q_EMIT sizeChanged(*this);
return true;
}
}
@ -114,7 +114,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);
Q_EMIT sizeChanged(*this);
return false;
}
@ -128,7 +128,7 @@ void pageSize::setPageSize(double width, double height)
rectifySizes();
reconstructCurrentSize();
if (!isNearlyEqual(oldPage)) {
emit sizeChanged(*this);
Q_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);
Q_EMIT sizeChanged(*this);
}
}
@ -287,7 +287,7 @@ void pageSize::setOrientation(int orient)
pageWidth.setLength_in_mm(staticList[currentSize].width);
pageHeight.setLength_in_mm(staticList[currentSize].height);
}
emit sizeChanged(*this);
Q_EMIT sizeChanged(*this);
}
QString pageSize::serialize() const

View File

@ -282,10 +282,10 @@ void ghostscript_interface::gs_generate_graphics_file(const quint16 page, const
gsDevice = knownDevices.begin();
if (knownDevices.isEmpty()) {
// TODO: show a requestor of some sort.
emit error(i18n("The version of Ghostview that is installed on this computer does not contain "
"any of the Ghostview device drivers that are known to Okular. PostScript "
"support has therefore been turned off in Okular."),
-1);
Q_EMIT error(i18n("The version of Ghostview that is installed on this computer does not contain "
"any of the Ghostview device drivers that are known to Okular. PostScript "
"support has therefore been turned off in Okular."),
-1);
} else {
qCDebug(OkularDviDebug) << QStringLiteral("Okular will now try to use the '%1' device driver.").arg(*gsDevice);
gs_generate_graphics_file(page, filename, magnification);

View File

@ -48,7 +48,7 @@ QString _strPack(char **str, int size)
return res;
}
// emit data wrap function that map between epub metadata to okular's
// Q_EMIT data wrap function that map between epub metadata to okular's
void Converter::_emitData(Okular::DocumentInfo::Key key, enum epub_metadata type)
{
int size;
@ -57,7 +57,7 @@ void Converter::_emitData(Okular::DocumentInfo::Key key, enum epub_metadata type
data = epub_get_metadata(mTextDocument->getEpub(), type, &size);
if (data) {
emit addMetaData(key, _strPack((char **)data, size));
Q_EMIT addMetaData(key, _strPack((char **)data, size));
for (int i = 0; i < size; i++) {
free(data[i]);
}
@ -107,7 +107,7 @@ void Converter::_handle_anchors(const QTextBlock &start, const QString &name)
} else { // Outside document link
Okular::BrowseAction *action = new Okular::BrowseAction(QUrl(href.toString()));
emit addAction(action, frag.position(), frag.position() + frag.length());
Q_EMIT addAction(action, frag.position(), frag.position() + frag.length());
}
}
@ -160,7 +160,7 @@ QTextDocument *Converter::convert(const QString &fileName)
{
EpubDocument *newDocument = new EpubDocument(fileName, generator()->generalSettings()->font());
if (!newDocument->isValid()) {
emit error(i18n("Error while opening the EPub document."), -1);
Q_EMIT error(i18n("Error while opening the EPub document."), -1);
delete newDocument;
return nullptr;
}
@ -182,7 +182,7 @@ QTextDocument *Converter::convert(const QString &fileName)
_emitData(Okular::DocumentInfo::CreationDate, EPUB_DATE);
_emitData(Okular::DocumentInfo::Category, EPUB_TYPE);
_emitData(Okular::DocumentInfo::Copyright, EPUB_RIGHTS);
emit addMetaData(Okular::DocumentInfo::MimeType, QStringLiteral("application/epub+zip"));
Q_EMIT addMetaData(Okular::DocumentInfo::MimeType, QStringLiteral("application/epub+zip"));
struct eiterator *it;
@ -325,7 +325,7 @@ QTextDocument *Converter::convert(const QString &fileName)
const int posEnd = csr.position();
const QRect videoRect(startPoint, videoSize);
movieAnnots[index]->setBoundingRectangle(Okular::NormalizedRect(videoRect, mTextDocument->pageSize().width(), mTextDocument->pageSize().height()));
emit addAnnotation(movieAnnots[index++], posStart, posEnd);
Q_EMIT addAnnotation(movieAnnots[index++], posStart, posEnd);
csr.movePosition(QTextCursor::NextWord);
}
@ -339,7 +339,7 @@ QTextDocument *Converter::convert(const QString &fileName)
const int posEnd = csr.position();
qDebug() << posStart << posEnd;
;
emit addAction(soundActions[index++], posStart, posEnd);
Q_EMIT addAction(soundActions[index++], posStart, posEnd);
csr.movePosition(QTextCursor::NextWord);
}
@ -414,7 +414,7 @@ QTextDocument *Converter::convert(const QString &fileName)
}
if (block.isValid()) { // be sure we actually got a block
emit addTitle(epub_tit_get_curr_depth(tit), QString::fromUtf8(label), block);
Q_EMIT addTitle(epub_tit_get_curr_depth(tit), QString::fromUtf8(label), block);
} else {
qDebug() << "Error: no block found for" << link;
}
@ -446,7 +446,7 @@ QTextDocument *Converter::convert(const QString &fileName)
Okular::GotoAction *action = new Okular::GotoAction(QString(), viewport);
emit addAction(action, hit.value()[i].first, hit.value()[i].second);
Q_EMIT addAction(action, hit.value()[i].first, hit.value()[i].second);
} else {
qDebug() << "Error: no block found for " << hit.key();
}

View File

@ -39,7 +39,7 @@ bool FaxGenerator::loadDocument(const QString &fileName, QVector<Okular::Page *>
FaxDocument faxDocument(fileName, m_type);
if (!faxDocument.load()) {
emit error(i18n("Unable to load document"), -1);
Q_EMIT error(i18n("Unable to load document"), -1);
return false;
}

View File

@ -66,7 +66,7 @@ QTextDocument *Converter::convert(const QString &fileName)
{
Document fbDocument(fileName);
if (!fbDocument.open()) {
emit error(fbDocument.lastErrorString(), -1);
Q_EMIT error(fbDocument.lastErrorString(), -1);
return nullptr;
}
@ -95,7 +95,7 @@ QTextDocument *Converter::convert(const QString &fileName)
const QDomElement documentElement = document.documentElement();
if (documentElement.tagName() != QLatin1String("FictionBook")) {
emit error(i18n("Document is not a valid FictionBook"), -1);
Q_EMIT error(i18n("Document is not a valid FictionBook"), -1);
delete mCursor;
return nullptr;
}
@ -190,25 +190,25 @@ QTextDocument *Converter::convert(const QString &fileName)
*/
if (mTitleInfo) {
if (!mTitleInfo->mTitle.isEmpty()) {
emit addMetaData(Okular::DocumentInfo::Title, mTitleInfo->mTitle);
Q_EMIT addMetaData(Okular::DocumentInfo::Title, mTitleInfo->mTitle);
}
if (!mTitleInfo->mAuthor.isEmpty()) {
emit addMetaData(Okular::DocumentInfo::Author, mTitleInfo->mAuthor);
Q_EMIT addMetaData(Okular::DocumentInfo::Author, mTitleInfo->mAuthor);
}
if (!mTitleInfo->mKeywords.isEmpty()) {
emit addMetaData(Okular::DocumentInfo::Keywords, mTitleInfo->mKeywords);
Q_EMIT addMetaData(Okular::DocumentInfo::Keywords, mTitleInfo->mKeywords);
}
}
if (mDocumentInfo) {
if (!mDocumentInfo->mProducer.isEmpty()) {
emit addMetaData(Okular::DocumentInfo::Producer, mDocumentInfo->mProducer);
Q_EMIT addMetaData(Okular::DocumentInfo::Producer, mDocumentInfo->mProducer);
}
if (mDocumentInfo->mDate.isValid()) {
emit addMetaData(Okular::DocumentInfo::CreationDate, QLocale().toString(mDocumentInfo->mDate, QLocale::ShortFormat));
Q_EMIT addMetaData(Okular::DocumentInfo::CreationDate, QLocale().toString(mDocumentInfo->mDate, QLocale::ShortFormat));
}
}
@ -225,7 +225,7 @@ QTextDocument *Converter::convert(const QString &fileName)
Okular::GotoAction *action = new Okular::GotoAction(QString(), viewport);
emit addAction(action, it.value().first, it.value().second);
Q_EMIT addAction(action, it.value().first, it.value().second);
}
delete mCursor;
@ -554,7 +554,7 @@ bool Converter::convertTitle(const QDomElement &element)
mCursor->setCharFormat(origFormat);
emit addTitle(mSectionCounter, child.text(), mCursor->block());
Q_EMIT addTitle(mSectionCounter, child.text(), mCursor->block());
} else if (child.tagName() == QLatin1String("empty-line")) {
if (!convertEmptyLine(child)) {
@ -936,7 +936,7 @@ bool Converter::convertLink(const QDomElement &element)
} else {
// external link
Okular::BrowseAction *action = new Okular::BrowseAction(QUrl(href));
emit addAction(action, startPosition, endPosition);
Q_EMIT addAction(action, startPosition, endPosition);
}
return true;

View File

@ -52,7 +52,7 @@ bool KIMGIOGenerator::loadDocument(const QString &fileName, QVector<Okular::Page
{
QFile f(fileName);
if (!f.open(QFile::ReadOnly)) {
emit error(i18n("Unable to load document: %1", f.errorString()), -1);
Q_EMIT error(i18n("Unable to load document: %1", f.errorString()), -1);
return false;
}
return loadDocumentInternal(f.readAll(), fileName, pagesVector);
@ -73,9 +73,9 @@ bool KIMGIOGenerator::loadDocumentInternal(const QByteArray &fileData, const QSt
reader.setAutoDetectImageFormat(true);
if (!reader.read(&m_img)) {
if (!m_img.isNull()) {
emit warning(i18n("This document appears malformed. Here is a best approximation of the document's intended appearance."), -1);
Q_EMIT warning(i18n("This document appears malformed. Here is a best approximation of the document's intended appearance."), -1);
} else {
emit error(i18n("Unable to load document: %1", reader.errorString()), -1);
Q_EMIT error(i18n("Unable to load document: %1", reader.errorString()), -1);
return false;
}
}

View File

@ -59,7 +59,7 @@ QTextDocument *Converter::convert(const QString &fileName)
{
m_markdownFile = fopen(fileName.toLocal8Bit(), "rb");
if (!m_markdownFile) {
emit error(i18n("Failed to open the document"), -1);
Q_EMIT error(i18n("Failed to open the document"), -1);
return nullptr;
}
@ -75,7 +75,7 @@ QTextDocument *Converter::convert(const QString &fileName)
if (anchorIt != documentAnchors.constEnd()) {
const Okular::DocumentViewport viewport = calculateViewport(doc, anchorIt.value());
Okular::GotoAction *action = new Okular::GotoAction(QString(), viewport);
emit addAction(action, linkIt.value().position(), linkIt.value().position() + linkIt.value().length());
Q_EMIT addAction(action, linkIt.value().position(), linkIt.value().position() + linkIt.value().length());
} else {
qDebug() << "Could not find destination for" << linkIt.key();
}
@ -100,7 +100,7 @@ QTextDocument *Converter::convertOpenFile()
flags |= MKD_NOPANTS;
}
if (!mkd_compile(markdownHandle, flags)) {
emit error(i18n("Failed to compile the Markdown document."), -1);
Q_EMIT error(i18n("Failed to compile the Markdown document."), -1);
return nullptr;
}
@ -155,7 +155,7 @@ void Converter::extractLinks(const QTextBlock &parent, QHash<QString, QTextFragm
internalLinks.insert(href.mid(1), textFragment);
} else {
Okular::BrowseAction *action = new Okular::BrowseAction(QUrl(textCharFormat.anchorHref()));
emit addAction(action, textFragment.position(), textFragment.position() + textFragment.length());
Q_EMIT addAction(action, textFragment.position(), textFragment.position() + textFragment.length());
}
const QStringList anchorNames = textCharFormat.anchorNames();

View File

@ -34,19 +34,19 @@ void Converter::handleMetadata(const QMap<Mobipocket::Document::MetaKey, QString
it.next();
switch (it.key()) {
case Mobipocket::Document::Title:
emit addMetaData(Okular::DocumentInfo::Title, it.value());
Q_EMIT addMetaData(Okular::DocumentInfo::Title, it.value());
break;
case Mobipocket::Document::Author:
emit addMetaData(Okular::DocumentInfo::Author, it.value());
Q_EMIT addMetaData(Okular::DocumentInfo::Author, it.value());
break;
case Mobipocket::Document::Description:
emit addMetaData(Okular::DocumentInfo::Description, it.value());
Q_EMIT addMetaData(Okular::DocumentInfo::Description, it.value());
break;
case Mobipocket::Document::Subject:
emit addMetaData(Okular::DocumentInfo::Subject, it.value());
Q_EMIT addMetaData(Okular::DocumentInfo::Subject, it.value());
break;
case Mobipocket::Document::Copyright:
emit addMetaData(Okular::DocumentInfo::Copyright, it.value());
Q_EMIT addMetaData(Okular::DocumentInfo::Copyright, it.value());
break;
}
}
@ -56,12 +56,12 @@ QTextDocument *Converter::convert(const QString &fileName)
{
MobiDocument *newDocument = new MobiDocument(fileName);
if (!newDocument->mobi()->isValid()) {
emit error(i18n("Error while opening the Mobipocket document."), -1);
Q_EMIT error(i18n("Error while opening the Mobipocket document."), -1);
delete newDocument;
return nullptr;
}
if (newDocument->mobi()->hasDRM()) {
emit error(i18n("This book is protected by DRM and can be displayed only on designated device"), -1);
Q_EMIT error(i18n("This book is protected by DRM and can be displayed only on designated device"), -1);
delete newDocument;
return nullptr;
}
@ -105,13 +105,13 @@ QTextDocument *Converter::convert(const QString &fileName)
QUrl u(it.key());
// external or internal link
if (!u.isRelative()) {
emit addAction(new Okular::BrowseAction(QUrl(it.key())), it.value().first, it.value().second);
Q_EMIT addAction(new Okular::BrowseAction(QUrl(it.key())), it.value().first, it.value().second);
} else {
// is there valid target?
if (!targets.contains(it.key()) || !targets[it.key()].isValid()) {
continue;
}
emit addAction(new Okular::GotoAction(QString(), calculateViewport(newDocument, targets[it.key()])), it.value().first, it.value().second);
Q_EMIT addAction(new Okular::GotoAction(QString(), calculateViewport(newDocument, targets[it.key()])), it.value().first, it.value().second);
}
}

View File

@ -2077,7 +2077,7 @@ void PDFGenerator::xrefReconstructionHandler()
if (!xrefReconstructed) {
qCDebug(OkularPdfDebug) << "XRef Table of the document has been reconstructed";
xrefReconstructed = true;
emit warning(i18n("Some errors were found in the document, Okular might not be able to show the content correctly"), 5000);
Q_EMIT warning(i18n("Some errors were found in the document, Okular might not be able to show the content correctly"), 5000);
}
}

View File

@ -117,7 +117,7 @@ void GSRendererThread::run()
delete image;
image = new QImage(aux);
}
emit imageDone(image, req.request);
Q_EMIT imageDone(image, req.request);
spectre_page_free(req.spectrePage);
}

View File

@ -32,7 +32,7 @@ QTextDocument *Converter::convert(const QString &fileName)
QTextFrame *rootFrame = textDocument->rootFrame();
rootFrame->setFrameFormat(frameFormat);
emit addMetaData(Okular::DocumentInfo::MimeType, QStringLiteral("text/plain"));
Q_EMIT addMetaData(Okular::DocumentInfo::MimeType, QStringLiteral("text/plain"));
return textDocument;
}

View File

@ -126,7 +126,7 @@ void SignatureModelPrivate::notifySetup(const QVector<Okular::Page *> &pages, in
if (pages.isEmpty()) {
q->endResetModel();
emit q->countChanged();
Q_EMIT q->countChanged();
return;
}
@ -170,7 +170,7 @@ void SignatureModelPrivate::notifySetup(const QVector<Okular::Page *> &pages, in
}
}
q->endResetModel();
emit q->countChanged();
Q_EMIT q->countChanged();
}
QModelIndex SignatureModelPrivate::indexForItem(SignatureItem *item) const

View File

@ -134,7 +134,7 @@ void TOCModelPrivate::addChildren(const QDomNode &parentNode, TOCItem *parentIte
}
n = n.nextSibling();
emit q->countChanged();
Q_EMIT q->countChanged();
}
}
@ -333,10 +333,10 @@ void TOCModel::fill(const Okular::DocumentSynopsis *toc)
}
clear();
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
d->addChildren(*toc, d->root);
d->dirty = true;
emit layoutChanged();
Q_EMIT layoutChanged();
if (equals(d->m_oldModel)) {
for (const QModelIndex &oldIndex : qAsConst(d->m_oldTocExpandedIndexes)) {
const QModelIndex index = indexForIndex(oldIndex, this);
@ -387,7 +387,7 @@ void TOCModel::setCurrentViewport(const Okular::DocumentViewport &viewport)
}
item->highlight = false;
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
}
d->currentPage.clear();
@ -403,7 +403,7 @@ void TOCModel::setCurrentViewport(const Okular::DocumentViewport &viewport)
}
item->highlight = true;
emit dataChanged(index, index);
Q_EMIT dataChanged(index, index);
}
}

View File

@ -73,22 +73,22 @@ void DocumentItem::setUrl(const QUrl &url)
for (uint i = 0; i < m_document->pages(); ++i) {
m_matchingPages << (int)i;
}
emit matchingPagesChanged();
emit urlChanged();
emit pageCountChanged();
emit openedChanged();
emit supportsSearchingChanged();
emit windowTitleForDocumentChanged();
emit bookmarkedPagesChanged();
Q_EMIT matchingPagesChanged();
Q_EMIT urlChanged();
Q_EMIT pageCountChanged();
Q_EMIT openedChanged();
Q_EMIT supportsSearchingChanged();
Q_EMIT windowTitleForDocumentChanged();
Q_EMIT bookmarkedPagesChanged();
KMessageWidget::MessageType messageType;
QString message;
std::tie(messageType, message) = SignatureGuiUtils::documentSignatureMessageWidgetText(m_document);
if (!message.isEmpty()) {
if (messageType == KMessageWidget::Information) {
emit notice(message, -1);
Q_EMIT notice(message, -1);
} else if (messageType == KMessageWidget::Warning) {
emit warning(message, -1);
Q_EMIT warning(message, -1);
} else {
qWarning() << "Unexpected message type" << messageType;
}
@ -121,7 +121,7 @@ void DocumentItem::setCurrentPage(int page)
{
m_document->setViewportPage(page);
m_tocModel->setCurrentViewport(m_document->viewport());
emit currentPageChanged();
Q_EMIT currentPageChanged();
}
int DocumentItem::currentPage() const
@ -205,7 +205,7 @@ void DocumentItem::searchText(const QString &text)
if (!m_searchInProgress) {
m_searchInProgress = true;
emit searchInProgressChanged();
Q_EMIT searchInProgressChanged();
}
}
@ -218,10 +218,10 @@ void DocumentItem::resetSearch()
}
if (m_searchInProgress) {
m_searchInProgress = false;
emit searchInProgressChanged();
Q_EMIT searchInProgressChanged();
}
emit matchingPagesChanged();
Q_EMIT matchingPagesChanged();
}
Okular::Document *DocumentItem::document()
@ -264,9 +264,9 @@ void DocumentItem::searchFinished(int id, Okular::Document::SearchStatus endStat
if (m_searchInProgress) {
m_searchInProgress = false;
emit searchInProgressChanged();
Q_EMIT searchInProgressChanged();
}
emit matchingPagesChanged();
Q_EMIT matchingPagesChanged();
}
// Observer
@ -284,5 +284,5 @@ Observer::~Observer()
void Observer::notifyPageChanged(int page, int flags)
{
emit pageChanged(page, flags);
Q_EMIT pageChanged(page, flags);
}

View File

@ -74,7 +74,7 @@ void PageItem::setFlickable(QQuickItem *flickable)
connect(flickable, SIGNAL(contentYChanged()), this, SLOT(contentYChanged())); // clazy:exclude=old-style-connect
}
emit flickableChanged();
Q_EMIT flickableChanged();
}
QQuickItem *PageItem::flickable() const
@ -100,7 +100,7 @@ void PageItem::setDocument(DocumentItem *doc)
connect(observer, &Observer::pageChanged, this, &PageItem::pageHasChanged);
connect(doc->document()->bookmarkManager(), &Okular::BookmarkManager::bookmarksChanged, this, &PageItem::checkBookmarksChanged);
setPageNumber(0);
emit documentChanged();
Q_EMIT documentChanged();
m_redrawTimer->start();
connect(doc, &DocumentItem::urlChanged, this, &PageItem::refreshPage);
@ -119,7 +119,7 @@ void PageItem::setPageNumber(int number)
m_viewPort.pageNumber = number;
refreshPage();
emit pageNumberChanged();
Q_EMIT pageNumberChanged();
checkBookmarksChanged();
}
@ -131,8 +131,8 @@ void PageItem::refreshPage()
m_page = nullptr;
}
emit implicitWidthChanged();
emit implicitHeightChanged();
Q_EMIT implicitWidthChanged();
Q_EMIT implicitHeightChanged();
m_redrawTimer->start();
}
@ -174,7 +174,7 @@ void PageItem::setBookmarked(bool bookmarked)
m_documentItem.data()->document()->bookmarkManager()->removeBookmark(m_viewPort.pageNumber);
}
m_bookmarked = bookmarked;
emit bookmarkedChanged();
Q_EMIT bookmarkedChanged();
}
QStringList PageItem::bookmarks() const
@ -222,10 +222,10 @@ void PageItem::setBookmarkAtPos(qreal x, qreal y)
if (!m_bookmarked) {
m_bookmarked = true;
emit bookmarkedChanged();
Q_EMIT bookmarkedChanged();
}
emit bookmarksChanged();
Q_EMIT bookmarksChanged();
}
void PageItem::removeBookmarkAtPos(qreal x, qreal y)
@ -239,16 +239,16 @@ void PageItem::removeBookmarkAtPos(qreal x, qreal y)
if (m_bookmarked && m_documentItem.data()->document()->bookmarkManager()->bookmarks(m_viewPort.pageNumber).count() == 0) {
m_bookmarked = false;
emit bookmarkedChanged();
Q_EMIT bookmarkedChanged();
}
emit bookmarksChanged();
Q_EMIT bookmarksChanged();
}
void PageItem::removeBookmark(const QString &bookmark)
{
m_documentItem.data()->document()->bookmarkManager()->removeBookmark(Okular::DocumentViewport(bookmark));
emit bookmarksChanged();
Q_EMIT bookmarksChanged();
}
// Reimplemented
@ -268,8 +268,8 @@ void PageItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeome
if (changed) {
// Why aren't they automatically emitted?
emit widthChanged();
emit heightChanged();
Q_EMIT widthChanged();
Q_EMIT heightChanged();
}
}
@ -364,11 +364,11 @@ void PageItem::checkBookmarksChanged()
bool newBookmarked = m_documentItem.data()->document()->bookmarkManager()->isBookmarked(m_viewPort.pageNumber);
if (m_bookmarked != newBookmarked) {
m_bookmarked = newBookmarked;
emit bookmarkedChanged();
Q_EMIT bookmarkedChanged();
}
// TODO: check the page
emit bookmarksChanged();
Q_EMIT bookmarksChanged();
}
void PageItem::contentXChanged()

View File

@ -478,7 +478,7 @@ void AnnotationActionHandlerPrivate::selectTool(int toolId)
void AnnotationActionHandlerPrivate::slotStampToolSelected(const QString &stamp)
{
emit q->ephemeralStampWarning();
Q_EMIT q->ephemeralStampWarning();
selectedBuiltinTool = PageViewAnnotator::STAMP_TOOL_ID;
annotator->selectStampTool(stamp); // triggers a reparsing thus calling parseTool
}
@ -486,7 +486,7 @@ void AnnotationActionHandlerPrivate::slotStampToolSelected(const QString &stamp)
void AnnotationActionHandlerPrivate::slotQuickToolSelected(int favToolId)
{
if (isQuickToolStamp(favToolId)) {
emit q->ephemeralStampWarning();
Q_EMIT q->ephemeralStampWarning();
}
annotator->selectQuickTool(favToolId);
selectedBuiltinTool = -1;

View File

@ -238,7 +238,7 @@ void AnnotationModelPrivate::notifyPageChanged(int page, int flags)
// FIXME: for now, update ALL the annotations for that page
for (int i = 0; i < annItem->children.count(); ++i) {
QModelIndex index = indexForItem(annItem->children.at(i));
emit q->dataChanged(index, index);
Q_EMIT q->dataChanged(index, index);
}
}
@ -259,7 +259,7 @@ void AnnotationModelPrivate::rebuildTree(const QVector<Okular::Page *> &pages)
return;
}
emit q->layoutAboutToBeChanged();
Q_EMIT q->layoutAboutToBeChanged();
for (int i = 0; i < pages.count(); ++i) {
const QLinkedList<Okular::Annotation *> annots = filterOutWidgetAnnotations(pages.at(i)->annotations());
if (annots.isEmpty()) {
@ -272,7 +272,7 @@ void AnnotationModelPrivate::rebuildTree(const QVector<Okular::Page *> &pages)
new AnnItem(annItem, *it);
}
}
emit q->layoutChanged();
Q_EMIT q->layoutChanged();
}
AnnItem *AnnotationModelPrivate::findItem(int page, int *index) const

View File

@ -149,7 +149,7 @@ void AnnotationPopup::doRemovePageAnnotation(AnnotPagePair pair)
void AnnotationPopup::doOpenAnnotationWindow(AnnotPagePair pair)
{
emit openAnnotationWindow(pair.annotation, pair.pageNumber);
Q_EMIT openAnnotationWindow(pair.annotation, pair.pageNumber);
}
void AnnotationPopup::doOpenPropertiesDialog(AnnotPagePair pair)

View File

@ -261,7 +261,7 @@ void PageGroupProxyModel::rebuildIndexes()
void PageGroupProxyModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
{
emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
Q_EMIT dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
}
void PageGroupProxyModel::groupByPage(bool value)
@ -662,7 +662,7 @@ void AuthorGroupProxyModel::rebuildIndexes()
void AuthorGroupProxyModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
{
emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
Q_EMIT dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
}
#include "moc_annotationproxymodels.cpp"

View File

@ -148,7 +148,7 @@ void PixmapPreviewSelector::iconComboChanged(const QString &icon)
}
m_iconLabel->setPixmap(pixmap);
emit iconChanged(m_icon);
Q_EMIT iconChanged(m_icon);
}
void PixmapPreviewSelector::selectCustomStamp()

View File

@ -228,9 +228,9 @@ AnnotWindow::AnnotWindow(QWidget *parent, Okular::Annotation *annot, Okular::Doc
lowerlay->addWidget(sb);
m_latexRenderer = new GuiUtils::LatexRenderer();
// The emit below is not wrong even if emitting signals from the constructor it's usually wrong
// The Q_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
Q_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()));
@ -347,7 +347,7 @@ void AnnotWindow::slotUpdateUndoAndRedoInContextMenu(QMenu *menu)
void AnnotWindow::slotOptionBtn()
{
// TODO: call context menu in pageview
// emit sig...
// Q_EMIT sig...
}
void AnnotWindow::slotsaveWindowText()
@ -356,7 +356,7 @@ void AnnotWindow::slotsaveWindowText()
const int cursorPos = textEdit->textCursor().position();
if (contents != m_annot->contents()) {
m_document->editPageAnnotationContents(m_page, m_annot, contents, cursorPos, m_prevCursorPos, m_prevAnchorPos);
emit containsLatex(GuiUtils::LatexRenderer::mightContainLatex(textEdit->toPlainText()));
Q_EMIT containsLatex(GuiUtils::LatexRenderer::mightContainLatex(textEdit->toPlainText()));
}
m_prevCursorPos = cursorPos;
m_prevAnchorPos = textEdit->textCursor().anchor();
@ -424,7 +424,7 @@ void AnnotWindow::slotHandleContentsChangedByUndoRedo(Okular::Annotation *annot,
m_prevAnchorPos = anchorPos;
textEdit->setTextCursor(c);
textEdit->setFocus();
emit containsLatex(GuiUtils::LatexRenderer::mightContainLatex(m_annot->contents()));
Q_EMIT containsLatex(GuiUtils::LatexRenderer::mightContainLatex(m_annot->contents()));
}
#include "annotwindow.moc"

View File

@ -155,7 +155,7 @@ PreferredScreenSelector::PreferredScreenSelector(QWidget *parent)
// KConfigWidgets setup:
setProperty("kcfg_property", QByteArray("preferredScreen"));
connect(this, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) { emit preferredScreenChanged(index - k_specialScreenCount); });
connect(this, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) { Q_EMIT preferredScreenChanged(index - k_specialScreenCount); });
}
void PreferredScreenSelector::repopulateList()

View File

@ -122,9 +122,9 @@ void DrawingToolActions::actionTriggered()
}
}
emit changeEngine(action->property("__document").value<QDomElement>());
Q_EMIT changeEngine(action->property("__document").value<QDomElement>());
} else {
emit changeEngine(QDomElement());
Q_EMIT changeEngine(QDomElement());
}
}
}

View File

@ -19,7 +19,7 @@ BrowserExtension::BrowserExtension(Part *parent)
: KParts::BrowserExtension(parent)
, m_part(parent)
{
emit enableAction("print", true);
Q_EMIT enableAction("print", true);
setURLDropHandlingEnabled(true);
}
@ -84,7 +84,7 @@ QString OkularLiveConnectExtension::eval(const QString &script)
args.append(qMakePair(KParts::LiveConnectExtension::TypeString, script));
m_evalRes.clear();
m_inEval = true;
emit partEvent(0, QStringLiteral("eval"), args);
Q_EMIT partEvent(0, QStringLiteral("eval"), args);
m_inEval = false;
return m_evalRes;
}

View File

@ -99,7 +99,7 @@ bool FindBar::eventFilter(QObject *target, QEvent *event)
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_PageUp || keyEvent->key() == Qt::Key_PageDown) {
emit forwardKeyPressEvent(keyEvent);
Q_EMIT forwardKeyPressEvent(keyEvent);
return true;
}
}
@ -188,7 +188,7 @@ void FindBar::closeAndStopSearch()
if (m_search->lineEdit()->isSearchRunning()) {
m_search->lineEdit()->stopSearch();
}
emit onCloseButtonPressed();
Q_EMIT onCloseButtonPressed();
close();
}

View File

@ -35,7 +35,7 @@ FormWidgetsController::FormWidgetsController(Okular::Document *doc)
: QObject(doc)
, m_doc(doc)
{
// emit changed signal when a form has changed
// Q_EMIT changed signal when a form has changed
connect(this, &FormWidgetsController::formTextChangedByUndoRedo, this, &FormWidgetsController::changed);
connect(this, &FormWidgetsController::formListChangedByUndoRedo, this, &FormWidgetsController::changed);
connect(this, &FormWidgetsController::formComboChangedByUndoRedo, this, &FormWidgetsController::changed);
@ -70,14 +70,14 @@ FormWidgetsController::~FormWidgetsController()
void FormWidgetsController::signalAction(Okular::Action *a)
{
emit action(a);
Q_EMIT action(a);
}
void FormWidgetsController::processScriptAction(Okular::Action *a, Okular::FormField *field, Okular::Annotation::AdditionalActionType type)
{
// If it's not a Action Script or if the field is not a FormText, handle it normally
if (a->actionType() != Okular::Action::Script || field->type() != Okular::FormField::FormText) {
emit action(a);
Q_EMIT action(a);
return;
}
switch (type) {
@ -91,7 +91,7 @@ void FormWidgetsController::processScriptAction(Okular::Action *a, Okular::FormF
case Okular::Annotation::CursorLeaving:
case Okular::Annotation::MousePressed:
case Okular::Annotation::MouseReleased:
emit action(a);
Q_EMIT action(a);
}
}
@ -195,7 +195,7 @@ void FormWidgetsController::slotButtonClicked(QAbstractButton *button)
prevChecked.append(formButton->state());
}
if (checked != prevChecked) {
emit formButtonsChangedByWidget(pageNumber, formButtons, checked);
Q_EMIT formButtonsChangedByWidget(pageNumber, formButtons, checked);
}
if (check) {
// The formButtonsChangedByWidget signal changes the value of the underlying
@ -212,7 +212,7 @@ void FormWidgetsController::slotFormButtonsChangedByUndoRedo(int pageNumber, con
QAbstractButton *button = m_buttons[id];
CheckBoxEdit *check = qobject_cast<CheckBoxEdit *>(button);
if (check) {
emit refreshFormWidget(check->formField());
Q_EMIT refreshFormWidget(check->formField());
}
// temporarily disable exclusiveness of the button group
// since it breaks doing/redoing steps into which all the checkboxes
@ -224,7 +224,7 @@ void FormWidgetsController::slotFormButtonsChangedByUndoRedo(int pageNumber, con
button->group()->setExclusive(wasExclusive);
button->setFocus();
}
emit changed(pageNumber);
Q_EMIT changed(pageNumber);
}
Okular::Document *FormWidgetsController::document() const
@ -485,10 +485,10 @@ bool FormLineEdit::event(QEvent *e)
if (e->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(e);
if (keyEvent == QKeySequence::Undo) {
emit m_controller->requestUndo();
Q_EMIT m_controller->requestUndo();
return true;
} else if (keyEvent == QKeySequence::Redo) {
emit m_controller->requestRedo();
Q_EMIT m_controller->requestRedo();
return true;
}
} else if (e->type() == QEvent::FocusIn) {
@ -568,7 +568,7 @@ void FormLineEdit::slotChanged()
m_controller->document()->processKeystrokeAction(form->additionalAction(Okular::FormField::FieldModified), form, text());
}
emit m_controller->formTextChangedByWidget(pageItem()->pageNumber(), form, text(), cursorPos, m_prevCursorPos, m_prevAnchorPos);
Q_EMIT m_controller->formTextChangedByWidget(pageItem()->pageNumber(), form, text(), cursorPos, m_prevCursorPos, m_prevAnchorPos);
}
m_prevCursorPos = cursorPos;
@ -641,10 +641,10 @@ bool TextAreaEdit::event(QEvent *e)
if (e->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(e);
if (keyEvent == QKeySequence::Undo) {
emit m_controller->requestUndo();
Q_EMIT m_controller->requestUndo();
return true;
} else if (keyEvent == QKeySequence::Redo) {
emit m_controller->requestRedo();
Q_EMIT m_controller->requestRedo();
return true;
}
} else if (e->type() == QEvent::FocusIn) {
@ -726,7 +726,7 @@ void TextAreaEdit::slotChanged()
m_controller->document()->processKeystrokeAction(form->additionalAction(Okular::FormField::FieldModified), form, toPlainText());
}
emit m_controller->formTextChangedByWidget(pageItem()->pageNumber(), form, toPlainText(), cursorPos, m_prevCursorPos, m_prevAnchorPos);
Q_EMIT m_controller->formTextChangedByWidget(pageItem()->pageNumber(), form, toPlainText(), cursorPos, m_prevCursorPos, m_prevAnchorPos);
}
m_prevCursorPos = cursorPos;
m_prevAnchorPos = textCursor().anchor();
@ -772,10 +772,10 @@ bool FileEdit::eventFilter(QObject *obj, QEvent *event)
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent == QKeySequence::Undo) {
emit m_controller->requestUndo();
Q_EMIT m_controller->requestUndo();
return true;
} else if (keyEvent == QKeySequence::Redo) {
emit m_controller->requestRedo();
Q_EMIT m_controller->requestRedo();
return true;
}
} else if (event->type() == QEvent::ContextMenu) {
@ -823,7 +823,7 @@ void FileEdit::slotChanged()
QString contents = text();
int cursorPos = lineEdit()->cursorPosition();
if (contents != form->text()) {
emit m_controller->formTextChangedByWidget(pageItem()->pageNumber(), form, contents, cursorPos, m_prevCursorPos, m_prevAnchorPos);
Q_EMIT m_controller->formTextChangedByWidget(pageItem()->pageNumber(), form, contents, cursorPos, m_prevCursorPos, m_prevAnchorPos);
}
m_prevCursorPos = cursorPos;
@ -895,7 +895,7 @@ void ListEdit::slotSelectionChanged()
}
Okular::FormFieldChoice *form = static_cast<Okular::FormFieldChoice *>(m_ff);
if (rows != form->currentChoices()) {
emit m_controller->formListChangedByWidget(pageItem()->pageNumber(), form, rows);
Q_EMIT m_controller->formListChangedByWidget(pageItem()->pageNumber(), form, rows);
}
}
@ -964,7 +964,7 @@ void ComboEdit::slotValueChanged()
int cursorPos = lineEdit()->cursorPosition();
if (text != prevText) {
emit m_controller->formComboChangedByWidget(pageItem()->pageNumber(), form, currentText(), cursorPos, m_prevCursorPos, m_prevAnchorPos);
Q_EMIT m_controller->formComboChangedByWidget(pageItem()->pageNumber(), form, currentText(), cursorPos, m_prevCursorPos, m_prevAnchorPos);
}
prevText = text;
m_prevCursorPos = cursorPos;
@ -1043,10 +1043,10 @@ bool ComboEdit::event(QEvent *e)
if (e->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(e);
if (keyEvent == QKeySequence::Undo) {
emit m_controller->requestUndo();
Q_EMIT m_controller->requestUndo();
return true;
} else if (keyEvent == QKeySequence::Redo) {
emit m_controller->requestRedo();
Q_EMIT m_controller->requestRedo();
return true;
}
}

View File

@ -216,7 +216,7 @@ void KTreeViewSearchLine::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity
if (d->caseSensitive != caseSensitivity) {
d->caseSensitive = caseSensitivity;
updateSearch();
emit searchOptionsChanged();
Q_EMIT searchOptionsChanged();
}
}
@ -225,7 +225,7 @@ void KTreeViewSearchLine::setRegularExpression(bool value)
if (d->regularExpression != value) {
d->regularExpression = value;
updateSearch();
emit searchOptionsChanged();
Q_EMIT searchOptionsChanged();
}
}

View File

@ -62,11 +62,11 @@ void Layers::notifySetup(const QVector<Okular::Page *> & /*pages*/, int /*setupF
if (layersModel) {
m_treeView->setModel(layersModel);
m_searchLine->setTreeView(m_treeView);
emit hasLayers(true);
Q_EMIT hasLayers(true);
connect(layersModel, &QAbstractItemModel::dataChanged, m_document, &Okular::Document::reloadDocument);
connect(layersModel, &QAbstractItemModel::dataChanged, m_pageView, &PageView::reloadForms);
} else {
emit hasLayers(false);
Q_EMIT hasLayers(false);
}
}

View File

@ -247,7 +247,7 @@ bool MiniBar::eventFilter(QObject *target, QEvent *event)
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
int key = keyEvent->key();
if (key == Qt::Key_PageUp || key == Qt::Key_PageDown || key == Qt::Key_Up || key == Qt::Key_Down) {
emit forwardKeyPressEvent(keyEvent);
Q_EMIT forwardKeyPressEvent(keyEvent);
return true;
}
}
@ -277,14 +277,14 @@ void MiniBar::slotChangePage(int pageNumber)
void MiniBar::slotEmitNextPage()
{
// emit signal
emit nextPage();
// Q_EMIT signal
Q_EMIT nextPage();
}
void MiniBar::slotEmitPrevPage()
{
// emit signal
emit prevPage();
// Q_EMIT signal
Q_EMIT prevPage();
}
void MiniBar::slotToolBarIconSizeChanged()
@ -373,9 +373,9 @@ void ProgressWidget::mousePressEvent(QMouseEvent *e)
void ProgressWidget::wheelEvent(QWheelEvent *e)
{
if (e->angleDelta().y() > 0) {
emit nextPage();
Q_EMIT nextPage();
} else {
emit prevPage();
Q_EMIT prevPage();
}
}
@ -449,7 +449,7 @@ void PageLabelEdit::pageChosen()
const QString newInput = text();
const int pageNumber = m_labelPageMap.value(newInput, -1);
if (pageNumber != -1) {
emit pageNumberChosen(pageNumber);
Q_EMIT pageNumberChosen(pageNumber);
} else {
setText(m_lastLabel);
}

View File

@ -2117,7 +2117,7 @@ void PageView::keyPressEvent(QKeyEvent *e)
}
break;
case Qt::Key_Escape:
emit escPressed();
Q_EMIT escPressed();
selectionClear(d->tableDividersGuessed ? ClearOnlyDividers : ClearAllSelection);
d->mousePressPos = QPoint();
if (d->aPrevAction) {
@ -2378,11 +2378,11 @@ void PageView::mousePressEvent(QMouseEvent *e)
// trigger history navigation for additional mouse buttons
if (e->button() == Qt::XButton1) {
emit mouseBackButtonClick();
Q_EMIT mouseBackButtonClick();
return;
}
if (e->button() == Qt::XButton2) {
emit mouseForwardButtonClick();
Q_EMIT mouseForwardButtonClick();
return;
}
@ -2558,7 +2558,7 @@ void PageView::mouseReleaseEvent(QMouseEvent *e)
if (d->items.isEmpty()) {
// ..except for right Clicks (emitted even it viewport is empty)
if (e->button() == Qt::RightButton) {
emit rightClick(nullptr, e->globalPos());
Q_EMIT rightClick(nullptr, e->globalPos());
}
return;
}
@ -2665,13 +2665,13 @@ void PageView::mouseReleaseEvent(QMouseEvent *e)
} else {
// right click (if not within 5 px of the press point, the mode
// had been already changed to 'Selection' instead of 'Normal')
emit rightClick(pageItem->page(), e->globalPos());
Q_EMIT rightClick(pageItem->page(), e->globalPos());
}
}
} else {
// right click (if not within 5 px of the press point, the mode
// had been already changed to 'Selection' instead of 'Normal')
emit rightClick(pageItem ? pageItem->page() : nullptr, e->globalPos());
Q_EMIT rightClick(pageItem ? pageItem->page() : nullptr, e->globalPos());
}
}
} break;
@ -2779,7 +2779,7 @@ void PageView::mouseReleaseEvent(QMouseEvent *e)
// if mouse is released and selection is null this is a rightClick
if (rightButton && !d->mouseSelecting) {
PageViewItem *pageItem = pickItemOnPoint(eventPos.x(), eventPos.y());
emit rightClick(pageItem ? pageItem->page() : nullptr, e->globalPos());
Q_EMIT rightClick(pageItem ? pageItem->page() : nullptr, e->globalPos());
break;
}
@ -2934,7 +2934,7 @@ void PageView::mouseReleaseEvent(QMouseEvent *e)
// if mouse is released and selection is null this is a rightClick
if (rightButton && !d->mouseSelecting) {
PageViewItem *pageItem = pickItemOnPoint(eventPos.x(), eventPos.y());
emit rightClick(pageItem ? pageItem->page() : nullptr, e->globalPos());
Q_EMIT rightClick(pageItem ? pageItem->page() : nullptr, e->globalPos());
break;
}
@ -5454,7 +5454,7 @@ void PageView::slotFitWindowToPage()
if (horizontalScrollBar()->isVisible()) {
viewportSize.setHeight(viewportSize.height() + horizontalScrollBar()->height());
}
emit fitWindowToPage(viewportSize, pageSize);
Q_EMIT fitWindowToPage(viewportSize, pageSize);
}
void PageView::slotSelectPage()

View File

@ -1036,7 +1036,7 @@ QRect PageViewAnnotator::performRouteMouseOrTabletEvent(const AnnotatorEngine::E
if (!newFilePath.isEmpty()) {
const bool success = static_cast<PickPointEngineSignature *>(m_engine)->sign(newFilePath);
if (success) {
emit requestOpenFile(newFilePath, m_lockedItem->pageNumber() + 1);
Q_EMIT requestOpenFile(newFilePath, m_lockedItem->pageNumber() + 1);
} else {
KMessageBox::error(m_pageView, i18nc("%1 is a file path", "Could not sign. Invalid certificate password or could not write to '%1'", newFilePath));
}
@ -1198,7 +1198,7 @@ void PageViewAnnotator::selectTool(AnnotationTools *toolsDefinition, int toolId,
if (toolId == -1) {
m_pageView->displayMessage(QString());
m_pageView->updateCursor();
emit toolActive(false);
Q_EMIT toolActive(false);
return;
}
@ -1269,7 +1269,7 @@ void PageViewAnnotator::selectTool(AnnotationTools *toolsDefinition, int toolId,
m_pageView->updateCursor();
}
emit toolActive(true);
Q_EMIT toolActive(true);
}
void PageViewAnnotator::selectLastTool()

View File

@ -1137,7 +1137,7 @@ void Part::setModified(bool modified)
void Part::slotHandleActivatedSourceReference(const QString &absFileName, int line, int col, bool *handled)
{
emit openSourceReference(absFileName, line, col);
Q_EMIT openSourceReference(absFileName, line, col);
if (m_embedMode == Okular::ViewerWidgetMode) {
*handled = true;
}
@ -1163,8 +1163,8 @@ void Part::openUrlFromDocument(const QUrl &url)
}
}
emit m_bExtension->openUrlNotify();
emit m_bExtension->setLocationBarUrl(url.toDisplayString());
Q_EMIT m_bExtension->openUrlNotify();
Q_EMIT m_bExtension->setLocationBarUrl(url.toDisplayString());
openUrl(url);
}
@ -1196,7 +1196,7 @@ void Part::handleDroppedUrls(const QList<QUrl> &urls)
return;
}
emit urlsDropped(urls);
Q_EMIT urlsDropped(urls);
}
void Part::slotJobStarted(KIO::Job *job)
@ -1218,7 +1218,7 @@ void Part::slotJobFinished(KJob *job)
void Part::loadCancelled(const QString &reason)
{
emit setWindowCaption(QString());
Q_EMIT setWindowCaption(QString());
resetStartArguments();
// when m_viewportDirty.pageNumber != -1 we come from slotAttemptReload
@ -1246,7 +1246,7 @@ void Part::setWindowTitleFromDocument()
}
}
emit setWindowCaption(title);
Q_EMIT setWindowCaption(title);
}
KConfigDialog *Part::slotGeneratorPreferences()
@ -1583,11 +1583,11 @@ bool Part::openFile()
}
bool canSearch = m_document->supportsSearching();
emit mimeTypeChanged(mime);
Q_EMIT mimeTypeChanged(mime);
// update one-time actions
const bool ok = openResult == Document::OpenSuccess;
emit enableCloseAction(ok);
Q_EMIT enableCloseAction(ok);
m_find->setEnabled(ok && canSearch);
m_findNext->setEnabled(ok && canSearch);
m_findPrev->setEnabled(ok && canSearch);
@ -1597,7 +1597,7 @@ bool Part::openFile()
if (m_saveAs) {
m_saveAs->setEnabled(ok && !(isstdin || mime.inherits(QStringLiteral("inode/directory"))));
}
emit enablePrintAction(ok && m_document->printingSupport() != Okular::Document::NoPrinting);
Q_EMIT enablePrintAction(ok && m_document->printingSupport() != Okular::Document::NoPrinting);
m_printPreview->setEnabled(ok && m_document->printingSupport() != Okular::Document::NoPrinting);
m_showProperties->setEnabled(ok);
if (m_openContainingFolder) {
@ -1900,7 +1900,7 @@ bool Part::closeUrl(bool promptToSave)
}
slotHidePresentation();
emit enableCloseAction(false);
Q_EMIT enableCloseAction(false);
m_find->setEnabled(false);
m_findNext->setEnabled(false);
m_findPrev->setEnabled(false);
@ -1940,8 +1940,8 @@ bool Part::closeUrl(bool promptToSave)
if (m_showPresentation) {
m_showPresentation->setEnabled(false);
}
emit setWindowCaption(QLatin1String(""));
emit enablePrintAction(false);
Q_EMIT setWindowCaption(QLatin1String(""));
Q_EMIT enablePrintAction(false);
m_realUrl = QUrl();
if (url().isLocalFile()) {
unsetFileToWatch();
@ -2134,7 +2134,7 @@ bool Part::slotAttemptReload(bool oneShot, const QUrl &newUrl)
if (m_wasPresentationOpen) {
slotShowPresentation();
}
emit enablePrintAction(true && m_document->printingSupport() != Okular::Document::NoPrinting);
Q_EMIT enablePrintAction(true && m_document->printingSupport() != Okular::Document::NoPrinting);
reloadSucceeded = true;
} else if (!oneShot) {
@ -2235,7 +2235,7 @@ void Part::updateViewActions()
menu->setEnabled(opened);
}
}
emit viewerMenuStateChange(opened);
Q_EMIT viewerMenuStateChange(opened);
updateBookmarksActions();
}
@ -3499,7 +3499,7 @@ void Part::slotPrint()
printer.setFullPage(optionWidget->ignorePrintMargins());
} else {
// printConfigurationWidget() method should always return an object of type Okular::PrintOptionsWidget,
// (signature does not (yet) require it for ABI stability reasons), so emit a warning if the object is of another type
// (signature does not (yet) require it for ABI stability reasons), so Q_EMIT a warning if the object is of another type
qWarning() << "printConfigurationWidget() method did not return an Okular::PrintOptionsWidget. This is strongly discouraged!";
}

View File

@ -157,7 +157,7 @@ void SearchLineEdit::findNext()
}
if (!m_changed) {
emit searchStarted();
Q_EMIT searchStarted();
m_searchRunning = true;
m_document->continueSearch(m_id, m_searchType);
} else {
@ -172,7 +172,7 @@ void SearchLineEdit::findPrev()
}
if (!m_changed) {
emit searchStarted();
Q_EMIT searchStarted();
m_searchRunning = true;
m_document->continueSearch(m_id, m_searchType);
} else {
@ -237,7 +237,7 @@ void SearchLineEdit::startSearch()
// search text if have more than 3 chars or else clear search
QString thistext = text();
if (thistext.length() >= qMax(m_minLength, 1)) {
emit searchStarted();
Q_EMIT searchStarted();
m_searchRunning = true;
m_document->searchText(m_id, thistext, m_fromStart, m_caseSensitivity, m_searchType, m_moveViewport, m_color);
} else {
@ -268,7 +268,7 @@ void SearchLineEdit::searchFinished(int id, Okular::Document::SearchStatus endSt
}
m_searchRunning = false;
emit searchStopped();
Q_EMIT searchStopped();
}
SearchLineWidget::SearchLineWidget(QWidget *parent, Okular::Document *document)

View File

@ -188,5 +188,5 @@ void Sidebar::dragEnterEvent(QDragEnterEvent *event)
void Sidebar::dropEvent(QDropEvent *event)
{
const QList<QUrl> list = KUrlMimeData::urlsFromMimeData(event->mimeData());
emit urlsDropped(list);
Q_EMIT urlsDropped(list);
}

View File

@ -127,7 +127,7 @@ void SignaturePanel::notifySetup(const QVector<Okular::Page *> & /*pages*/, int
Q_D(SignaturePanel);
const QVector<const Okular::FormFieldSignature *> signatureForms = SignatureGuiUtils::getSignatureFormFields(d->m_document);
emit documentHasSignatures(!signatureForms.isEmpty());
Q_EMIT documentHasSignatures(!signatureForms.isEmpty());
}
SignaturePanel::~SignaturePanel()

View File

@ -117,7 +117,7 @@ void signUnsignedSignature(const Okular::FormFieldSignature *form, PageView *pag
if (!newFilePath.isEmpty()) {
const bool success = form->sign(data, newFilePath);
if (success) {
emit pageView->requestOpenFile(newFilePath, form->page()->number() + 1);
Q_EMIT pageView->requestOpenFile(newFilePath, form->page()->number() + 1);
} else {
KMessageBox::error(pageView, i18nc("%1 is a file path", "Could not sign. Invalid certificate password or could not write to '%1'", newFilePath));
}

View File

@ -34,7 +34,7 @@ void SnapshotTaker::stateChanged(Phonon::State newState, Phonon::State)
if (newState == Phonon::PlayingState) {
const QImage image = m_player->videoWidget()->snapshot();
if (!image.isNull()) {
emit finished(image);
Q_EMIT finished(image);
}
m_player->stop();

View File

@ -943,7 +943,7 @@ void ThumbnailListPrivate::contextMenuEvent(QContextMenuEvent *e)
{
const ThumbnailWidget *item = itemFor(e->pos());
if (item) {
emit q->rightClick(item->page(), e->globalPos());
Q_EMIT q->rightClick(item->page(), e->globalPos());
}
}

View File

@ -81,12 +81,12 @@ void TOC::notifySetup(const QVector<Okular::Page *> & /*pages*/, int setupFlags)
// Make sure we clear the reload old model data
m_model->setOldModelData(nullptr, QVector<QModelIndex>());
}
emit hasTOC(false);
Q_EMIT hasTOC(false);
return;
}
m_model->fill(syn);
emit hasTOC(!m_model->isEmpty());
Q_EMIT hasTOC(!m_model->isEmpty());
}
void TOC::notifyCurrentPageChanged(int, int)
@ -186,7 +186,7 @@ void TOC::contextMenuEvent(QContextMenuEvent *e)
Okular::DocumentViewport viewport = m_model->viewportForIndex(index);
emit rightClick(viewport, e->globalPos(), m_model->data(index).toString());
Q_EMIT rightClick(viewport, e->globalPos(), m_model->data(index).toString());
}
void TOC::expandRecursively()

View File

@ -91,14 +91,14 @@ void OkularTTS::pauseResumeSpeech()
void OkularTTS::slotSpeechStateChanged(QTextToSpeech::State state)
{
if (state == QTextToSpeech::Speaking) {
emit isSpeaking(true);
emit canPauseOrResume(true);
Q_EMIT isSpeaking(true);
Q_EMIT canPauseOrResume(true);
} else {
emit isSpeaking(false);
Q_EMIT isSpeaking(false);
if (state == QTextToSpeech::Paused) {
emit canPauseOrResume(true);
Q_EMIT canPauseOrResume(true);
} else {
emit canPauseOrResume(false);
Q_EMIT canPauseOrResume(false);
}
}
}

View File

@ -137,7 +137,7 @@ void WidgetAnnotTools::slotEdit()
m_list->setCurrentItem(listEntry);
m_list->scrollToItem(listEntry);
updateButtons();
emit changed();
Q_EMIT changed();
}
void WidgetAnnotTools::slotAdd()
@ -169,5 +169,5 @@ void WidgetAnnotTools::slotAdd()
m_list->setCurrentItem(listEntry);
m_list->scrollToItem(listEntry);
updateButtons();
emit changed();
Q_EMIT changed();
}

View File

@ -76,7 +76,7 @@ void WidgetConfigurationToolsBase::slotRemove()
const int row = m_list->currentRow();
delete m_list->takeItem(row);
updateButtons();
emit changed();
Q_EMIT changed();
}
void WidgetConfigurationToolsBase::slotMoveUp()
@ -85,7 +85,7 @@ void WidgetConfigurationToolsBase::slotMoveUp()
m_list->insertItem(row, m_list->takeItem(row - 1));
m_list->scrollToItem(m_list->currentItem());
updateButtons();
emit changed();
Q_EMIT changed();
}
void WidgetConfigurationToolsBase::slotMoveDown()
@ -94,5 +94,5 @@ void WidgetConfigurationToolsBase::slotMoveDown()
m_list->insertItem(row, m_list->takeItem(row + 1));
m_list->scrollToItem(m_list->currentItem());
updateButtons();
emit changed();
Q_EMIT changed();
}

View File

@ -155,7 +155,7 @@ void WidgetDrawingTools::slotAdd()
m_list->setCurrentItem(listEntry);
m_list->scrollToItem(listEntry);
updateButtons();
emit changed();
Q_EMIT changed();
}
void WidgetDrawingTools::slotEdit()
@ -199,5 +199,5 @@ void WidgetDrawingTools::slotEdit()
m_list->setCurrentItem(listEntry);
m_list->scrollToItem(listEntry);
updateButtons();
emit changed();
Q_EMIT changed();
}

View File

@ -908,7 +908,7 @@ void Shell::slotFitWindowToPage(const QSize pageViewSize, const QSize pageSize)
const int yOffset = pageViewSize.height() - pageSize.height();
showNormal();
resize(width() - xOffset, height() - yOffset);
emit moveSplitter(pageSize.width());
Q_EMIT moveSplitter(pageSize.width());
}
void Shell::hideWelcomeScreen()