MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / FindNotepad

Function FindNotepad

lib/mdflib/mdfviewer/src/util/logging.cpp:77–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77std::string FindNotepad() {
78 std::string note;
79 // 1. Find the path to the 'notepad++.exe'
80 try {
81 auto notepad = boost::process::environment::find_executable("notepad++");
82 if (!notepad.string().empty()) {
83 note = notepad.string();
84 }
85 } catch (const std::exception &) {
86 note.clear();
87 }
88
89 if (!note.empty()) {
90 return note;
91 }
92
93 // 2. Find the path to the 'notepad.exe'
94 try {
95 auto notepad = boost::process::environment::find_executable("notepad");
96 if (!notepad.string().empty()) {
97 note = notepad.string();
98 }
99 } catch (const std::exception &) {
100 note.clear();
101 }
102
103 if (!note.empty()) {
104 return note;
105 }
106
107 // 3. Find the path to the 'gedit' GNOME editor
108 try {
109 auto notepad = boost::process::environment::find_executable("gedit");
110 if (!notepad.string().empty()) {
111 note = notepad.string();
112 }
113 } catch (const std::exception &) {
114 note.clear();
115 }
116 return note;
117}
118
119bool BackupFiles(const std::string &filename, bool remove_file) {
120 if (filename.empty()) {

Callers 1

OnInitMethod · 0.85

Calls 2

emptyMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected