mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-29 20:54:45 +00:00
clang-tidy: Enable google-explicit-constructor
This commit is contained in:
parent
a225fb6d9a
commit
0c659a5466
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-loop-convert,modernize-use-nullptr,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings,-bugprone-suspicious-include,-bugprone-reserved-identifier,-performance-no-automatic-move,-bugprone-suspicious-enum-usage'
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-loop-convert,modernize-use-nullptr,google-explicit-constructor,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings,-bugprone-suspicious-include,-bugprone-reserved-identifier,-performance-no-automatic-move,-bugprone-suspicious-enum-usage'
|
||||
WarningsAsErrors: '*'
|
||||
HeaderFilterRegex: '.*/okular/.*'
|
||||
AnalyzeTemporaryDtors: false
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
CloseDialogHelper(QWidget *w, QDialogButtonBox::StandardButton b);
|
||||
|
||||
// Close a modal dialog, which may not be associated to any other widget
|
||||
CloseDialogHelper(QDialogButtonBox::StandardButton b);
|
||||
explicit CloseDialogHelper(QDialogButtonBox::StandardButton b);
|
||||
|
||||
~CloseDialogHelper() override;
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ class ClosePrintDialogHelper : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClosePrintDialogHelper(int expectedTab)
|
||||
explicit ClosePrintDialogHelper(int expectedTab)
|
||||
: foundDialog(false)
|
||||
, m_expectedTab(expectedTab)
|
||||
{
|
||||
|
|
|
@ -1888,12 +1888,12 @@ void PartTest::testForwardBackwardNavigation()
|
|||
const int targetPageA = 15;
|
||||
part.m_document->setViewportPage(targetPageA);
|
||||
|
||||
QVERIFY(part.m_document->viewport() == targetPageA);
|
||||
QVERIFY(part.m_document->viewport() == DocumentViewport(targetPageA));
|
||||
|
||||
// Go to some other page
|
||||
const int targetPageB = 25;
|
||||
part.m_document->setViewportPage(targetPageB);
|
||||
QVERIFY(part.m_document->viewport() == targetPageB);
|
||||
QVERIFY(part.m_document->viewport() == DocumentViewport(targetPageB));
|
||||
|
||||
// Go back to page A
|
||||
QVERIFY(QMetaObject::invokeMethod(&part, "slotHistoryBack"));
|
||||
|
|
|
@ -202,7 +202,7 @@ QString ExecuteAction::parameters() const
|
|||
class Okular::BrowseActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
BrowseActionPrivate(const QUrl &url)
|
||||
explicit BrowseActionPrivate(const QUrl &url)
|
||||
: ActionPrivate()
|
||||
, m_url(url)
|
||||
{
|
||||
|
@ -247,7 +247,7 @@ QUrl BrowseAction::url() const
|
|||
class Okular::DocumentActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
DocumentActionPrivate(enum DocumentAction::DocumentActionType documentActionType)
|
||||
explicit DocumentActionPrivate(enum DocumentAction::DocumentActionType documentActionType)
|
||||
: ActionPrivate()
|
||||
, m_type(documentActionType)
|
||||
{
|
||||
|
@ -443,7 +443,7 @@ QString ScriptAction::script() const
|
|||
class Okular::MovieActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
MovieActionPrivate(MovieAction::OperationType operation)
|
||||
explicit MovieActionPrivate(MovieAction::OperationType operation)
|
||||
: ActionPrivate()
|
||||
, m_operation(operation)
|
||||
, m_annotation(nullptr)
|
||||
|
|
|
@ -111,7 +111,7 @@ public:
|
|||
|
||||
protected:
|
||||
/// @cond PRIVATE
|
||||
Action(ActionPrivate &dd);
|
||||
explicit Action(ActionPrivate &dd);
|
||||
Q_DECLARE_PRIVATE(Action)
|
||||
ActionPrivate *d_ptr;
|
||||
/// @endcond
|
||||
|
|
|
@ -675,7 +675,7 @@ public:
|
|||
|
||||
protected:
|
||||
/// @cond PRIVATE
|
||||
Annotation(AnnotationPrivate &dd);
|
||||
explicit Annotation(AnnotationPrivate &dd);
|
||||
Annotation(AnnotationPrivate &dd, const QDomNode &description);
|
||||
Q_DECLARE_PRIVATE(Annotation)
|
||||
AnnotationPrivate *d_ptr;
|
||||
|
|
|
@ -108,7 +108,7 @@ static QUrl mostCanonicalUrl(const QUrl &url)
|
|||
class BookmarkManager::Private : public KBookmarkOwner
|
||||
{
|
||||
public:
|
||||
Private(BookmarkManager *qq)
|
||||
explicit Private(BookmarkManager *qq)
|
||||
: KBookmarkOwner()
|
||||
, q(qq)
|
||||
, document(nullptr)
|
||||
|
|
|
@ -194,7 +194,7 @@ private:
|
|||
friend class Document;
|
||||
friend class DocumentPrivate;
|
||||
|
||||
BookmarkManager(DocumentPrivate *document);
|
||||
explicit BookmarkManager(DocumentPrivate *document);
|
||||
|
||||
void setUrl(const QUrl &url);
|
||||
bool setPageBookmark(int page);
|
||||
|
|
|
@ -1304,12 +1304,12 @@ public:
|
|||
/**
|
||||
* Creates a new viewport for the given page @p number.
|
||||
*/
|
||||
DocumentViewport(int number = -1);
|
||||
explicit DocumentViewport(int number = -1);
|
||||
|
||||
/**
|
||||
* Creates a new viewport from the given @p xmlDesc.
|
||||
*/
|
||||
DocumentViewport(const QString &xmlDesc);
|
||||
explicit DocumentViewport(const QString &xmlDesc);
|
||||
|
||||
/**
|
||||
* Returns the viewport as xml description.
|
||||
|
@ -1391,7 +1391,7 @@ public:
|
|||
* Creates a new document synopsis object with the given
|
||||
* @p document as parent node.
|
||||
*/
|
||||
DocumentSynopsis(const QDomDocument &document);
|
||||
explicit DocumentSynopsis(const QDomDocument &document);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -159,7 +159,7 @@ public:
|
|||
|
||||
protected:
|
||||
/// @cond PRIVATE
|
||||
FormField(FormFieldPrivate &dd);
|
||||
explicit FormField(FormFieldPrivate &dd);
|
||||
Q_DECLARE_PRIVATE(FormField)
|
||||
FormFieldPrivate *d_ptr;
|
||||
/// @endcond
|
||||
|
|
|
@ -22,7 +22,7 @@ using namespace Okular;
|
|||
class Movie::Private
|
||||
{
|
||||
public:
|
||||
Private(const QString &url)
|
||||
explicit Private(const QString &url)
|
||||
: m_url(url)
|
||||
, m_rotation(Rotation0)
|
||||
, m_playMode(PlayLimited)
|
||||
|
|
|
@ -14,7 +14,7 @@ using namespace Okular;
|
|||
class PageTransition::Private
|
||||
{
|
||||
public:
|
||||
Private(Type type)
|
||||
explicit Private(Type type)
|
||||
: m_type(type)
|
||||
, m_duration(1)
|
||||
, m_alignment(Horizontal)
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
*
|
||||
* If no type is given, the normal @ref Replace transition is used.
|
||||
*/
|
||||
PageTransition(Type type = Replace);
|
||||
explicit PageTransition(Type type = Replace);
|
||||
|
||||
/**
|
||||
* Creates a new page transition from an @p other.
|
||||
|
|
|
@ -14,7 +14,7 @@ using namespace Okular;
|
|||
class Event::Private
|
||||
{
|
||||
public:
|
||||
Private(EventType eventType)
|
||||
explicit Private(EventType eventType)
|
||||
: m_target(nullptr)
|
||||
, m_targetPage(nullptr)
|
||||
, m_source(nullptr)
|
||||
|
|
|
@ -37,7 +37,7 @@ using namespace Okular;
|
|||
class Okular::ExecutorKJSPrivate
|
||||
{
|
||||
public:
|
||||
ExecutorKJSPrivate(DocumentPrivate *doc)
|
||||
explicit ExecutorKJSPrivate(DocumentPrivate *doc)
|
||||
: m_doc(doc)
|
||||
{
|
||||
initTypes();
|
||||
|
|
|
@ -17,7 +17,7 @@ using namespace Okular;
|
|||
class Okular::ScripterPrivate
|
||||
{
|
||||
public:
|
||||
ScripterPrivate(DocumentPrivate *doc)
|
||||
explicit ScripterPrivate(DocumentPrivate *doc)
|
||||
: m_doc(doc)
|
||||
#ifdef WITH_KJS
|
||||
, m_kjs(nullptr)
|
||||
|
|
|
@ -13,14 +13,14 @@ using namespace Okular;
|
|||
class Sound::Private
|
||||
{
|
||||
public:
|
||||
Private(const QByteArray &data)
|
||||
explicit Private(const QByteArray &data)
|
||||
: m_data(QVariant(data))
|
||||
, m_type(Sound::Embedded)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
Private(const QString &url)
|
||||
explicit Private(const QString &url)
|
||||
: m_data(QVariant(url))
|
||||
, m_type(Sound::External)
|
||||
{
|
||||
|
|
|
@ -93,7 +93,7 @@ protected:
|
|||
/**
|
||||
* Construct a new view with the specified @p name.
|
||||
*/
|
||||
View(const QString &name);
|
||||
explicit View(const QString &name);
|
||||
|
||||
/// @cond PRIVATE
|
||||
Q_DECLARE_PRIVATE(View)
|
||||
|
|
|
@ -37,7 +37,6 @@ EBook_CHM::EBook_CHM()
|
|||
m_textCodecForSpecialFiles = nullptr;
|
||||
m_detectedLCID = 0;
|
||||
m_currentEncoding = QStringLiteral("UTF-8");
|
||||
m_htmlEntityDecoder = nullptr;
|
||||
}
|
||||
|
||||
EBook_CHM::~EBook_CHM()
|
||||
|
|
|
@ -18,7 +18,7 @@ class HelperEntityDecoder
|
|||
{
|
||||
public:
|
||||
// Initialization with the specific decoder
|
||||
HelperEntityDecoder(QTextCodec *encoder = nullptr);
|
||||
explicit HelperEntityDecoder(QTextCodec *encoder = nullptr);
|
||||
|
||||
// Used when the encoding changes
|
||||
void changeEncoding(QTextCodec *encoder = nullptr);
|
||||
|
|
|
@ -86,11 +86,11 @@ public slots:
|
|||
|
||||
private:
|
||||
struct Entry {
|
||||
Entry(int d)
|
||||
explicit Entry(int d)
|
||||
{
|
||||
documents.append(Document(d, 1));
|
||||
}
|
||||
Entry(const QVector<Document> &l)
|
||||
explicit Entry(const QVector<Document> &l)
|
||||
: documents(l)
|
||||
{
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ private:
|
|||
};
|
||||
|
||||
struct PosEntry {
|
||||
PosEntry(int p)
|
||||
explicit PosEntry(int p)
|
||||
{
|
||||
positions.append(p);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
class HelperXmlHandler_EpubTOC : public QXmlDefaultHandler
|
||||
{
|
||||
public:
|
||||
HelperXmlHandler_EpubTOC(EBook_EPUB *epub);
|
||||
explicit HelperXmlHandler_EpubTOC(EBook_EPUB *epub);
|
||||
|
||||
QList<EBookTocEntry> entries;
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ public:
|
|||
virtual void setColor(const QColor &color);
|
||||
|
||||
protected:
|
||||
Annotation(miniexp_t anno);
|
||||
explicit Annotation(miniexp_t anno);
|
||||
|
||||
miniexp_t m_anno;
|
||||
QPoint m_point;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
class TeXFont
|
||||
{
|
||||
public:
|
||||
TeXFont(TeXFontDefinition *_parent)
|
||||
explicit TeXFont(TeXFontDefinition *_parent)
|
||||
{
|
||||
parent = _parent;
|
||||
errorMessage.clear();
|
||||
|
|
|
@ -23,7 +23,7 @@ class glyph;
|
|||
class TeXFont_PFB : public TeXFont
|
||||
{
|
||||
public:
|
||||
TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc = nullptr, double slant = 0.0);
|
||||
explicit TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc = nullptr, double slant = 0.0);
|
||||
~TeXFont_PFB() override;
|
||||
|
||||
glyph *getGlyph(quint16 character, bool generateCharacterPixmap = false, const QColor &color = Qt::black) override;
|
||||
|
|
|
@ -10,7 +10,7 @@ class glyph;
|
|||
class TeXFont_PK : public TeXFont
|
||||
{
|
||||
public:
|
||||
TeXFont_PK(TeXFontDefinition *parent);
|
||||
explicit TeXFont_PK(TeXFontDefinition *parent);
|
||||
~TeXFont_PK() override;
|
||||
|
||||
glyph *getGlyph(quint16 character, bool generateCharacterPixmap = false, const QColor &color = Qt::black) override;
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
class TeXFont_TFM : public TeXFont
|
||||
{
|
||||
public:
|
||||
TeXFont_TFM(TeXFontDefinition *parent);
|
||||
explicit TeXFont_TFM(TeXFontDefinition *parent);
|
||||
~TeXFont_TFM() override;
|
||||
|
||||
glyph *getGlyph(quint16 character, bool generateCharacterPixmap = false, const QColor &color = Qt::black) override;
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
@param pg number of the page
|
||||
@param _distance_from_top distance from the top of the page
|
||||
*/
|
||||
Anchor(const PageNumber pg, const Length _distance_from_top)
|
||||
Anchor(quint16 pg, const Length _distance_from_top)
|
||||
: page(pg)
|
||||
, distance_from_top(_distance_from_top)
|
||||
{
|
||||
|
|
|
@ -96,7 +96,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap *page)
|
|||
return;
|
||||
}
|
||||
// Paranoid safety checks
|
||||
if (page->pageNumber == 0) {
|
||||
if (!page->pageNumber.isValid()) {
|
||||
qCCritical(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number 0";
|
||||
return;
|
||||
}
|
||||
|
@ -108,8 +108,9 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap *page)
|
|||
page->clear();
|
||||
return;
|
||||
}
|
||||
if (page->pageNumber > dviFile->total_pages) {
|
||||
qCCritical(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number " << page->pageNumber << " but the current dviFile has only " << dviFile->total_pages << " pages.";
|
||||
if (static_cast<quint16>(page->pageNumber) > dviFile->total_pages) {
|
||||
qCCritical(OkularDviDebug) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number " << static_cast<quint16>(page->pageNumber) << " but the current dviFile has only " << dviFile->total_pages
|
||||
<< " pages.";
|
||||
return;
|
||||
}
|
||||
if (dviFile->dvi_Data() == nullptr) {
|
||||
|
@ -136,7 +137,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap *page)
|
|||
|
||||
currentlyDrawnPage = page;
|
||||
shrinkfactor = 1200 / resolutionInDPI;
|
||||
current_page = page->pageNumber - 1;
|
||||
current_page = static_cast<quint16>(page->pageNumber) - 1;
|
||||
|
||||
// Reset colors
|
||||
colorStack.clear();
|
||||
|
|
|
@ -97,7 +97,7 @@ class dviRenderer : public QObject /*: public DocumentRenderer*/, bigEndianByteR
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
dviRenderer(bool useFontHinting);
|
||||
explicit dviRenderer(bool useFontHinting);
|
||||
~dviRenderer() override;
|
||||
|
||||
virtual bool setFile(const QString &fname, const QUrl &base);
|
||||
|
|
|
@ -25,10 +25,11 @@ SimplePageSize dviRenderer::sizeOfPage(const PageNumber page)
|
|||
return SimplePageSize();
|
||||
if (page > totalPages())
|
||||
return SimplePageSize();
|
||||
if (page > pageSizes.size())
|
||||
const quint16 pageNumber = static_cast<quint16>(page);
|
||||
if (pageNumber > pageSizes.size())
|
||||
return SimplePageSize();
|
||||
|
||||
return pageSizes[page - 1];
|
||||
return pageSizes[pageNumber - 1];
|
||||
}
|
||||
|
||||
Anchor dviRenderer::findAnchor(const QString &locallink)
|
||||
|
@ -42,6 +43,5 @@ Anchor dviRenderer::findAnchor(const QString &locallink)
|
|||
|
||||
PageNumber dviRenderer::totalPages() const
|
||||
{
|
||||
PageNumber temp = numPages;
|
||||
return temp;
|
||||
return PageNumber(numPages);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ protected:
|
|||
* that the external process has finished and that this variable
|
||||
* can be removed from any stores.
|
||||
*/
|
||||
DVIExport(dviRenderer &parent);
|
||||
explicit DVIExport(dviRenderer &parent);
|
||||
|
||||
/** Spawns the external process having connected slots to the child
|
||||
* process's stdin and stdout streams.
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
// located, opened or parsed, errors are printed using the kError()
|
||||
// channel, and the array glyphNameVector will contain empty
|
||||
// strings.
|
||||
fontEncoding(const QString &encName);
|
||||
explicit fontEncoding(const QString &encName);
|
||||
|
||||
// Full name of the encoding, as read from the encoding file
|
||||
QString encodingFullName;
|
||||
|
|
|
@ -38,7 +38,7 @@ class fontPool : public QObject
|
|||
|
||||
public:
|
||||
// Default constructor.
|
||||
fontPool(bool useFontHinting);
|
||||
explicit fontPool(bool useFontHinting);
|
||||
|
||||
// Default destructor.
|
||||
~fontPool() override;
|
||||
|
|
|
@ -119,9 +119,9 @@ void DviGenerator::fillViewportFromAnchor(Okular::DocumentViewport &vp, const An
|
|||
|
||||
void DviGenerator::fillViewportFromAnchor(Okular::DocumentViewport &vp, const Anchor anch, int pW, int pH) const
|
||||
{
|
||||
vp.pageNumber = anch.page - 1;
|
||||
vp.pageNumber = static_cast<quint16>(anch.page) - 1;
|
||||
|
||||
SimplePageSize ps = m_dviRenderer->sizeOfPage(vp.pageNumber);
|
||||
SimplePageSize ps = m_dviRenderer->sizeOfPage(PageNumber(vp.pageNumber));
|
||||
double resolution = 0;
|
||||
if (ps.isValid())
|
||||
resolution = (double)(pW) / ps.width().getLength_in_inch();
|
||||
|
@ -319,7 +319,7 @@ const Okular::DocumentSynopsis *DviGenerator::generateDocumentSynopsis()
|
|||
if (a.isValid()) {
|
||||
Okular::DocumentViewport vp;
|
||||
|
||||
const Okular::Page *p = document()->page(a.page - 1);
|
||||
const Okular::Page *p = document()->page(static_cast<quint16>(a.page) - 1);
|
||||
|
||||
fillViewportFromAnchor(vp, a, (int)p->width(), (int)p->height());
|
||||
domel.setAttribute(QStringLiteral("Viewport"), vp.toString());
|
||||
|
@ -462,7 +462,7 @@ bool DviGenerator::print(QPrinter &printer)
|
|||
if (!tf.open())
|
||||
return false;
|
||||
|
||||
const QList<int> pageList = Okular::FilePrinter::pageList(printer, m_dviRenderer->totalPages(), document()->currentPage() + 1, document()->bookmarkedPageList());
|
||||
const QList<int> pageList = Okular::FilePrinter::pageList(printer, static_cast<quint16>(m_dviRenderer->totalPages()), document()->currentPage() + 1, document()->bookmarkedPageList());
|
||||
QString pages;
|
||||
QStringList printOptions;
|
||||
// List of pages to print.
|
||||
|
@ -487,7 +487,7 @@ QVariant DviGenerator::metaData(const QString &key, const QVariant &option) cons
|
|||
if (key == QLatin1String("NamedViewport") && !option.toString().isEmpty()) {
|
||||
const Anchor anchor = m_dviRenderer->parseReference(option.toString());
|
||||
if (anchor.isValid()) {
|
||||
const Okular::Page *page = document()->page(anchor.page - 1);
|
||||
const Okular::Page *page = document()->page(static_cast<quint16>(anchor.page) - 1);
|
||||
Q_ASSERT_X(page, "DviGenerator::metaData()", "NULL page as result of valid Anchor");
|
||||
Okular::DocumentViewport viewport;
|
||||
fillViewportFromAnchor(viewport, anchor, page);
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
@param num page number that is set initially
|
||||
*/
|
||||
PageNumber(quint16 num)
|
||||
explicit PageNumber(quint16 num)
|
||||
{
|
||||
pgNum = num;
|
||||
}
|
||||
|
@ -56,11 +56,16 @@ public:
|
|||
}
|
||||
|
||||
/** \brief This method implements typecasts to quint16 */
|
||||
operator quint16() const
|
||||
explicit operator quint16() const
|
||||
{
|
||||
return pgNum;
|
||||
}
|
||||
|
||||
bool operator>(const PageNumber other) const
|
||||
{
|
||||
return pgNum > other.pgNum;
|
||||
}
|
||||
|
||||
/** \brief Checks if the page number is invalid
|
||||
|
||||
@returns true, if pgNum != invalidPage, i.e., does not equal 0
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
pageSize();
|
||||
|
||||
/** \brief Initializes the pageSize with a SimplePageSize. */
|
||||
pageSize(const SimplePageSize &);
|
||||
explicit pageSize(const SimplePageSize &);
|
||||
|
||||
pageSize(const pageSize &) = delete;
|
||||
pageSize &operator=(const pageSize &) = delete;
|
||||
|
|
|
@ -64,7 +64,7 @@ ghostscript_interface::~ghostscript_interface()
|
|||
qDeleteAll(pageList);
|
||||
}
|
||||
|
||||
void ghostscript_interface::setPostScript(const PageNumber page, const QString &PostScript)
|
||||
void ghostscript_interface::setPostScript(const quint16 page, const QString &PostScript)
|
||||
{
|
||||
#ifdef DEBUG_PSGS
|
||||
qCDebug(OkularDviDebug) << "ghostscript_interface::setPostScript( " << page << ", ... )";
|
||||
|
@ -88,7 +88,7 @@ void ghostscript_interface::setIncludePath(const QString &_includePath)
|
|||
includePath = _includePath + QStringLiteral("/*");
|
||||
}
|
||||
|
||||
void ghostscript_interface::setBackgroundColor(const PageNumber page, const QColor &background_color, bool permanent)
|
||||
void ghostscript_interface::setBackgroundColor(const quint16 page, const QColor &background_color, bool permanent)
|
||||
{
|
||||
#ifdef DEBUG_PSGS
|
||||
qCDebug(OkularDviDebug) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )";
|
||||
|
@ -110,7 +110,7 @@ void ghostscript_interface::setBackgroundColor(const PageNumber page, const QCol
|
|||
}
|
||||
}
|
||||
|
||||
void ghostscript_interface::restoreBackgroundColor(const PageNumber page)
|
||||
void ghostscript_interface::restoreBackgroundColor(const quint16 page)
|
||||
{
|
||||
#ifdef DEBUG_PSGS
|
||||
qCDebug(OkularDviDebug) << "ghostscript_interface::restoreBackgroundColor( " << page << " )";
|
||||
|
@ -125,7 +125,7 @@ void ghostscript_interface::restoreBackgroundColor(const PageNumber page)
|
|||
// Returns the background color for a certain page. This color is
|
||||
// always guaranteed to be valid
|
||||
|
||||
QColor ghostscript_interface::getBackgroundColor(const PageNumber page) const
|
||||
QColor ghostscript_interface::getBackgroundColor(const quint16 page) const
|
||||
{
|
||||
#ifdef DEBUG_PSGS
|
||||
qCDebug(OkularDviDebug) << "ghostscript_interface::getBackgroundColor( " << page << " )";
|
||||
|
@ -146,7 +146,7 @@ void ghostscript_interface::clear()
|
|||
pageList.clear();
|
||||
}
|
||||
|
||||
void ghostscript_interface::gs_generate_graphics_file(const PageNumber page, const QString &filename, long magnification)
|
||||
void ghostscript_interface::gs_generate_graphics_file(const quint16 page, const QString &filename, long magnification)
|
||||
{
|
||||
#ifdef DEBUG_PSGS
|
||||
qCDebug(OkularDviDebug) << "ghostscript_interface::gs_generate_graphics_file( " << page << ", " << filename << " )";
|
||||
|
@ -276,7 +276,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber page, con
|
|||
}
|
||||
}
|
||||
|
||||
void ghostscript_interface::graphics(const PageNumber page, double dpi, long magnification, QPainter *paint)
|
||||
void ghostscript_interface::graphics(const quint16 page, double dpi, long magnification, QPainter *paint)
|
||||
{
|
||||
#ifdef DEBUG_PSGS
|
||||
qCDebug(OkularDviDebug) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called.";
|
||||
|
|
|
@ -23,7 +23,7 @@ class QPainter;
|
|||
class pageInfo
|
||||
{
|
||||
public:
|
||||
pageInfo(const QString &_PostScriptString);
|
||||
explicit pageInfo(const QString &_PostScriptString);
|
||||
~pageInfo();
|
||||
|
||||
pageInfo(const pageInfo &) = delete;
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
void clear();
|
||||
|
||||
// sets the PostScript which is used on a certain page
|
||||
void setPostScript(const PageNumber page, const QString &PostScript);
|
||||
void setPostScript(const quint16 page, const QString &PostScript);
|
||||
|
||||
// sets path from additional postscript files may be read
|
||||
void setIncludePath(const QString &_includePath);
|
||||
|
@ -54,19 +54,19 @@ public:
|
|||
// background color can be restored by calling restoreBackground(page).
|
||||
// The Option permanent = false is used when we want to display a different paper
|
||||
// color as the one specified in the dvi file.
|
||||
void setBackgroundColor(const PageNumber page, const QColor &background_color, bool permanent = true);
|
||||
void setBackgroundColor(const quint16 page, const QColor &background_color, bool permanent = true);
|
||||
|
||||
// Restore the background to the color which was specified by the last call to setBackgroundColor()
|
||||
// With option permanent = true.
|
||||
void restoreBackgroundColor(const PageNumber page);
|
||||
void restoreBackgroundColor(const quint16 page);
|
||||
|
||||
// Draws the graphics of the page into the painter, if possible. If
|
||||
// the page does not contain any graphics, nothing happens
|
||||
void graphics(const PageNumber page, double dpi, long magnification, QPainter *paint);
|
||||
void graphics(const quint16 page, double dpi, long magnification, QPainter *paint);
|
||||
|
||||
// Returns the background color for a certain page. If no color was
|
||||
// set, Qt::white is returned.
|
||||
QColor getBackgroundColor(const PageNumber page) const;
|
||||
QColor getBackgroundColor(const quint16 page) const;
|
||||
|
||||
QString *PostScriptHeaderString;
|
||||
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
static QString locateEPSfile(const QString &filename, const QUrl &base);
|
||||
|
||||
private:
|
||||
void gs_generate_graphics_file(const PageNumber page, const QString &filename, long magnification);
|
||||
void gs_generate_graphics_file(const quint16 page, const QString &filename, long magnification);
|
||||
QHash<quint16, pageInfo *> pageList;
|
||||
|
||||
double resolution; // in dots per inch
|
||||
|
|
|
@ -207,7 +207,7 @@ static bool get_image(pagenode *pn)
|
|||
class FaxDocument::Private
|
||||
{
|
||||
public:
|
||||
Private(FaxDocument *parent)
|
||||
explicit Private(FaxDocument *parent)
|
||||
: mParent(parent)
|
||||
{
|
||||
mPageNode.size = QSize(1728, 0);
|
||||
|
|
|
@ -124,7 +124,7 @@ private:
|
|||
class PopplerFormFieldSignature : public Okular::FormFieldSignature
|
||||
{
|
||||
public:
|
||||
PopplerFormFieldSignature(std::unique_ptr<Poppler::FormFieldSignature> field);
|
||||
explicit PopplerFormFieldSignature(std::unique_ptr<Poppler::FormFieldSignature> field);
|
||||
~PopplerFormFieldSignature() override;
|
||||
|
||||
// inherited from Okular::FormField
|
||||
|
|
|
@ -1207,7 +1207,7 @@ void PDFGenerator::resolveMediaLinkReferences(Okular::Page *page)
|
|||
}
|
||||
|
||||
struct TextExtractionPayload {
|
||||
TextExtractionPayload(Okular::TextRequest *r)
|
||||
explicit TextExtractionPayload(Okular::TextRequest *r)
|
||||
: request(r)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
class PopplerCertificateInfo : public Okular::CertificateInfo
|
||||
{
|
||||
public:
|
||||
PopplerCertificateInfo(const Poppler::CertificateInfo &info);
|
||||
explicit PopplerCertificateInfo(const Poppler::CertificateInfo &info);
|
||||
~PopplerCertificateInfo() override;
|
||||
|
||||
bool isNull() const override;
|
||||
|
@ -42,7 +42,7 @@ private:
|
|||
class PopplerSignatureInfo : public Okular::SignatureInfo
|
||||
{
|
||||
public:
|
||||
PopplerSignatureInfo(const Poppler::SignatureValidationInfo &info);
|
||||
explicit PopplerSignatureInfo(const Poppler::SignatureValidationInfo &info);
|
||||
~PopplerSignatureInfo() override;
|
||||
|
||||
SignatureStatus signatureStatus() const override;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
class PDFEmbeddedFile : public Okular::EmbeddedFile
|
||||
{
|
||||
public:
|
||||
PDFEmbeddedFile(Poppler::EmbeddedFile *f)
|
||||
explicit PDFEmbeddedFile(Poppler::EmbeddedFile *f)
|
||||
: ef(f)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ class PixmapRequest;
|
|||
}
|
||||
|
||||
struct GSRendererThreadRequest {
|
||||
GSRendererThreadRequest(GSGenerator *_owner)
|
||||
explicit GSRendererThreadRequest(GSGenerator *_owner)
|
||||
: owner(_owner)
|
||||
, request(nullptr)
|
||||
, spectrePage(nullptr)
|
||||
|
|
|
@ -261,7 +261,7 @@ void PageItem::removeBookmarkAtPos(qreal x, qreal y)
|
|||
|
||||
void PageItem::removeBookmark(const QString &bookmark)
|
||||
{
|
||||
m_documentItem.data()->document()->bookmarkManager()->removeBookmark(bookmark);
|
||||
m_documentItem.data()->document()->bookmarkManager()->removeBookmark(Okular::DocumentViewport(bookmark));
|
||||
emit bookmarksChanged();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class ActionBarWidget : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ActionBarWidget(QToolBar *parent);
|
||||
explicit ActionBarWidget(QToolBar *parent);
|
||||
void recreateButtons(const QList<QAction *> &actions);
|
||||
|
||||
private slots:
|
||||
|
|
|
@ -23,7 +23,7 @@ class ActionBar : public QWidgetAction
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ActionBar(QObject *parent = nullptr);
|
||||
explicit ActionBar(QObject *parent = nullptr);
|
||||
QWidget *createWidget(QWidget *parent) override;
|
||||
|
||||
void addAction(QAction *action);
|
||||
|
|
|
@ -55,7 +55,7 @@ static QLinkedList<Okular::Annotation *> filterOutWidgetAnnotations(const QLinke
|
|||
class AnnotationModelPrivate : public Okular::DocumentObserver
|
||||
{
|
||||
public:
|
||||
AnnotationModelPrivate(AnnotationModel *qq);
|
||||
explicit AnnotationModelPrivate(AnnotationModel *qq);
|
||||
~AnnotationModelPrivate() override;
|
||||
|
||||
void notifySetup(const QVector<Okular::Page *> &pages, int setupFlags) override;
|
||||
|
|
|
@ -264,7 +264,7 @@ class AuthorGroupItem
|
|||
public:
|
||||
enum Type { Page, Author, Annotation };
|
||||
|
||||
AuthorGroupItem(AuthorGroupItem *parent, Type type = Page, const QModelIndex &index = QModelIndex())
|
||||
explicit AuthorGroupItem(AuthorGroupItem *parent, Type type = Page, const QModelIndex &index = QModelIndex())
|
||||
: mParent(parent)
|
||||
, mType(type)
|
||||
, mIndex(index)
|
||||
|
@ -356,7 +356,7 @@ private:
|
|||
class AuthorGroupProxyModel::Private
|
||||
{
|
||||
public:
|
||||
Private(AuthorGroupProxyModel *parent)
|
||||
explicit Private(AuthorGroupProxyModel *parent)
|
||||
: mParent(parent)
|
||||
, mRoot(nullptr)
|
||||
, mGroupByAuthor(false)
|
||||
|
|
|
@ -41,7 +41,7 @@ class CloseButton : public QPushButton
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CloseButton(QWidget *parent = Q_NULLPTR)
|
||||
explicit CloseButton(QWidget *parent = Q_NULLPTR)
|
||||
: QPushButton(parent)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
|
@ -59,7 +59,7 @@ class MovableTitle : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MovableTitle(AnnotWindow *parent)
|
||||
explicit MovableTitle(AnnotWindow *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
QVBoxLayout *mainlay = new QVBoxLayout(this);
|
||||
|
|
|
@ -35,7 +35,7 @@ static const int UrlRole = Qt::UserRole + 1;
|
|||
class BookmarkItem : public QTreeWidgetItem
|
||||
{
|
||||
public:
|
||||
BookmarkItem(const KBookmark &bm)
|
||||
explicit BookmarkItem(const KBookmark &bm)
|
||||
: QTreeWidgetItem(BookmarkItemType)
|
||||
, m_bookmark(bm)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
class KTreeViewSearchLine::Private
|
||||
{
|
||||
public:
|
||||
Private(KTreeViewSearchLine *_parent)
|
||||
explicit Private(KTreeViewSearchLine *_parent)
|
||||
: parent(_parent)
|
||||
, treeView(nullptr)
|
||||
, caseSensitive(Qt::CaseInsensitive)
|
||||
|
|
|
@ -33,7 +33,7 @@ class HoverButton : public QToolButton
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
HoverButton(QWidget *parent);
|
||||
explicit HoverButton(QWidget *parent);
|
||||
};
|
||||
|
||||
MiniBarLogic::MiniBarLogic(QObject *parent, Okular::Document *document)
|
||||
|
|
|
@ -135,7 +135,7 @@ TableSelectionPart::TableSelectionPart(PageViewItem *item_p, const Okular::Norma
|
|||
class PageViewPrivate
|
||||
{
|
||||
public:
|
||||
PageViewPrivate(PageView *qq);
|
||||
explicit PageViewPrivate(PageView *qq);
|
||||
|
||||
FormWidgetsController *formWidgetsController();
|
||||
#ifdef HAVE_SPEECH
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
class PickPointEngine : public AnnotatorEngine
|
||||
{
|
||||
public:
|
||||
PickPointEngine(const QDomElement &engineElement)
|
||||
explicit PickPointEngine(const QDomElement &engineElement)
|
||||
: AnnotatorEngine(engineElement)
|
||||
, clicked(false)
|
||||
, xscale(1.0)
|
||||
|
@ -462,7 +462,7 @@ private:
|
|||
class PolyLineEngine : public AnnotatorEngine
|
||||
{
|
||||
public:
|
||||
PolyLineEngine(const QDomElement &engineElement)
|
||||
explicit PolyLineEngine(const QDomElement &engineElement)
|
||||
: AnnotatorEngine(engineElement)
|
||||
, last(false)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ class HandleDrag : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HandleDrag(QWidget *parent = Q_NULLPTR)
|
||||
explicit HandleDrag(QWidget *parent = Q_NULLPTR)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setCursor(Qt::SizeAllCursor);
|
||||
|
|
|
@ -114,7 +114,7 @@ class PresentationToolBar : public QToolBar
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PresentationToolBar(QWidget *parent = Q_NULLPTR)
|
||||
explicit PresentationToolBar(QWidget *parent = Q_NULLPTR)
|
||||
: QToolBar(parent)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class TreeView : public QTreeView
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TreeView(Okular::Document *document, QWidget *parent = Q_NULLPTR)
|
||||
explicit TreeView(Okular::Document *document, QWidget *parent = Q_NULLPTR)
|
||||
: QTreeView(parent)
|
||||
, m_document(document)
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ SignatureItem::~SignatureItem()
|
|||
class SignatureModelPrivate : public Okular::DocumentObserver
|
||||
{
|
||||
public:
|
||||
SignatureModelPrivate(SignatureModel *qq);
|
||||
explicit SignatureModelPrivate(SignatureModel *qq);
|
||||
~SignatureModelPrivate() override;
|
||||
|
||||
void notifySetup(const QVector<Okular::Page *> &pages, int setupFlags) override;
|
||||
|
|
|
@ -39,7 +39,7 @@ struct TOCItem {
|
|||
class TOCModelPrivate
|
||||
{
|
||||
public:
|
||||
TOCModelPrivate(TOCModel *qq);
|
||||
explicit TOCModelPrivate(TOCModel *qq);
|
||||
~TOCModelPrivate();
|
||||
|
||||
void addChildren(const QDomNode &parentNode, TOCItem *parentItem);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
class OkularTTS::Private
|
||||
{
|
||||
public:
|
||||
Private(OkularTTS *qq)
|
||||
explicit Private(OkularTTS *qq)
|
||||
: q(qq)
|
||||
, speech(new QTextToSpeech(Okular::Settings::ttsEngine()))
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ Shell::Shell(const QString &serializedOptions)
|
|||
// and integrate the part's GUI with the shell's
|
||||
setupGUI(Keys | ToolBar | Save);
|
||||
|
||||
m_tabs.append(firstPart);
|
||||
m_tabs.append(TabState(firstPart));
|
||||
m_tabWidget->addTab(firstPart->widget(), QString()); // triggers setActiveTab that calls createGUI( part )
|
||||
|
||||
connectPart(firstPart);
|
||||
|
@ -691,7 +691,7 @@ void Shell::openNewTab(const QUrl &url, const QString &serializedOptions)
|
|||
const int newIndex = m_tabs.size();
|
||||
|
||||
// Make new part
|
||||
m_tabs.append(m_partFactory->create<KParts::ReadWritePart>(this));
|
||||
m_tabs.append(TabState(m_partFactory->create<KParts::ReadWritePart>(this)));
|
||||
connectPart(m_tabs[newIndex].part);
|
||||
|
||||
// Update GUI
|
||||
|
|
|
@ -167,7 +167,7 @@ private:
|
|||
KToggleAction *m_openInTab;
|
||||
|
||||
struct TabState {
|
||||
TabState(KParts::ReadWritePart *p)
|
||||
explicit TabState(KParts::ReadWritePart *p)
|
||||
: part(p)
|
||||
, printEnabled(false)
|
||||
, closeEnabled(false)
|
||||
|
|
Loading…
Reference in a new issue