MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / registerCommand

Method registerCommand

Gui/FileTypeMainWindow_win.cpp:186–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void
187DocumentWindow::registerCommand(const QString& command,
188 const QString& documentId,
189 const QString cmdLineArg,
190 const QString ddeCommand)
191{
192 QString commandLine = QDir::toNativeSeparators( qApp->applicationFilePath() );
193
194 commandLine.prepend( QLatin1String("\"") );
195 commandLine.append( QLatin1String("\"") );
196
197 if ( !cmdLineArg.isEmpty() ) {
198 commandLine.append( QLatin1Char(' ') );
199 commandLine.append(cmdLineArg);
200 }
201
202 if ( !SetHkcrUserRegKey(QString::fromUtf8("%1\\shell\\%2\\command").arg(documentId).arg(command), commandLine) ) {
203 return; // just skip it
204 }
205 if (m_registerForDDE) {
206 if ( !SetHkcrUserRegKey(QString::fromUtf8("%1\\shell\\%2\\ddeexec").arg(documentId).arg(command), ddeCommand) ) {
207 return;
208 }
209
210 if ( !SetHkcrUserRegKey(QString::fromUtf8("%1\\shell\\%2\\ddeexec\\application").arg(documentId).arg(command), m_appAtomName) ) {
211 return;
212 }
213
214 if ( !SetHkcrUserRegKey(QString::fromUtf8("%1\\shell\\%2\\ddeexec\\topic").arg(documentId).arg(command), m_systemTopicAtomName) ) {
215 return;
216 }
217 }
218}
219
220void
221DocumentWindow::enableShellOpen()

Callers

nothing calls this directly

Calls 4

toNativeSeparatorsFunction · 0.85
applicationFilePathMethod · 0.80
appendMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected