MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / annotateWithFilename

Method annotateWithFilename

src/openms_gui/source/VISUAL/LayerDataBase.cpp:126–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 }
125
126 bool LayerAnnotatorBase::annotateWithFilename(LayerDataBase& layer, LogWindow& log, const String& fname) const
127 {
128 if (fname.empty())
129 {
130 return false;
131 }
132 FileTypes::Type type = FileHandler::getType(fname);
133
134 if (!supported_types_.contains(type))
135 {
136 log.appendNewHeader(LogWindow::LogState::NOTICE, "Error", String("Filename '" + fname + "' has unsupported file type. No annotation performed.").toQString());
137 return false;
138 }
139
140 GUIHelpers::GUILock glock(gui_lock_);
141 bool success = annotateWorker_(layer, fname, log);
142
143 if (success)
144 {
145 log.appendNewHeader(LogWindow::LogState::NOTICE, "Done", "Annotation finished. Open the corresponding view to see results!");
146 }
147 return success;
148 }
149
150 std::unique_ptr<LayerAnnotatorBase> LayerAnnotatorBase::getAnnotatorWhichSupports(const FileTypes::Type& type)
151 {

Callers 1

loadFilesMethod · 0.80

Calls 6

getTypeFunction · 0.85
appendNewHeaderMethod · 0.80
StringClass · 0.50
emptyMethod · 0.45
containsMethod · 0.45
toQStringMethod · 0.45

Tested by

no test coverage detected