CMakeProjectManager: Rework CMakeFormatter

Use PagedSettings, make setup more local, remove Q_OBJECT

Change-Id: I9e91f9e63ed8ad15749323bd039d118562dba1a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
hjk
2023-05-11 08:49:06 +02:00
parent 72d9decb87
commit 9dad4ab9d4
9 changed files with 176 additions and 445 deletions

View File

@@ -4,35 +4,20 @@
#pragma once
#include <texteditor/command.h>
namespace Core { class IDocument; }
#include "cmakeformatteroptionspage.h"
namespace CMakeProjectManager::Internal {
namespace Core {
class IDocument;
class IEditor;
}
namespace CMakeProjectManager {
namespace Internal {
class CMakeFormatter : public QObject
class CMakeFormatter
{
Q_OBJECT
public:
void updateActions(Core::IEditor *editor);
TextEditor::Command command() const;
bool isApplicable(const Core::IDocument *document) const;
CMakeFormatter();
~CMakeFormatter();
void initialize();
void applyIfNecessary(Core::IDocument *document) const;
private:
void formatFile();
QAction *m_formatFile = nullptr;
CMakeFormatterOptionsPage m_page;
class CMakeFormatterPrivate *d = nullptr;
};
} // namespace Internal
} // namespace CMakeProjectManager
} // CMakeProjectManager::Internal