File indexing completed on 2025-01-05 05:14:40

0001 /*
0002 SPDX-FileCopyrightText: 2022 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #include "authorswidget.h"
0008 
0009 #include "gitmanager.h"
0010 #include "models/authorsmodel.h"
0011 
0012 #include <QSortFilterProxyModel>
0013 
0014 AuthorsWidget::AuthorsWidget(Git::Manager *git, AppWindow *parent)
0015     : WidgetBase(git, parent)
0016 {
0017     setupUi(this);
0018     treeViewAuthors->setSortingEnabled(true);
0019 
0020     auto sortingModel = new QSortFilterProxyModel(this);
0021     sortingModel->setSourceModel(mGit->authorsModel());
0022     treeViewAuthors->setModel(sortingModel);
0023 }
0024 
0025 void AuthorsWidget::saveState(QSettings &settings) const
0026 {
0027     save(settings, treeViewAuthors);
0028 }
0029 
0030 void AuthorsWidget::restoreState(QSettings &settings)
0031 {
0032     restore(settings, treeViewAuthors);
0033 }
0034 
0035 #include "moc_authorswidget.cpp"