Commit beb195c9 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Enable clazy qcolor-from-literal

parent 8e35b43a
......@@ -48,7 +48,7 @@ build_clazy_clang_tidy:
script:
- srcdir=`pwd` && mkdir -p /tmp/okular_build && cd /tmp/okular_build && CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja $srcdir && cat compile_commands.json | jq '[.[] | select(.file | contains("'"$srcdir"'"))]' > compile_commands.aux.json && cat compile_commands.aux.json | jq '[.[] | select(.file | contains("/synctex/")| not)]' > compile_commands.json
- CLAZY_CHECKS="qstring-arg,incorrect-emit,qhash-namespace,detaching-temporary,range-loop,qdeleteall,connect-not-normalized,inefficient-qlist-soft,strict-iterators,lambda-in-connect,fully-qualified-moc-types,qstring-ref,unused-non-trivial-variable" ninja
- CLAZY_CHECKS="qstring-arg,incorrect-emit,qhash-namespace,detaching-temporary,range-loop,qdeleteall,connect-not-normalized,inefficient-qlist-soft,strict-iterators,lambda-in-connect,fully-qualified-moc-types,qstring-ref,unused-non-trivial-variable,qcolor-from-literal,qcolor-from-literal" ninja
# Fix the poppler header, remove when debian:unstable ships poppler 0.82 or later
- sed -i "N;N;N;N; s#class MediaRendition\;\nclass MovieAnnotation\;\nclass ScreenAnnotation;#class MediaRendition\;#g" /usr/include/poppler/qt5/poppler-link.h
- "run-clang-tidy -header-filter='.*/okular/.*' -checks='-*,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' -config=\"{WarningsAsErrors: '*'}\""
......@@ -585,7 +585,7 @@ bool Converter::convertAnnotation( QTextCursor *cursor, const QDomElement &eleme
annotation->setAuthor( creator );
annotation->setContents( contents.join( QStringLiteral("\n") ) );
annotation->setCreationDate( dateTime );
annotation->style().setColor( QColor( "#ffff00" ) );
annotation->style().setColor( QColor( 0xff, 0xff, 0x00 ) );
annotation->style().setOpacity( 0.5 );
emit addAnnotation( annotation, position, position + 3 );
......
......@@ -266,7 +266,7 @@ void AnnotWindow::reloadInfo()
{
Okular::TextAnnotation * textAnn = static_cast< Okular::TextAnnotation * >( m_annot );
if ( textAnn->textType() == Okular::TextAnnotation::InPlace && textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter )
newcolor = QColor("#fdfd96");
newcolor = QColor(0xfd, 0xfd, 0x96);
}
if ( !newcolor.isValid() )
newcolor = m_annot->style().color().isValid() ? QColor(m_annot->style().color().red(), m_annot->style().color().green(), m_annot->style().color().blue(), 255) : Qt::yellow;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment