~adamreichold/qpdfview/trunk

« back to all changes in this revision

Viewing changes to sources/mainwindow.cpp

  • Committer: Adam Reichold
  • Date: 2017-04-19 21:01:25 UTC
  • mto: This revision was merged to the branch mainline in revision 2043.
  • Revision ID: adam.reichold@t-online.de-20170419210125-x3ubrcjkdmjzkn5g
Fix usage of QList in the bookmark and search models and various small performance issues reported by the clazy tool using the checks of "level0,level1,level2,no-missing-qobject-macro,no-qstring-allocations,no-copyable-polymorphic,no-ctor-missing-parent-argument,no-reserve-candidates".

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
 
255
255
class MainWindow::CurrentTabChangeBlocker
256
256
{
 
257
    Q_DISABLE_COPY(CurrentTabChangeBlocker)
 
258
 
257
259
private:
258
260
    MainWindow* const that;
259
261
 
757
759
    drag->exec();
758
760
}
759
761
 
760
 
void MainWindow::on_tabWidget_tabContextMenuRequested(const QPoint& globalPos, int index)
 
762
void MainWindow::on_tabWidget_tabContextMenuRequested(QPoint globalPos, int index)
761
763
{
762
764
    QMenu menu;
763
765
 
1125
1127
    m_searchLineEdit->setProgress(progress);
1126
1128
}
1127
1129
 
1128
 
void MainWindow::on_currentTab_customContextMenuRequested(const QPoint& pos)
 
1130
void MainWindow::on_currentTab_customContextMenuRequested(QPoint pos)
1129
1131
{
1130
1132
    ONLY_IF_SENDER_IS_CURRENT_TAB
1131
1133
 
2345
2347
    }
2346
2348
}
2347
2349
 
2348
 
void MainWindow::on_bookmarks_contextMenuRequested(const QPoint& pos)
 
2350
void MainWindow::on_bookmarks_contextMenuRequested(QPoint pos)
2349
2351
{
2350
2352
    QMenu menu;
2351
2353
 
2875
2877
 
2876
2878
        if((s_settings->mainWindow().usePageLabel() || tab->hasFrontMatter()) && defaultPageLabel != pageLabel)
2877
2879
        {
2878
 
            suffix = QString(" (%1 / %2)").arg(defaultPageLabel).arg(lastDefaultPageLabel);
 
2880
            suffix = QString(" (%1 / %2)").arg(defaultPageLabel, lastDefaultPageLabel);
2879
2881
        }
2880
2882
        else
2881
2883
        {
2895
2897
    return BookmarkModel::fromPath(currentTab()->fileInfo().absoluteFilePath(), create);
2896
2898
}
2897
2899
 
2898
 
QAction* MainWindow::sourceLinkActionForCurrentTab(QObject* parent, const QPoint& pos)
 
2900
QAction* MainWindow::sourceLinkActionForCurrentTab(QObject* parent, QPoint pos)
2899
2901
{
2900
2902
    QAction* action = createTemporaryAction(parent, QString(), QLatin1String("openSourceLink"));
2901
2903