forked from qt-creator/qt-creator
CompilerExplorer: Implement saving documents
Change-Id: Iccfd300a9f0fc25bafae9892c14f172874a99ce1 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -34,11 +34,10 @@ public:
|
||||
|
||||
auto action = new QAction(Tr::tr("Open Compiler Explorer"), this);
|
||||
connect(action, &QAction::triggered, this, [] {
|
||||
CompilerExplorer::Settings settings;
|
||||
|
||||
const QString src = settings.source();
|
||||
QString name("Compiler Explorer");
|
||||
EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, src.toUtf8());
|
||||
Core::EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID,
|
||||
&name,
|
||||
settings().defaultDocument().toUtf8());
|
||||
});
|
||||
|
||||
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||
@@ -47,11 +46,12 @@ public:
|
||||
menu->setTitle(Tr::tr("Compiler Explorer"));
|
||||
mtools->addMenu(mCompilerExplorer);
|
||||
|
||||
Command *cmd = ActionManager::registerAction(action, "CompilerExplorer.CompilerExplorerAction");
|
||||
Command *cmd = ActionManager::registerAction(action,
|
||||
"CompilerExplorer.CompilerExplorerAction");
|
||||
mCompilerExplorer->addAction(cmd);
|
||||
}
|
||||
};
|
||||
|
||||
} // CompilerExplorer::Internl
|
||||
} // namespace CompilerExplorer::Internal
|
||||
|
||||
#include "compilerexplorerplugin.moc"
|
||||
|
||||
Reference in New Issue
Block a user