forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user