Skip to content

Commit 1ccc827

Browse files
committed
refactor(ui): remove unused tree view stubs
* Remove dead context-menu compression wiring and empty handler to cut unused UI paths * Drop a no-op paint override to simplify event flow * Remove an unused helper for resolving target directory index to reduce API surface * Expand widget documentation to clarify intent and maintenance
1 parent 2fc92fd commit 1ccc827

3 files changed

Lines changed: 276 additions & 153 deletions

File tree

src/ui/widgets/FilePage.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
/**
2+
* Copyright (C) 2021-2024 Saturneric <eric@bktus.com>
3+
*
4+
* This file is part of GpgFrontend.
5+
*
6+
* GpgFrontend is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* GpgFrontend is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>.
18+
*
19+
* The initial version of the source code is inherited from
20+
* the gpg4usb project, which is under GPL-3.0-or-later.
21+
*
22+
* All the source code of GpgFrontend was modified and released by
23+
* Saturneric <eric@bktus.com> starting on May 12, 2021.
24+
*
25+
* SPDX-License-Identifier: GPL-3.0-or-later
26+
*
27+
*/
28+
129
#pragma once
230

331
#include "ui/widgets/InfoBoardWidget.h"

src/ui/widgets/FileTreeView.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,6 @@ void FileTreeView::slot_create_popup_menu() {
542542
new QAction(QIcon::fromTheme(QStringLiteral("archive-insert")),
543543
tr("Compress..."), this);
544544
action_compress_files_->setVisible(false);
545-
connect(action_compress_files_, &QAction::triggered, this,
546-
&FileTreeView::slot_compress_files);
547545

548546
action_copy_path_ = new QAction(QIcon::fromTheme(QStringLiteral("edit-copy")),
549547
tr("Copy Path"), this);
@@ -679,17 +677,6 @@ void FileTreeView::slot_calculate_hash() {
679677
});
680678
}
681679

682-
void FileTreeView::slot_compress_files() {}
683-
684-
void FileTreeView::paintEvent(QPaintEvent* event) {
685-
QTreeView::paintEvent(event);
686-
687-
// if (!initial_resize_done_) {
688-
// slot_adjust_column_widths();
689-
// initial_resize_done_ = true;
690-
// }
691-
}
692-
693680
void FileTreeView::mousePressEvent(QMouseEvent* event) {
694681
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
695682
auto pos = event->position().toPoint();
@@ -783,21 +770,6 @@ void FileTreeView::SetPath(const QString& target_path) {
783770
}
784771
}
785772

786-
auto FileTreeView::current_target_directory_index() const -> QModelIndex {
787-
auto index = currentIndex();
788-
789-
if (!index.isValid()) {
790-
return rootIndex();
791-
}
792-
793-
const auto info = dir_model_->fileInfo(index);
794-
if (info.isDir()) {
795-
return index;
796-
}
797-
798-
return index.parent().isValid() ? index.parent() : rootIndex();
799-
}
800-
801773
auto FileTreeView::current_target_directory_path() const -> QString {
802774
auto index = currentIndex();
803775

0 commit comments

Comments
 (0)