File indexing completed on 2025-01-05 05:14:50
0001 /* 0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "appdialog.h" 0010 #include "libkommitwidgets_export.h" 0011 #include "ui_searchdialog.h" 0012 0013 namespace Git 0014 { 0015 class Manager; 0016 } 0017 0018 class QStandardItemModel; 0019 class LIBKOMMITWIDGETS_EXPORT SearchDialog : public AppDialog, private Ui::SearchDialog 0020 { 0021 Q_OBJECT 0022 0023 public: 0024 explicit SearchDialog(const QString &path, Git::Manager *git, QWidget *parent = nullptr); 0025 explicit SearchDialog(Git::Manager *git, QWidget *parent = nullptr); 0026 0027 void initModel(); 0028 0029 private: 0030 void slotPushButtonSearchClicked(); 0031 void slotTreeViewDoubleClicked(const QModelIndex &index); 0032 void beginSearch(); 0033 void searchOnPlace(const QString &place, const QString &commit); 0034 0035 // QObject interface 0036 protected: 0037 void timerEvent(QTimerEvent *event) override; 0038 0039 private: 0040 struct { 0041 int value; 0042 int total; 0043 QString message; 0044 } mProgress; 0045 QStandardItemModel *mModel{nullptr}; 0046 };