File indexing completed on 2024-05-19 16:49:47

0001 // SPDX-FileCopyrightText: 2020 Simon Persson <simon.persson@mykolab.com>
0002 //
0003 // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 #ifndef FILEDIGGER_H
0006 #define FILEDIGGER_H
0007 
0008 #include <KMainWindow>
0009 #include <QUrl>
0010 
0011 class KDirOperator;
0012 class MergedVfsModel;
0013 class MergedRepository;
0014 class VersionListModel;
0015 class QListView;
0016 class QModelIndex;
0017 class QTreeView;
0018 
0019 class FileDigger : public KMainWindow
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit FileDigger(QString pRepoPath, QString pBranchName, QWidget *pParent = nullptr);
0024     QSize sizeHint() const override;
0025 
0026 protected slots:
0027     void updateVersionModel(const QModelIndex &pCurrent, const QModelIndex &pPrevious);
0028     void open(const QModelIndex &pIndex);
0029     void restore(const QModelIndex &pIndex);
0030     void repoPathAvailable();
0031     void checkFileWidgetPath();
0032     void enterUrl(const QUrl &pUrl);
0033 
0034 protected:
0035     MergedRepository *createRepo();
0036     void createRepoView(MergedRepository *pRepository);
0037     void createSelectionView();
0038     MergedVfsModel *mMergedVfsModel{};
0039     QTreeView *mMergedVfsView{};
0040 
0041     VersionListModel *mVersionModel{};
0042     QListView *mVersionView{};
0043     QString mRepoPath;
0044     QString mBranchName;
0045     KDirOperator *mDirOperator;
0046 };
0047 
0048 #endif // FILEDIGGER_H