File indexing completed on 2024-05-12 04:39:28

0001 /*
0002     SPDX-FileCopyrightText: 2006 Matt Rogers <mattr@kde.org>
0003     SPDX-FileCopyrightText: 2007 Aleix Pol <aleixpol@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef CMAKEPREFERENCES_H
0009 #define CMAKEPREFERENCES_H
0010 
0011 #include "cmakecachemodel.h"
0012 #include "cmakeextraargumentshistory.h"
0013 
0014 #include <project/projectconfigpage.h>
0015 #include <util/path.h>
0016 
0017 class CMakeSettings;
0018 
0019 namespace Ui { class CMakeBuildSettings; }
0020 
0021 /**
0022  * @author Matt Rogers <mattr@kde.org>
0023  * @author Aleix Pol <aleixpol@gmail.com>
0024  */
0025 class CMakePreferences : public KDevelop::ConfigPage
0026 {
0027     Q_OBJECT
0028     public:
0029         explicit CMakePreferences(KDevelop::IPlugin* plugin, const KDevelop::ProjectConfigOptions& options, QWidget* parent = nullptr);
0030         ~CMakePreferences() override;
0031 
0032         QString name() const override;
0033         QString fullName() const override;
0034         QIcon icon() const override;
0035 
0036         void apply() override;
0037         void reset() override;
0038         void defaults() override;
0039 
0040     private Q_SLOTS:
0041         void listSelectionChanged ( const QModelIndex& current, const QModelIndex& );
0042         void showInternal(int state);
0043         void cacheEdited(QStandardItem * ) { emit changed(); }
0044         void buildDirChanged(int index);
0045         void cacheUpdated();
0046         void createBuildDir();
0047         void removeBuildDir();
0048         void showAdvanced(bool v);
0049         void configureCacheView();
0050     private:
0051         void configure();
0052         void initAdvanced();
0053         void setBuildType(const QString& buildType);
0054 
0055         KDevelop::IProject* m_project;
0056         KDevelop::Path m_srcFolder;
0057         KDevelop::Path m_subprojFolder;
0058         void updateCache( const KDevelop::Path & );
0059         Ui::CMakeBuildSettings* m_prefsUi;
0060         CMakeCacheModel* m_currentModel;
0061         CMakeExtraArgumentsHistory* m_extraArgumentsHistory;
0062 };
0063 
0064 #endif