From cf70a25be4036f6bb71a82ba1ce9e776e25a2ee8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 18 Nov 2022 21:43:53 +0100 Subject: [PATCH] statistics: remove old unused statistics code This never came to be - no point in carrying it around. Signed-off-by: Berthold Stoeger --- CMakeLists.txt | 2 - desktop-widgets/CMakeLists.txt | 9 ----- .../statistics/statisticswidget.cpp | 40 ------------------- desktop-widgets/statistics/statisticswidget.h | 24 ----------- 4 files changed, 75 deletions(-) delete mode 100644 desktop-widgets/statistics/statisticswidget.cpp delete mode 100644 desktop-widgets/statistics/statisticswidget.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e1bd39bb9..3ffd6dd36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -493,7 +493,6 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable") subsurface_generated_ui subsurface_interface subsurface_profile - subsurface_statistics ${SUBSURFACE_MAPWIDGET} subsurface_backend_shared subsurface_models_desktop @@ -503,7 +502,6 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable") ${SUBSURFACE_LINK_LIBRARIES} ) add_dependencies(subsurface_desktop_preferences subsurface_generated_ui) - add_dependencies(subsurface_statistics subsurface_generated_ui) add_dependencies(subsurface_interface subsurface_generated_ui) add_dependencies(subsurface_profile subsurface_generated_ui) add_dependencies(subsurface_models_desktop subsurface_generated_ui) diff --git a/desktop-widgets/CMakeLists.txt b/desktop-widgets/CMakeLists.txt index add1f170a..9bc71e5e3 100644 --- a/desktop-widgets/CMakeLists.txt +++ b/desktop-widgets/CMakeLists.txt @@ -181,21 +181,12 @@ endif() source_group("Subsurface Interface" FILES ${SUBSURFACE_INTERFACE}) -# the yearly statistics widget. -set(SUBSURFACE_STATISTICS_LIB_SRCS - statistics/statisticswidget.cpp - statistics/statisticswidget.h -) -source_group("Subsurface Statistics" FILES ${SUBSURFACE_STATISTICS_LIB_SRCS}) - if(NOT USINGQT6) qt5_wrap_ui(SUBSURFACE_UI_SRCS ${SUBSURFACE_UI}) else() qt_wrap_ui(SUBSURFACE_UI_SRCS ${SUBSURFACE_UI}) endif() -add_library(subsurface_statistics STATIC ${SUBSURFACE_STATISTICS_LIB_SRCS}) -target_link_libraries(subsurface_statistics ${QT_LIBRARIES}) add_library(subsurface_generated_ui STATIC ${SUBSURFACE_UI_HDRS}) target_link_libraries(subsurface_generated_ui ${QT_LIBRARIES}) add_library(subsurface_interface STATIC ${SUBSURFACE_INTERFACE} ${SUBSURFACE_UI_SRCS}) diff --git a/desktop-widgets/statistics/statisticswidget.cpp b/desktop-widgets/statistics/statisticswidget.cpp deleted file mode 100644 index 1f1014415..000000000 --- a/desktop-widgets/statistics/statisticswidget.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "desktop-widgets/statistics/statisticswidget.h" -#include "qt-models/yearlystatisticsmodel.h" -#include - -YearlyStatisticsWidget::YearlyStatisticsWidget(QWidget *parent): - QGraphicsView(parent), - m_model(NULL) -{ -} - -void YearlyStatisticsWidget::setModel(YearlyStatisticsModel *m) -{ - m_model = m; - connect(m, SIGNAL(dataChanged(QModelIndex,QModelIndex)), - this, SLOT(modelDataChanged(QModelIndex,QModelIndex))); - connect(m, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), - scene(), SLOT(clear())); - connect(m, SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(modelRowsInserted(QModelIndex,int,int))); - - modelRowsInserted(QModelIndex(),0,m_model->rowCount()-1); -} - -void YearlyStatisticsWidget::modelRowsInserted(const QModelIndex&, int, int) -{ - // stub -} - -void YearlyStatisticsWidget::modelDataChanged(const QModelIndex&, const QModelIndex&) -{ - scene()->clear(); - modelRowsInserted(QModelIndex(),0,m_model->rowCount()-1); -} - -void YearlyStatisticsWidget::resizeEvent(QResizeEvent *event) -{ - QGraphicsView::resizeEvent(event); - fitInView(sceneRect(), Qt::IgnoreAspectRatio); -} diff --git a/desktop-widgets/statistics/statisticswidget.h b/desktop-widgets/statistics/statisticswidget.h deleted file mode 100644 index 4ffd3ff88..000000000 --- a/desktop-widgets/statistics/statisticswidget.h +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef YEARLYSTATISTICSWIDGET_H -#define YEARLYSTATISTICSWIDGET_H - -#include - -class YearlyStatisticsModel; -class QModelIndex; - -class YearlyStatisticsWidget : public QGraphicsView { - Q_OBJECT -public: - YearlyStatisticsWidget(QWidget *parent = 0); - void setModel(YearlyStatisticsModel *m); -protected: - void resizeEvent(QResizeEvent *event) override; -public slots: - void modelRowsInserted(const QModelIndex& index, int first, int last); - void modelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); -private: - YearlyStatisticsModel *m_model; -}; - -#endif