diff options
61 files changed, 156 insertions, 185 deletions
diff --git a/src/assistant/assistant/aboutdialog.cpp b/src/assistant/assistant/aboutdialog.cpp index d599489e2..1ac24d2f4 100644 --- a/src/assistant/assistant/aboutdialog.cpp +++ b/src/assistant/assistant/aboutdialog.cpp @@ -98,7 +98,7 @@ AboutDialog::AboutDialog(QWidget *parent) Qt::WindowTitleHint|Qt::WindowSystemMenuHint) { TRACE_OBJ - m_pixmapLabel = 0; + m_pixmapLabel = nullptr; m_aboutLabel = new AboutLabel(); m_closeButton = new QPushButton(); diff --git a/src/assistant/assistant/aboutdialog.h b/src/assistant/assistant/aboutdialog.h index 65e5cd7e9..b791a4891 100644 --- a/src/assistant/assistant/aboutdialog.h +++ b/src/assistant/assistant/aboutdialog.h @@ -43,7 +43,7 @@ class AboutLabel : public QTextBrowser Q_OBJECT public: - AboutLabel(QWidget *parent = 0); + AboutLabel(QWidget *parent = nullptr); void setText(const QString &text, const QByteArray &resources); QSize minimumSizeHint() const override; @@ -59,7 +59,7 @@ class AboutDialog : public QDialog Q_OBJECT public: - AboutDialog(QWidget *parent = 0); + AboutDialog(QWidget *parent = nullptr); void setText(const QString &text, const QByteArray &resources); void setPixmap(const QPixmap &pixmap); QString documentTitle() const; diff --git a/src/assistant/assistant/bookmarkdialog.h b/src/assistant/assistant/bookmarkdialog.h index 3bac1cb5b..2283b44b0 100644 --- a/src/assistant/assistant/bookmarkdialog.h +++ b/src/assistant/assistant/bookmarkdialog.h @@ -41,8 +41,8 @@ class BookmarkDialog : public QDialog Q_OBJECT public: BookmarkDialog(BookmarkModel *bookmarkModel, const QString &title, - const QString &url, QWidget *parent = 0); - ~BookmarkDialog(); + const QString &url, QWidget *parent = nullptr); + ~BookmarkDialog() override; private: bool isRootItem(const QModelIndex &index) const; diff --git a/src/assistant/assistant/bookmarkfiltermodel.cpp b/src/assistant/assistant/bookmarkfiltermodel.cpp index 1e8b6a7f2..05bd30025 100644 --- a/src/assistant/assistant/bookmarkfiltermodel.cpp +++ b/src/assistant/assistant/bookmarkfiltermodel.cpp @@ -32,8 +32,6 @@ BookmarkFilterModel::BookmarkFilterModel(QObject *parent) : QAbstractProxyModel(parent) - , hideBookmarks(true) - , sourceModel(0) { } diff --git a/src/assistant/assistant/bookmarkfiltermodel.h b/src/assistant/assistant/bookmarkfiltermodel.h index 8f154f4c6..28b5436df 100644 --- a/src/assistant/assistant/bookmarkfiltermodel.h +++ b/src/assistant/assistant/bookmarkfiltermodel.h @@ -44,7 +44,7 @@ class BookmarkFilterModel : public QAbstractProxyModel { Q_OBJECT public: - explicit BookmarkFilterModel(QObject *parent = 0); + explicit BookmarkFilterModel(QObject *parent = nullptr); void setSourceModel(QAbstractItemModel *sourceModel) override; @@ -81,10 +81,10 @@ private: void collectItems(const QModelIndex &parent); private: - bool hideBookmarks; - BookmarkModel *sourceModel; + BookmarkModel *sourceModel = nullptr; PersistentModelIndexCache cache; QPersistentModelIndex indexToRemove; + bool hideBookmarks = true; }; // -- BookmarkTreeModel @@ -93,7 +93,7 @@ class BookmarkTreeModel : public QSortFilterProxyModel { Q_OBJECT public: - BookmarkTreeModel(QObject *parent = 0); + BookmarkTreeModel(QObject *parent = nullptr); int columnCount(const QModelIndex &parent = QModelIndex()) const override; protected: diff --git a/src/assistant/assistant/bookmarkitem.cpp b/src/assistant/assistant/bookmarkitem.cpp index 715645ba6..5848efc33 100644 --- a/src/assistant/assistant/bookmarkitem.cpp +++ b/src/assistant/assistant/bookmarkitem.cpp @@ -68,7 +68,7 @@ BookmarkItem::child(int number) const { if (number >= 0 && number < m_children.count()) return m_children[number]; - return 0; + return nullptr; } int BookmarkItem::childCount() const diff --git a/src/assistant/assistant/bookmarkitem.h b/src/assistant/assistant/bookmarkitem.h index 210b0e191..31ecff80b 100644 --- a/src/assistant/assistant/bookmarkitem.h +++ b/src/assistant/assistant/bookmarkitem.h @@ -45,7 +45,7 @@ typedef QVector<QVariant> DataVector; class BookmarkItem { public: - explicit BookmarkItem(const DataVector &data, BookmarkItem *parent = 0); + explicit BookmarkItem(const DataVector &data, BookmarkItem *parent = nullptr); ~BookmarkItem(); BookmarkItem *parent() const; diff --git a/src/assistant/assistant/bookmarkmanager.cpp b/src/assistant/assistant/bookmarkmanager.cpp index 59b9db6aa..f15e23a6e 100644 --- a/src/assistant/assistant/bookmarkmanager.cpp +++ b/src/assistant/assistant/bookmarkmanager.cpp @@ -97,7 +97,7 @@ void BookmarkManager::BookmarkTreeView::setExpandedData(const QModelIndex &index // -- BookmarkManager QMutex BookmarkManager::mutex; -BookmarkManager* BookmarkManager::bookmarkManager = 0; +BookmarkManager* BookmarkManager::bookmarkManager = nullptr; // -- public @@ -116,7 +116,7 @@ void BookmarkManager::destroy() { TRACE_OBJ delete bookmarkManager; - bookmarkManager = 0; + bookmarkManager = nullptr; } QWidget* BookmarkManager::bookmarkDockWidget() const @@ -124,7 +124,7 @@ QWidget* BookmarkManager::bookmarkDockWidget() const TRACE_OBJ if (bookmarkWidget) return bookmarkWidget; - return 0; + return nullptr; } void BookmarkManager::setBookmarksMenu(QMenu* menu) @@ -155,15 +155,9 @@ void BookmarkManager::addBookmark(const QString &title, const QString &url) // -- private BookmarkManager::BookmarkManager() - : typeAndSearch(false) - , bookmarkMenu(0) - , m_toolBar(0) - , bookmarkModel(new BookmarkModel) - , bookmarkFilterModel(0) - , typeAndSearchModel(0) + : bookmarkModel(new BookmarkModel) , bookmarkWidget(new BookmarkWidget) , bookmarkTreeView(new BookmarkTreeView) - , bookmarkManagerWidget(0) { TRACE_OBJ bookmarkWidget->installEventFilter(this); @@ -251,24 +245,23 @@ bool BookmarkManager::eventFilter(QObject *object, QEvent *event) if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent*>(event); switch (ke->key()) { - case Qt::Key_F2: { + case Qt::Key_F2: renameBookmark(bookmarkTreeView->currentIndex()); - } break; + break; - case Qt::Key_Delete: { + case Qt::Key_Delete: removeItem(bookmarkTreeView->currentIndex()); return true; - } break; - case Qt::Key_Up: { // needs event filter on widget + case Qt::Key_Up: // needs event filter on widget case Qt::Key_Down: if (isWidget) bookmarkTreeView->subclassKeyPressEvent(ke); - } break; + break; - case Qt::Key_Escape: { + case Qt::Key_Escape: emit escapePressed(); - } break; + break; default: break; } @@ -366,7 +359,7 @@ void BookmarkManager::removeBookmarkActivated() void BookmarkManager::manageBookmarks() { TRACE_OBJ - if (bookmarkManagerWidget == 0) { + if (bookmarkManagerWidget == nullptr) { bookmarkManagerWidget = new BookmarkManagerWidget(bookmarkModel); connect(bookmarkManagerWidget, &BookmarkManagerWidget::setSource, this, &BookmarkManager::setSource); @@ -497,10 +490,10 @@ void BookmarkManager::customContextMenuRequested(const QPoint &point) if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) return; - QAction *remove = 0; - QAction *rename = 0; - QAction *showItem = 0; - QAction *showItemInNewTab = 0; + QAction *remove = nullptr; + QAction *rename = nullptr; + QAction *showItem = nullptr; + QAction *showItemInNewTab = nullptr; QMenu menu; if (!typeAndSearch && bookmarkModel->data(index, UserRoleFolder).toBool()) { @@ -534,7 +527,7 @@ void BookmarkManager::focusInEventOccurred() void BookmarkManager::managerWidgetAboutToClose() { delete bookmarkManagerWidget; - bookmarkManagerWidget = 0; + bookmarkManagerWidget = nullptr; storeBookmarks(); } diff --git a/src/assistant/assistant/bookmarkmanager.h b/src/assistant/assistant/bookmarkmanager.h index ac3a13a9e..4bcb4cd10 100644 --- a/src/assistant/assistant/bookmarkmanager.h +++ b/src/assistant/assistant/bookmarkmanager.h @@ -48,7 +48,7 @@ class BookmarkManager : public QObject class BookmarkWidget; class BookmarkTreeView; class BookmarkListView; - Q_DISABLE_COPY(BookmarkManager); + Q_DISABLE_COPY(BookmarkManager) public: static BookmarkManager* instance(); @@ -68,7 +68,7 @@ signals: private: BookmarkManager(); - ~BookmarkManager(); + ~BookmarkManager() override; void removeItem(const QModelIndex &index); bool eventFilter(QObject *object, QEvent *event) override; @@ -95,30 +95,30 @@ private slots: void customContextMenuRequested(const QPoint &point); private: - bool typeAndSearch; + bool typeAndSearch = false; static QMutex mutex; static BookmarkManager *bookmarkManager; - QMenu *bookmarkMenu; - QToolBar *m_toolBar; + QMenu *bookmarkMenu = nullptr; + QToolBar *m_toolBar = nullptr; BookmarkModel *bookmarkModel; - BookmarkFilterModel *bookmarkFilterModel; - QSortFilterProxyModel *typeAndSearchModel; + BookmarkFilterModel *bookmarkFilterModel = nullptr; + QSortFilterProxyModel *typeAndSearchModel = nullptr; BookmarkWidget *bookmarkWidget; BookmarkTreeView *bookmarkTreeView; - BookmarkManagerWidget *bookmarkManagerWidget; + BookmarkManagerWidget *bookmarkManagerWidget = nullptr; }; class BookmarkManager::BookmarkWidget : public QWidget { Q_OBJECT public: - BookmarkWidget(QWidget *parent = 0) + BookmarkWidget(QWidget *parent = nullptr) : QWidget(parent) { ui.setupUi(this); } - virtual ~BookmarkWidget() {} + virtual ~BookmarkWidget() override {} Ui::BookmarkWidget ui; @@ -133,8 +133,8 @@ class BookmarkManager::BookmarkTreeView : public QTreeView { Q_OBJECT public: - BookmarkTreeView(QWidget *parent = 0); - ~BookmarkTreeView() {} + BookmarkTreeView(QWidget *parent = nullptr); + ~BookmarkTreeView() override {} void subclassKeyPressEvent(QKeyEvent *event); @@ -142,7 +142,7 @@ signals: void editingDone(); protected slots: - void commitData(QWidget *editor); + void commitData(QWidget *editor) override; private slots: void setExpandedData(const QModelIndex &index); diff --git a/src/assistant/assistant/bookmarkmanagerwidget.cpp b/src/assistant/assistant/bookmarkmanagerwidget.cpp index 76d857963..ba4f5cfd4 100644 --- a/src/assistant/assistant/bookmarkmanagerwidget.cpp +++ b/src/assistant/assistant/bookmarkmanagerwidget.cpp @@ -188,7 +188,7 @@ void BookmarkManagerWidget::findPrevious() void BookmarkManagerWidget::importBookmarks() { TRACE_OBJ - const QString &fileName = QFileDialog::getOpenFileName(0, tr("Open File"), + const QString &fileName = QFileDialog::getOpenFileName(nullptr, tr("Open File"), QDir::currentPath(), tr("Files (*.xbel)")); if (fileName.isEmpty()) @@ -204,7 +204,7 @@ void BookmarkManagerWidget::importBookmarks() void BookmarkManagerWidget::exportBookmarks() { TRACE_OBJ - QString fileName = QFileDialog::getSaveFileName(0, tr("Save File"), + QString fileName = QFileDialog::getSaveFileName(nullptr, tr("Save File"), QLatin1String("untitled.xbel"), tr("Files (*.xbel)")); const QLatin1String suffix(".xbel"); @@ -268,10 +268,10 @@ void BookmarkManagerWidget::customContextMenuRequested(const QPoint &point) if (!bookmarkModel->parent(index).isValid()) return; - QAction *remove = 0; - QAction *rename = 0; - QAction *showItem = 0; - QAction *showItemInNewTab = 0; + QAction *remove = nullptr; + QAction *rename = nullptr; + QAction *showItem = nullptr; + QAction *showItemInNewTab = nullptr; QMenu menu; if (bookmarkModel->data(index, UserRoleFolder).toBool()) { diff --git a/src/assistant/assistant/bookmarkmanagerwidget.h b/src/assistant/assistant/bookmarkmanagerwidget.h index 231bb4b25..cc439d5ed 100644 --- a/src/assistant/assistant/bookmarkmanagerwidget.h +++ b/src/assistant/assistant/bookmarkmanagerwidget.h @@ -45,8 +45,8 @@ class BookmarkManagerWidget : public QWidget Q_OBJECT public: explicit BookmarkManagerWidget(BookmarkModel *bookmarkModel, - QWidget *parent = 0); - ~BookmarkManagerWidget(); + QWidget *parent = nullptr); + ~BookmarkManagerWidget() override; protected: void closeEvent(QCloseEvent *event) override; diff --git a/src/assistant/assistant/bookmarkmodel.cpp b/src/assistant/assistant/bookmarkmodel.cpp index 58ebee95d..e80842d45 100644 --- a/src/assistant/assistant/bookmarkmodel.cpp +++ b/src/assistant/assistant/bookmarkmodel.cpp @@ -42,7 +42,7 @@ BookmarkModel::BookmarkModel() : QAbstractItemModel() , m_folder(false) , m_editable(false) - , rootItem(0) + , rootItem(nullptr) { } @@ -236,20 +236,19 @@ BookmarkModel::data(const QModelIndex &index, int role) const if (index.isValid()) { if (BookmarkItem *item = itemFromIndex(index)) { switch (role) { - case Qt::EditRole: { + case Qt::EditRole: case Qt::DisplayRole: if (index.data(UserRoleFolder).toBool() && index.column() == 1) return QString(); return item->data(index.column()); - } break; - case Qt::DecorationRole: { + case Qt::DecorationRole: if (index.column() == 0) return index.data(UserRoleFolder).toBool() ? folderIcon : bookmarkIcon; - } break; + break; - default:; + default: return item->data(role); } } @@ -363,7 +362,7 @@ QMimeData* BookmarkModel::mimeData(const QModelIndexList &indexes) const { if (indexes.isEmpty()) - return 0; + return nullptr; QByteArray data; QDataStream stream(&data, QIODevice::WriteOnly); diff --git a/src/assistant/assistant/bookmarkmodel.h b/src/assistant/assistant/bookmarkmodel.h index 15965510b..998e7d7ca 100644 --- a/src/assistant/assistant/bookmarkmodel.h +++ b/src/assistant/assistant/bookmarkmodel.h @@ -45,7 +45,7 @@ class BookmarkModel : public QAbstractItemModel Q_OBJECT public: BookmarkModel(); - ~BookmarkModel(); + ~BookmarkModel() override; QByteArray bookmarks() const; void setBookmarks(const QByteArray &bookmarks); diff --git a/src/assistant/assistant/centralwidget.cpp b/src/assistant/assistant/centralwidget.cpp index 6efa2fe62..d2eb02945 100644 --- a/src/assistant/assistant/centralwidget.cpp +++ b/src/assistant/assistant/centralwidget.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE namespace { - CentralWidget *staticCentralWidget = 0; + CentralWidget *staticCentralWidget = nullptr; } // -- TabBar @@ -184,7 +184,7 @@ void TabBar::slotCustomContextMenuRequested(const QPoint &pos) CentralWidget::CentralWidget(QWidget *parent) : QWidget(parent) #ifndef QT_NO_PRINTER - , m_printer(0) + , m_printer(nullptr) #endif , m_findWidget(new FindWidget(this)) , m_stackedWidget(new QStackedWidget(this)) @@ -462,7 +462,7 @@ void CentralWidget::find(const QString &ttf, bool forward, bool incremental) TRACE_OBJ bool found = false; if (HelpViewer *viewer = currentHelpViewer()) { - HelpViewer::FindFlags flags = 0; + HelpViewer::FindFlags flags; if (!forward) flags |= HelpViewer::FindBackward; if (m_findWidget->caseSensitive()) @@ -546,7 +546,7 @@ void CentralWidget::highlightSearchTerms() HelpViewer *viewer = currentHelpViewer(); for (const QString &word : words) - viewer->findText(word, 0, false, true); + viewer->findText(word, nullptr, false, true); disconnect(viewer, &HelpViewer::loadFinished, this, &CentralWidget::highlightSearchTerms); } diff --git a/src/assistant/assistant/centralwidget.h b/src/assistant/assistant/centralwidget.h index 614949478..34de716a4 100644 --- a/src/assistant/assistant/centralwidget.h +++ b/src/assistant/assistant/centralwidget.h @@ -61,7 +61,7 @@ signals: void addBookmark(const QString &title, const QString &url); private: - TabBar(QWidget *parent = 0); + TabBar(QWidget *parent = nullptr); private slots: void slotCurrentChanged(int index); @@ -75,8 +75,8 @@ class CentralWidget : public QWidget friend class OpenPagesManager; public: - CentralWidget(QWidget *parent = 0); - ~CentralWidget(); + CentralWidget(QWidget *parent = nullptr); + ~CentralWidget() override; static CentralWidget *instance(); diff --git a/src/assistant/assistant/contentwindow.h b/src/assistant/assistant/contentwindow.h index 30b2b80c4..3fb9c18da 100644 --- a/src/assistant/assistant/contentwindow.h +++ b/src/assistant/assistant/contentwindow.h @@ -45,7 +45,7 @@ class ContentWindow : public QWidget public: ContentWindow(); - ~ContentWindow(); + ~ContentWindow() override; bool syncToContent(const QUrl &url); void expandToDepth(int depth); diff --git a/src/assistant/assistant/filternamedialog.h b/src/assistant/assistant/filternamedialog.h index db2635f69..8e46bfd0b 100644 --- a/src/assistant/assistant/filternamedialog.h +++ b/src/assistant/assistant/filternamedialog.h @@ -39,7 +39,7 @@ class FilterNameDialog : public QDialog Q_OBJECT public: - FilterNameDialog(QWidget *parent = 0); + FilterNameDialog(QWidget *parent = nullptr); QString filterName() const; private slots: diff --git a/src/assistant/assistant/findwidget.h b/src/assistant/assistant/findwidget.h index 9b3e3ffbd..c4f3090a2 100644 --- a/src/assistant/assistant/findwidget.h +++ b/src/assistant/assistant/findwidget.h @@ -41,8 +41,8 @@ class FindWidget : public QWidget { Q_OBJECT public: - FindWidget(QWidget *parent = 0); - ~FindWidget(); + FindWidget(QWidget *parent = nullptr); + ~FindWidget() override; void show(); void showAndClear(); diff --git a/src/assistant/assistant/globalactions.h b/src/assistant/assistant/globalactions.h index 083c656d4..a3a4dec63 100644 --- a/src/assistant/assistant/globalactions.h +++ b/src/assistant/assistant/globalactions.h @@ -42,7 +42,7 @@ class GlobalActions : public QObject Q_OBJECT Q_DISABLE_COPY(GlobalActions) public: - static GlobalActions *instance(QObject *parent = 0); + static GlobalActions *instance(QObject *parent = nullptr); QList<QAction *> actionList() const { return m_actionList; } QAction *backAction() const { return m_backAction; } diff --git a/src/assistant/assistant/helpbrowsersupport.cpp b/src/assistant/assistant/helpbrowsersupport.cpp index 1fcf2453c..86f44f9c8 100644 --- a/src/assistant/assistant/helpbrowsersupport.cpp +++ b/src/assistant/assistant/helpbrowsersupport.cpp @@ -168,7 +168,7 @@ public: protected: QNetworkReply *createRequest(Operation op, - const QNetworkRequest &request, QIODevice *outgoingData = 0) override; + const QNetworkRequest &request, QIODevice *outgoingData = nullptr) override; }; HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent) diff --git a/src/assistant/assistant/helpbrowsersupport.h b/src/assistant/assistant/helpbrowsersupport.h index 6246365dc..d10056645 100644 --- a/src/assistant/assistant/helpbrowsersupport.h +++ b/src/assistant/assistant/helpbrowsersupport.h @@ -61,7 +61,7 @@ public: static QByteArray fileDataForLocalUrl(const QUrl &url); // Create an instance of QNetworkAccessManager for WebKit-type browsers. - static QNetworkAccessManager *createNetworkAccessManager(QObject *parent = 0); + static QNetworkAccessManager *createNetworkAccessManager(QObject *parent = nullptr); }; QT_END_NAMESPACE diff --git a/src/assistant/assistant/helpenginewrapper.cpp b/src/assistant/assistant/helpenginewrapper.cpp index 73f3ace32..921c66b20 100644 --- a/src/assistant/assistant/helpenginewrapper.cpp +++ b/src/assistant/assistant/helpenginewrapper.cpp @@ -112,7 +112,7 @@ const QString HelpEngineWrapper::TrUnfiltered() return s; } -HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; +HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = nullptr; HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) { @@ -130,7 +130,7 @@ void HelpEngineWrapper::removeInstance() { TRACE_OBJ delete helpEngineWrapper; - helpEngineWrapper = 0; + helpEngineWrapper = nullptr; } HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) diff --git a/src/assistant/assistant/helpviewer.cpp b/src/assistant/assistant/helpviewer.cpp index 8c97f463f..889b0e983 100644 --- a/src/assistant/assistant/helpviewer.cpp +++ b/src/assistant/assistant/helpviewer.cpp @@ -72,7 +72,7 @@ struct ExtensionMap { { ".mng", "video/x-mng" }, { ".pbm", "image/x-portable-bitmap" }, { ".pgm", "image/x-portable-graymap" }, - { ".pdf", 0 }, + { ".pdf", nullptr }, { ".png", "image/png" }, { ".ppm", "image/x-portable-pixmap" }, { ".rss", "application/rss+xml" }, @@ -89,8 +89,8 @@ struct ExtensionMap { { ".xhtml", "application/xhtml+xml" }, { ".wml", "text/vnd.wap.wml" }, { ".wmlc", "application/vnd.wap.wmlc" }, - { "about:blank", 0 }, - { 0, 0 } + { "about:blank", nullptr }, + { nullptr, nullptr } }; HelpViewer::~HelpViewer() diff --git a/src/assistant/assistant/helpviewer.h b/src/assistant/assistant/helpviewer.h index 36404dcee..00e941000 100644 --- a/src/assistant/assistant/helpviewer.h +++ b/src/assistant/assistant/helpviewer.h @@ -66,8 +66,8 @@ public: }; Q_DECLARE_FLAGS(FindFlags, FindFlag) - HelpViewer(qreal zoom, QWidget *parent = 0); - ~HelpViewer(); + HelpViewer(qreal zoom, QWidget *parent = nullptr); + ~HelpViewer() override; QFont viewerFont() const; void setViewerFont(const QFont &font); diff --git a/src/assistant/assistant/helpviewer_p.h b/src/assistant/assistant/helpviewer_p.h index cd36e8592..8a85fdcea 100644 --- a/src/assistant/assistant/helpviewer_p.h +++ b/src/assistant/assistant/helpviewer_p.h @@ -51,9 +51,6 @@ public: #if defined(BROWSER_QTEXTBROWSER) HelpViewerPrivate(int zoom) : zoomCount(zoom) - , forceFont(false) - , lastAnchor(QString()) - , m_loadFinished(false) { } #elif defined(BROWSER_QTWEBKIT) HelpViewerPrivate() @@ -98,9 +95,9 @@ public slots: } public: - int zoomCount; - bool forceFont; QString lastAnchor; + int zoomCount; + bool forceFont = false; private: @@ -120,7 +117,7 @@ private: #endif // BROWSER_QTWEBKIT public: - bool m_loadFinished; + bool m_loadFinished = false; }; diff --git a/src/assistant/assistant/helpviewer_qtb.cpp b/src/assistant/assistant/helpviewer_qtb.cpp index 0ed234542..b522e1ba2 100644 --- a/src/assistant/assistant/helpviewer_qtb.cpp +++ b/src/assistant/assistant/helpviewer_qtb.cpp @@ -334,9 +334,9 @@ void HelpViewer::contextMenuEvent(QContextMenuEvent *event) { TRACE_OBJ - QMenu menu(QString(), 0); + QMenu menu(QString(), nullptr); QUrl link; - QAction *copyAnchorAction = 0; + QAction *copyAnchorAction = nullptr; if (d->hasAnchorAt(this, event->pos())) { link = anchorAt(event->pos()); if (link.isRelative()) diff --git a/src/assistant/assistant/indexwindow.h b/src/assistant/assistant/indexwindow.h index af585b48f..647d3b3b9 100644 --- a/src/assistant/assistant/indexwindow.h +++ b/src/assistant/assistant/indexwindow.h @@ -43,8 +43,8 @@ class IndexWindow : public QWidget Q_OBJECT public: - IndexWindow(QWidget *parent = 0); - ~IndexWindow(); + IndexWindow(QWidget *parent = nullptr); + ~IndexWindow() override; void setSearchLineEditText(const QString &text); QString searchLineEditText() const diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp index d81cc45fd..392af9224 100644 --- a/src/assistant/assistant/mainwindow.cpp +++ b/src/assistant/assistant/mainwindow.cpp @@ -89,13 +89,7 @@ enum { warnAboutMissingModules = 0 }; MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) : QMainWindow(parent) - , m_bookmarkWidget(0) - , m_filterCombo(0) - , m_toolBarMenu(0) , m_cmdLine(cmdLine) - , m_progressWidget(0) - , m_qtDocInstaller(0) - , m_connectedInitSignals(false) { TRACE_OBJ @@ -495,8 +489,8 @@ void MainWindow::checkInitState() } } else { if (m_connectedInitSignals) { - disconnect(helpEngine.contentModel(), 0, this, 0); - disconnect(helpEngine.indexModel(), 0, this, 0); + disconnect(helpEngine.contentModel(), nullptr, this, nullptr); + disconnect(helpEngine.indexModel(), nullptr, this, nullptr); } HelpEngineWrapper::instance().initialDocSetupDone(); emit initDone(); @@ -1109,7 +1103,7 @@ void MainWindow::indexingFinished() TRACE_OBJ statusBar()->removeWidget(m_progressWidget); delete m_progressWidget; - m_progressWidget = 0; + m_progressWidget = nullptr; } QString MainWindow::collectionFileDirectory(bool createDir, const QString &cacheDir) diff --git a/src/assistant/assistant/mainwindow.h b/src/assistant/assistant/mainwindow.h index b0db48be6..657a15825 100644 --- a/src/assistant/assistant/mainwindow.h +++ b/src/assistant/assistant/mainwindow.h @@ -56,8 +56,8 @@ class MainWindow : public QMainWindow Q_OBJECT public: - explicit MainWindow(CmdLineParser *cmdLine, QWidget *parent = 0); - ~MainWindow(); + explicit MainWindow(CmdLineParser *cmdLine, QWidget *parent = nullptr); + ~MainWindow() override; static void activateCurrentBrowser(); static QString collectionFileDirectory(bool createDir = false, @@ -126,15 +126,13 @@ private slots: void handlePageCountChanged(); private: - QWidget *m_bookmarkWidget; - -private: + QWidget *m_bookmarkWidget = nullptr; CentralWidget *m_centralWidget; IndexWindow *m_indexWindow; ContentWindow *m_contentWindow; SearchWidget *m_searchWindow; QLineEdit *m_addressLineEdit; - QComboBox *m_filterCombo; + QComboBox *m_filterCombo = nullptr; QAction *m_syncAction; QAction *m_printPreviewAction; @@ -145,14 +143,14 @@ private: QAction *m_newTabAction; QMenu *m_viewMenu; - QMenu *m_toolBarMenu; + QMenu *m_toolBarMenu = nullptr; CmdLineParser *m_cmdLine; - QWidget *m_progressWidget; - QtDocInstaller *m_qtDocInstaller; + QWidget *m_progressWidget = nullptr; + QtDocInstaller *m_qtDocInstaller = nullptr; - bool m_connectedInitSignals; + bool m_connectedInitSignals = false; }; QT_END_NAMESPACE diff --git a/src/assistant/assistant/openpagesmanager.cpp b/src/assistant/assistant/openpagesmanager.cpp index 61c2d6b08..3151cb534 100644 --- a/src/assistant/assistant/openpagesmanager.cpp +++ b/src/assistant/assistant/openpagesmanager.cpp @@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE -OpenPagesManager *OpenPagesManager::m_instance = 0; +OpenPagesManager *OpenPagesManager::m_instance = nullptr; OpenPagesManager *OpenPagesManager::createInstance(QObject *parent, bool defaultCollection, const QUrl &cmdLineUrl) @@ -64,8 +64,6 @@ OpenPagesManager::OpenPagesManager(QObject *parent, bool defaultCollection, const QUrl &cmdLineUrl) : QObject(parent) , m_model(new OpenPagesModel(this)) - , m_openPagesWidget(0) - , m_openPagesSwitcher(0) { TRACE_OBJ m_openPagesWidget = new OpenPagesWidget(m_model); @@ -89,7 +87,7 @@ OpenPagesManager::OpenPagesManager(QObject *parent, bool defaultCollection, OpenPagesManager ::~OpenPagesManager() { TRACE_OBJ - m_instance = 0; + m_instance = nullptr; delete m_openPagesSwitcher; } @@ -147,7 +145,7 @@ void OpenPagesManager::setupInitialPages(bool defaultCollection, break; } default: - Q_ASSERT(!"Unhandled option"); + Q_ASSERT(0); } if (m_model->rowCount() == 0) @@ -181,7 +179,7 @@ HelpViewer *OpenPagesManager::createPage(const QUrl &url, bool fromSearch) { TRACE_OBJ if (HelpViewer::launchWithExternalApp(url)) - return 0; + return nullptr; emit aboutToAddPage(); diff --git a/src/assistant/assistant/openpagesmanager.h b/src/assistant/assistant/openpagesmanager.h index 387ae4d31..10f97f1bb 100644 --- a/src/assistant/assistant/openpagesmanager.h +++ b/src/assistant/assistant/openpagesmanager.h @@ -98,8 +98,8 @@ private: void showSwitcherOrSelectPage() const; OpenPagesModel *m_model; - OpenPagesWidget *m_openPagesWidget; - OpenPagesSwitcher *m_openPagesSwitcher; + OpenPagesWidget *m_openPagesWidget = nullptr; + OpenPagesSwitcher *m_openPagesSwitcher = nullptr; static OpenPagesManager *m_instance; }; diff --git a/src/assistant/assistant/openpagesswitcher.cpp b/src/assistant/assistant/openpagesswitcher.cpp index 30acd6bd5..df9350140 100644 --- a/src/assistant/assistant/openpagesswitcher.cpp +++ b/src/assistant/assistant/openpagesswitcher.cpp @@ -44,7 +44,7 @@ const int gWidth = 300; const int gHeight = 200; OpenPagesSwitcher::OpenPagesSwitcher(OpenPagesModel *model) - : QFrame(0, Qt::Popup) + : QFrame(nullptr, Qt::Popup) , m_openPagesModel(model) { TRACE_OBJ diff --git a/src/assistant/assistant/openpagesswitcher.h b/src/assistant/assistant/openpagesswitcher.h index eb76b9067..9b49e14ed 100644 --- a/src/assistant/assistant/openpagesswitcher.h +++ b/src/assistant/assistant/openpagesswitcher.h @@ -43,7 +43,7 @@ class OpenPagesSwitcher : public QFrame public: OpenPagesSwitcher(OpenPagesModel *model); - ~OpenPagesSwitcher(); + ~OpenPagesSwitcher() override; void gotoNextPage(); void gotoPreviousPage(); diff --git a/src/assistant/assistant/openpageswidget.cpp b/src/assistant/assistant/openpageswidget.cpp index c22906617..6400fd97d 100644 --- a/src/assistant/assistant/openpageswidget.cpp +++ b/src/assistant/assistant/openpageswidget.cpp @@ -184,7 +184,7 @@ void OpenPagesWidget::handleClicked(const QModelIndex &index) QWidget *vp = viewport(); const QPoint &cursorPos = QCursor::pos(); QMouseEvent e(QEvent::MouseMove, vp->mapFromGlobal(cursorPos), cursorPos, - Qt::NoButton, 0, 0); + Qt::NoButton, nullptr, nullptr); QCoreApplication::sendEvent(vp, &e); } } diff --git a/src/assistant/assistant/openpageswidget.h b/src/assistant/assistant/openpageswidget.h index ed3900b3a..7f2f5913a 100644 --- a/src/assistant/assistant/openpageswidget.h +++ b/src/assistant/assistant/openpageswidget.h @@ -40,7 +40,7 @@ class OpenPagesDelegate : public QStyledItemDelegate { Q_OBJECT public: - explicit OpenPagesDelegate(QObject *parent = 0); + explicit OpenPagesDelegate(QObject *parent = nullptr); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; @@ -52,7 +52,7 @@ class OpenPagesWidget : public QTreeView Q_OBJECT public: OpenPagesWidget(OpenPagesModel *model); - ~OpenPagesWidget(); + ~OpenPagesWidget() override; void selectCurrentPage(); void allowContextMenu(bool ok); diff --git a/src/assistant/assistant/preferencesdialog.cpp b/src/assistant/assistant/preferencesdialog.cpp index 4652d0187..d231f7a30 100644 --- a/src/assistant/assistant/preferencesdialog.cpp +++ b/src/assistant/assistant/preferencesdialog.cpp @@ -279,7 +279,7 @@ void PreferencesDialog::updateFilterMap() return; QStringList newAtts; - QTreeWidgetItem *itm = 0; + QTreeWidgetItem *itm = nullptr; for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { itm = m_ui.attributeWidget->topLevelItem(i); if (itm->checkState(0) == Qt::Checked) diff --git a/src/assistant/assistant/preferencesdialog.h b/src/assistant/assistant/preferencesdialog.h index d87749bf9..4842dcbfb 100644 --- a/src/assistant/assistant/preferencesdialog.h +++ b/src/assistant/assistant/preferencesdialog.h @@ -45,8 +45,8 @@ class PreferencesDialog : public QDialog Q_OBJECT public: - PreferencesDialog(QWidget *parent = 0); - ~PreferencesDialog(); + PreferencesDialog(QWidget *parent = nullptr); + ~PreferencesDialog() override; void showDialog(); diff --git a/src/assistant/assistant/qtdocinstaller.h b/src/assistant/assistant/qtdocinstaller.h index bbbf98f60..5feee223a 100644 --- a/src/assistant/assistant/qtdocinstaller.h +++ b/src/assistant/assistant/qtdocinstaller.h @@ -46,7 +46,7 @@ class QtDocInstaller : public QThread public: typedef QPair<QString, QStringList> DocInfo; QtDocInstaller(const QList<DocInfo> &docInfos); - ~QtDocInstaller(); + ~QtDocInstaller() override; void installDocs(); signals: diff --git a/src/assistant/assistant/remotecontrol.cpp b/src/assistant/assistant/remotecontrol.cpp index 1c16ac104..cab7b5db6 100644 --- a/src/assistant/assistant/remotecontrol.cpp +++ b/src/assistant/assistant/remotecontrol.cpp @@ -56,12 +56,7 @@ QT_BEGIN_NAMESPACE RemoteControl::RemoteControl(MainWindow *mainWindow) : QObject(mainWindow) , m_mainWindow(mainWindow) - , m_debug(false) - , m_caching(true) - , m_syncContents(false) - , m_expandTOC(-2) , helpEngine(HelpEngineWrapper::instance()) - { TRACE_OBJ connect(m_mainWindow, &MainWindow::initDone, @@ -82,7 +77,7 @@ void RemoteControl::handleCommandString(const QString &cmdString) splitInputString(command, cmd, arg); if (m_debug) - QMessageBox::information(0, tr("Debugging Remote Control"), + QMessageBox::information(nullptr, tr("Debugging Remote Control"), tr("Received Command: %1 %2").arg(cmd).arg(arg)); if (cmd == QLatin1String("debug")) diff --git a/src/assistant/assistant/remotecontrol.h b/src/assistant/assistant/remotecontrol.h index 9a958f792..781d563f5 100644 --- a/src/assistant/assistant/remotecontrol.h +++ b/src/assistant/assistant/remotecontrol.h @@ -65,16 +65,16 @@ private: private: MainWindow *m_mainWindow; - bool m_debug; - - bool m_caching; QUrl m_setSource; - bool m_syncContents; QString m_activateKeyword; QString m_activateIdentifier; - int m_expandTOC; QString m_currentFilter; HelpEngineWrapper &helpEngine; + int m_expandTOC = -2; + bool m_debug = false; + + bool m_caching = true; + bool m_syncContents = false; }; QT_END_NAMESPACE diff --git a/src/assistant/assistant/searchwidget.h b/src/assistant/assistant/searchwidget.h index 8a8a4e719..29443bb52 100644 --- a/src/assistant/assistant/searchwidget.h +++ b/src/assistant/assistant/searchwidget.h @@ -45,8 +45,8 @@ class SearchWidget : public QWidget Q_OBJECT public: - explicit SearchWidget(QHelpSearchEngine *engine, QWidget *parent = 0); - ~SearchWidget(); + explicit SearchWidget(QHelpSearchEngine *engine, QWidget *parent = nullptr); + ~SearchWidget() override; void zoomIn(); void zoomOut(); diff --git a/src/assistant/assistant/topicchooser.h b/src/assistant/assistant/topicchooser.h index 4817ea010..730ad68a0 100644 --- a/src/assistant/assistant/topicchooser.h +++ b/src/assistant/assistant/topicchooser.h @@ -43,7 +43,7 @@ class TopicChooser : public QDialog public: TopicChooser(QWidget *parent, const QString &keyword, const QMap<QString, QUrl> &links); - ~TopicChooser(); + ~TopicChooser() override; QUrl link() const; diff --git a/src/assistant/help/qhelpcollectionhandler.cpp b/src/assistant/help/qhelpcollectionhandler.cpp index 162c79ea9..77e15f560 100644 --- a/src/assistant/help/qhelpcollectionhandler.cpp +++ b/src/assistant/help/qhelpcollectionhandler.cpp @@ -331,7 +331,7 @@ bool QHelpCollectionHandler::copyCollectionFile(const QString &fileName) const QString &colFile = fi.absoluteFilePath(); const QString &connectionName = QHelpGlobal::uniquifyConnectionName( QLatin1String("QHelpCollectionHandlerCopy"), this); - QSqlQuery *copyQuery = 0; + QSqlQuery *copyQuery = nullptr; bool openingOk = true; { QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), connectionName); @@ -651,7 +651,7 @@ bool QHelpCollectionHandler::registerDocumentation(const QString &fileName) return false; QHelpDBReader reader(fileName, QHelpGlobal::uniquifyConnectionName( - QLatin1String("QHelpCollectionHandler"), this), 0); + QLatin1String("QHelpCollectionHandler"), this), nullptr); if (!reader.init()) { emit error(tr("Cannot open documentation file %1.").arg(fileName)); return false; diff --git a/src/assistant/help/qhelpcollectionhandler_p.h b/src/assistant/help/qhelpcollectionhandler_p.h index d349a49f2..57b591a3d 100644 --- a/src/assistant/help/qhelpcollectionhandler_p.h +++ b/src/assistant/help/qhelpcollectionhandler_p.h @@ -93,7 +93,7 @@ public: }; explicit QHelpCollectionHandler(const QString &collectionFile, - QObject *parent = 0); + QObject *parent = nullptr); ~QHelpCollectionHandler(); QString collectionFile() const; diff --git a/src/assistant/help/qhelpcontentwidget.cpp b/src/assistant/help/qhelpcontentwidget.cpp index 101da8818..3d73ee425 100644 --- a/src/assistant/help/qhelpcontentwidget.cpp +++ b/src/assistant/help/qhelpcontentwidget.cpp @@ -74,7 +74,7 @@ class QHelpContentProvider : public QThread Q_OBJECT public: QHelpContentProvider(QHelpEnginePrivate *helpEngine); - ~QHelpContentProvider(); + ~QHelpContentProvider() override; void collectContents(const QString &customFilterName); void stopCollecting(); QHelpContentItem *rootItem(); @@ -229,7 +229,7 @@ QHelpContentItem *QHelpContentProvider::rootItem() { QMutexLocker locker(&m_mutex); if (m_rootItems.isEmpty()) - return 0; + return nullptr; return m_rootItems.dequeue(); } @@ -260,10 +260,10 @@ void QHelpContentProvider::run() QString title; QString link; int depth = 0; - QHelpContentItem *item = 0; + QHelpContentItem *item = nullptr; m_mutex.lock(); - QHelpContentItem * const rootItem = new QHelpContentItem(QString(), QString(), 0); + QHelpContentItem * const rootItem = new QHelpContentItem(QString(), QString(), nullptr); const QStringList attributes = m_filterAttributes; const QString collectionFile = m_helpEngine->collectionHandler->collectionFile(); m_mutex.unlock(); @@ -395,7 +395,7 @@ void QHelpContentModel::invalidateContents(bool onShutDown) d->qhelpContentProvider->stopCollecting(); if (d->rootItem) { delete d->rootItem; - d->rootItem = 0; + d->rootItem = nullptr; } if (!onShutDown) endResetModel(); @@ -535,7 +535,7 @@ QVariant QHelpContentModel::data(const QModelIndex &index, int role) const */ QHelpContentWidget::QHelpContentWidget() - : QTreeView(0) + : QTreeView(nullptr) { header()->hide(); setUniformRowHeights(true); diff --git a/src/assistant/help/qhelpcontentwidget.h b/src/assistant/help/qhelpcontentwidget.h index efe311164..01594d60f 100644 --- a/src/assistant/help/qhelpcontentwidget.h +++ b/src/assistant/help/qhelpcontentwidget.h @@ -81,7 +81,7 @@ class QHELP_EXPORT QHelpContentModel : public QAbstractItemModel Q_OBJECT public: - ~QHelpContentModel(); + ~QHelpContentModel() override; void createContents(const QString &customFilterName); QHelpContentItem *contentItemAt(const QModelIndex &index) const; diff --git a/src/assistant/help/qhelpdbreader.cpp b/src/assistant/help/qhelpdbreader.cpp index ae687ebed..89cb134a0 100644 --- a/src/assistant/help/qhelpdbreader.cpp +++ b/src/assistant/help/qhelpdbreader.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE QHelpDBReader::QHelpDBReader(const QString &dbName) - : QObject(0), + : QObject(nullptr), m_dbName(dbName), m_uniqueId(QHelpGlobal::uniquifyConnectionName(QLatin1String("QHelpDBReader"), this)) diff --git a/src/assistant/help/qhelpenginecore.cpp b/src/assistant/help/qhelpenginecore.cpp index de5981a06..238fbfce3 100644 --- a/src/assistant/help/qhelpenginecore.cpp +++ b/src/assistant/help/qhelpenginecore.cpp @@ -217,7 +217,7 @@ void QHelpEngineCore::setCollectionFile(const QString &fileName) if (d->collectionHandler) { delete d->collectionHandler; - d->collectionHandler = 0; + d->collectionHandler = nullptr; d->emitReadersAboutToBeInvalidated(); } d->init(fileName, this); @@ -270,7 +270,7 @@ QString QHelpEngineCore::namespaceName(const QString &documentationFileName) { QHelpDBReader reader(documentationFileName, QHelpGlobal::uniquifyConnectionName(QLatin1String("GetNamespaceName"), - QThread::currentThread()), 0); + QThread::currentThread()), nullptr); if (reader.init()) return reader.namespaceName(); return QString(); @@ -603,7 +603,7 @@ bool QHelpEngineCore::setCustomValue(const QString &key, const QVariant &value) QVariant QHelpEngineCore::metaData(const QString &documentationFileName, const QString &name) { - QHelpDBReader reader(documentationFileName, QLatin1String("GetMetaData"), 0); + QHelpDBReader reader(documentationFileName, QLatin1String("GetMetaData"), nullptr); if (reader.init()) return reader.metaData(name); diff --git a/src/assistant/help/qhelpgenerator.cpp b/src/assistant/help/qhelpgenerator.cpp index 690a983d0..85adfcac5 100644 --- a/src/assistant/help/qhelpgenerator.cpp +++ b/src/assistant/help/qhelpgenerator.cpp @@ -237,9 +237,9 @@ void QHelpGenerator::setupProgress(QHelpDataInterface *helpData) // contents 10% // files 60% // indices 27% - d->contentStep = 10.0/(double)helpData->customFilters().count(); - d->fileStep = 60.0/(double)numberOfFiles; - d->indexStep = 27.0/(double)numberOfIndices; + d->contentStep = 10.0/double(helpData->customFilters().count()); + d->fileStep = 60.0/double(numberOfFiles); + d->indexStep = 27.0/double(numberOfIndices); } void QHelpGenerator::addProgress(double step) @@ -256,7 +256,7 @@ void QHelpGenerator::cleanupDB() if (d->query) { d->query->clear(); delete d->query; - d->query = 0; + d->query = nullptr; } QSqlDatabase::removeDatabase(QLatin1String("builder")); } diff --git a/src/assistant/help/qhelpgenerator_p.h b/src/assistant/help/qhelpgenerator_p.h index 9c980ff34..449752530 100644 --- a/src/assistant/help/qhelpgenerator_p.h +++ b/src/assistant/help/qhelpgenerator_p.h @@ -65,7 +65,7 @@ class QHELP_EXPORT QHelpGenerator : public QObject Q_OBJECT public: - QHelpGenerator(QObject *parent = 0); + QHelpGenerator(QObject *parent = nullptr); ~QHelpGenerator(); bool generate(QHelpDataInterface *helpData, diff --git a/src/assistant/help/qhelpindexwidget.cpp b/src/assistant/help/qhelpindexwidget.cpp index bc7ebe80e..10b2863e6 100644 --- a/src/assistant/help/qhelpindexwidget.cpp +++ b/src/assistant/help/qhelpindexwidget.cpp @@ -56,7 +56,7 @@ class QHelpIndexProvider : public QThread { public: QHelpIndexProvider(QHelpEnginePrivate *helpEngine); - ~QHelpIndexProvider(); + ~QHelpIndexProvider() override; void collectIndices(const QString &customFilterName); void stopCollecting(); QStringList indices() const; @@ -319,7 +319,7 @@ QModelIndex QHelpIndexModel::filter(const QString &filter, const QString &wildca */ QHelpIndexWidget::QHelpIndexWidget() - : QListView(0) + : QListView(nullptr) { setEditTriggers(QAbstractItemView::NoEditTriggers); setUniformItemSizes(true); diff --git a/src/assistant/help/qhelpprojectdata.cpp b/src/assistant/help/qhelpprojectdata.cpp index 1fd600fd9..90bf75a5f 100644 --- a/src/assistant/help/qhelpprojectdata.cpp +++ b/src/assistant/help/qhelpprojectdata.cpp @@ -196,7 +196,7 @@ void QHelpProjectDataPrivate::readFilterSection() void QHelpProjectDataPrivate::readTOC() { QStack<QHelpDataContentItem*> contentStack; - QHelpDataContentItem *itm = 0; + QHelpDataContentItem *itm = nullptr; while (!atEnd()) { readNext(); if (isStartElement()) { @@ -204,7 +204,7 @@ void QHelpProjectDataPrivate::readTOC() const QString &title = attributes().value(QLatin1String("title")).toString(); const QString &ref = attributes().value(QLatin1String("ref")).toString(); if (contentStack.isEmpty()) { - itm = new QHelpDataContentItem(0, title, ref); + itm = new QHelpDataContentItem(nullptr, title, ref); filterSectionList.last().addContent(itm); } else { itm = new QHelpDataContentItem(contentStack.top(), title, ref); diff --git a/src/assistant/help/qhelpprojectdata_p.h b/src/assistant/help/qhelpprojectdata_p.h index 1e4af4287..1abd12c1c 100644 --- a/src/assistant/help/qhelpprojectdata_p.h +++ b/src/assistant/help/qhelpprojectdata_p.h @@ -62,7 +62,7 @@ class QHELP_EXPORT QHelpProjectData : public QHelpDataInterface { public: QHelpProjectData(); - ~QHelpProjectData(); + ~QHelpProjectData() override; bool readData(const QString &fileName); QString errorMessage() const; diff --git a/src/assistant/help/qhelpsearchindexreader_default.cpp b/src/assistant/help/qhelpsearchindexreader_default.cpp index 1154e49f0..25f9a13f2 100644 --- a/src/assistant/help/qhelpsearchindexreader_default.cpp +++ b/src/assistant/help/qhelpsearchindexreader_default.cpp @@ -203,7 +203,7 @@ void QHelpSearchIndexReaderDefault::run() if (searchInput.isEmpty()) return; - QHelpEngineCore engine(collectionFile, 0); + QHelpEngineCore engine(collectionFile, nullptr); if (!engine.setupData()) return; diff --git a/src/assistant/help/qhelpsearchindexreader_p.h b/src/assistant/help/qhelpsearchindexreader_p.h index 476f3d077..f6f3ee305 100644 --- a/src/assistant/help/qhelpsearchindexreader_p.h +++ b/src/assistant/help/qhelpsearchindexreader_p.h @@ -69,7 +69,7 @@ class QHelpSearchIndexReader : public QThread Q_OBJECT public: - ~QHelpSearchIndexReader(); + ~QHelpSearchIndexReader() override; void cancelSearching(); void search(const QString &collectionFile, diff --git a/src/assistant/help/qhelpsearchindexwriter_default.cpp b/src/assistant/help/qhelpsearchindexwriter_default.cpp index 11d92ab5d..806d0182a 100644 --- a/src/assistant/help/qhelpsearchindexwriter_default.cpp +++ b/src/assistant/help/qhelpsearchindexwriter_default.cpp @@ -376,7 +376,7 @@ void QHelpSearchIndexWriter::run() lock.unlock(); - QHelpEngineCore engine(collectionFile, 0); + QHelpEngineCore engine(collectionFile, nullptr); if (!engine.setupData()) return; diff --git a/src/assistant/help/qhelpsearchindexwriter_default_p.h b/src/assistant/help/qhelpsearchindexwriter_default_p.h index f63f17d49..d6233d574 100644 --- a/src/assistant/help/qhelpsearchindexwriter_default_p.h +++ b/src/assistant/help/qhelpsearchindexwriter_default_p.h @@ -103,7 +103,7 @@ class QHelpSearchIndexWriter : public QThread public: QHelpSearchIndexWriter(); - ~QHelpSearchIndexWriter(); + ~QHelpSearchIndexWriter() override; void cancelIndexing(); void updateIndex(const QString &collectionFile, diff --git a/src/assistant/help/qhelpsearchquerywidget.cpp b/src/assistant/help/qhelpsearchquerywidget.cpp index 7364c7cae..8cea26a83 100644 --- a/src/assistant/help/qhelpsearchquerywidget.cpp +++ b/src/assistant/help/qhelpsearchquerywidget.cpp @@ -103,7 +103,7 @@ private: { } - ~QHelpSearchQueryWidgetPrivate() + ~QHelpSearchQueryWidgetPrivate() override { // nothing todo } @@ -193,7 +193,6 @@ private slots: private: friend class QHelpSearchQueryWidget; - bool m_compactMode = false; QLabel *m_searchLabel = nullptr; QPushButton *m_searchButton = nullptr; QLineEdit *m_lineEdit = nullptr; @@ -201,6 +200,7 @@ private: QToolButton *m_prevQueryButton = nullptr; QueryHistory m_queries; QCompleter m_searchCompleter; + bool m_compactMode = false; }; #include "qhelpsearchquerywidget.moc" diff --git a/src/assistant/help/qhelpsearchquerywidget.h b/src/assistant/help/qhelpsearchquerywidget.h index f5f13139e..52a137db1 100644 --- a/src/assistant/help/qhelpsearchquerywidget.h +++ b/src/assistant/help/qhelpsearchquerywidget.h @@ -61,7 +61,7 @@ class QHELP_EXPORT QHelpSearchQueryWidget : public QWidget public: explicit QHelpSearchQueryWidget(QWidget *parent = nullptr); - ~QHelpSearchQueryWidget(); + ~QHelpSearchQueryWidget() override; void expandExtendedSearch(); void collapseExtendedSearch(); diff --git a/src/assistant/help/qhelpsearchresultwidget.cpp b/src/assistant/help/qhelpsearchresultwidget.cpp index e0ca3cc08..887916aca 100644 --- a/src/assistant/help/qhelpsearchresultwidget.cpp +++ b/src/assistant/help/qhelpsearchresultwidget.cpp @@ -61,7 +61,7 @@ class QResultWidget : public QTextBrowser Q_OBJECT public: - QResultWidget(QWidget *parent = 0) + QResultWidget(QWidget *parent = nullptr) : QTextBrowser(parent) { connect(this, &QTextBrowser::anchorClicked, @@ -208,7 +208,7 @@ private: last), isIndexing); } - hitsLabel->setText(QHelpSearchResultWidget::tr("%1 - %2 of %n Hits", 0, count).arg(first).arg(last)); + hitsLabel->setText(QHelpSearchResultWidget::tr("%1 - %2 of %n Hits", nullptr, count).arg(first).arg(last)); firstResultPage->setEnabled(resultFirstToShow); previousResultPage->setEnabled(resultFirstToShow); lastResultPage->setEnabled(count - last); @@ -224,14 +224,13 @@ private: static const int ResultsRange = 20; - int resultFirstToShow = 0; - bool isIndexing = false; - QToolButton *firstResultPage = nullptr; QToolButton *previousResultPage = nullptr; - QLabel *hitsLabel = nullptr; QToolButton *nextResultPage = nullptr; QToolButton *lastResultPage = nullptr; + QLabel *hitsLabel = nullptr; + int resultFirstToShow = 0; + bool isIndexing = false; }; #include "qhelpsearchresultwidget.moc" diff --git a/src/assistant/help/qhelpsearchresultwidget.h b/src/assistant/help/qhelpsearchresultwidget.h index 95fe3b016..4cb802527 100644 --- a/src/assistant/help/qhelpsearchresultwidget.h +++ b/src/assistant/help/qhelpsearchresultwidget.h @@ -58,7 +58,7 @@ class QHELP_EXPORT QHelpSearchResultWidget : public QWidget Q_OBJECT public: - ~QHelpSearchResultWidget(); + ~QHelpSearchResultWidget() override; QUrl linkAt(const QPoint &point); Q_SIGNALS: |