mirror of
https://invent.kde.org/graphics/okular
synced 2024-07-04 16:48:48 +00:00
Small performance improvements
This commit is contained in:
parent
92232d81ba
commit
da21543a50
|
@ -32,7 +32,7 @@ class MessageBoxHelper : public QObject
|
|||
|
||||
public:
|
||||
MessageBoxHelper(QMessageBox::StandardButton b, QString message, QMessageBox::Icon icon, QString title, bool hasCheckBox )
|
||||
: m_button(b), m_clicked(false), m_message(message), m_icon(icon), m_title(title), m_checkBox(hasCheckBox)
|
||||
: m_button(b), m_clicked(false), m_message(std::move(message)), m_icon(icon), m_title(std::move(title)), m_checkBox(hasCheckBox)
|
||||
{
|
||||
QTimer::singleShot(0, this, &MessageBoxHelper::closeMessageBox);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace TestingUtils
|
|||
return annotXmlString;
|
||||
}
|
||||
|
||||
bool pointListsAlmostEqual( QLinkedList< Okular::NormalizedPoint > points1, QLinkedList< Okular::NormalizedPoint > points2 ) {
|
||||
bool pointListsAlmostEqual( const QLinkedList< Okular::NormalizedPoint > &points1, const QLinkedList< Okular::NormalizedPoint > &points2 ) {
|
||||
|
||||
QLinkedListIterator<Okular::NormalizedPoint> it1( points1 );
|
||||
QLinkedListIterator<Okular::NormalizedPoint> it2( points2 );
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace TestingUtils
|
|||
* Returns true if the pairwise comparison coordinates of points in @p points1 and @p points2 are almost
|
||||
* equal (according to qFuzzyCompare)
|
||||
*/
|
||||
bool pointListsAlmostEqual( QLinkedList< Okular::NormalizedPoint > points1, QLinkedList< Okular::NormalizedPoint > points2 );
|
||||
bool pointListsAlmostEqual( const QLinkedList< Okular::NormalizedPoint > &points1, const QLinkedList< Okular::NormalizedPoint > &points2 );
|
||||
|
||||
/*
|
||||
* The AnnotationDisposeWatcher class provides a static disposeAnnotation function
|
||||
|
|
|
@ -2298,7 +2298,7 @@ int DocumentPrivate::findFieldPageNumber( Okular::FormField *field )
|
|||
return foundPage;
|
||||
}
|
||||
|
||||
void DocumentPrivate::executeScriptEvent( std::shared_ptr< Event > event, const Okular::ScriptAction * linkscript )
|
||||
void DocumentPrivate::executeScriptEvent( const std::shared_ptr< Event > &event, const Okular::ScriptAction * linkscript )
|
||||
{
|
||||
if ( !m_scripter )
|
||||
{
|
||||
|
|
|
@ -234,7 +234,7 @@ class DocumentPrivate
|
|||
/*
|
||||
* Executes a ScriptAction with the event passed as parameter.
|
||||
*/
|
||||
void executeScriptEvent( std::shared_ptr< Event > event, const Okular::ScriptAction * linkscript );
|
||||
void executeScriptEvent( const std::shared_ptr< Event > &event, const Okular::ScriptAction * linkscript );
|
||||
|
||||
/*
|
||||
* Find the corresponding page number for the form field passed as parameter.
|
||||
|
|
|
@ -1760,7 +1760,7 @@ static RegionTextList XYCutForBoundingBoxes(const QList<WordWithCharacters> &wor
|
|||
{
|
||||
for( int j = 0 ; j < list.length() ; ++j )
|
||||
{
|
||||
const WordWithCharacters word = list.at(j);
|
||||
const WordWithCharacters &word = list.at(j);
|
||||
const QRect wordRect = word.area().geometry(pageWidth,pageHeight);
|
||||
|
||||
if(topRect.intersects(wordRect))
|
||||
|
@ -1781,7 +1781,7 @@ static RegionTextList XYCutForBoundingBoxes(const QList<WordWithCharacters> &wor
|
|||
{
|
||||
for( int j = 0 ; j < list.length() ; ++j )
|
||||
{
|
||||
const WordWithCharacters word = list.at(j);
|
||||
const WordWithCharacters &word = list.at(j);
|
||||
const QRect wordRect = word.area().geometry(pageWidth,pageHeight);
|
||||
|
||||
if(leftRect.intersects(wordRect))
|
||||
|
|
|
@ -31,7 +31,7 @@ Converter::~Converter()
|
|||
{
|
||||
}
|
||||
|
||||
void Converter::handleMetadata(const QMap<Mobipocket::Document::MetaKey,QString> metadata)
|
||||
void Converter::handleMetadata(const QMap<Mobipocket::Document::MetaKey,QString> &metadata)
|
||||
{
|
||||
QMapIterator<Mobipocket::Document::MetaKey,QString> it(metadata);
|
||||
while (it.hasNext()) {
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace Mobi {
|
|||
|
||||
QTextDocument *convert( const QString &fileName ) override;
|
||||
private:
|
||||
void handleMetadata(const QMap<Mobipocket::Document::MetaKey, QString> metadata);
|
||||
void handleMetadata(const QMap<Mobipocket::Document::MetaKey, QString> &metadata);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user