MCPcopy Create free account
hub / github.com/KDE/kdevelop / createFile

Function createFile

plugins/projectmanagerview/projectmanagerviewplugin.cpp:686–699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684}
685
686ProjectFileItem* createFile(const ProjectFolderItem* item)
687{
688 QWidget* window = ICore::self()->uiController()->activeMainWindow()->window();
689 QString name = QInputDialog::getText(window, i18nc("@title:window", "Create File in %1", item->path().pathOrUrl()), i18nc("@label:textbox", "File name:"));
690
691 if(name.isEmpty())
692 return nullptr;
693
694 ProjectFileItem* ret = item->project()->projectFileManager()->addFile( Path(item->path(), name), item->folder() );
695 if (ret) {
696 ICore::self()->documentController()->openDocument( ret->path().toUrl() );
697 }
698 return ret;
699}
700
701void ProjectManagerViewPlugin::createFileFromContextMenu( )
702{

Callers 1

Calls 14

windowMethod · 0.80
uiControllerMethod · 0.80
pathOrUrlMethod · 0.80
projectFileManagerMethod · 0.80
folderMethod · 0.80
documentControllerMethod · 0.80
PathClass · 0.70
activeMainWindowMethod · 0.45
pathMethod · 0.45
isEmptyMethod · 0.45
addFileMethod · 0.45
projectMethod · 0.45

Tested by

no test coverage detected