| 184 | } |
| 185 | |
| 186 | void |
| 187 | DocumentWindow::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 | |
| 220 | void |
| 221 | DocumentWindow::enableShellOpen() |
nothing calls this directly
no test coverage detected