MCPcopy Create free account
hub / github.com/KDE/kdiff3 / GetCommandString

Method GetCommandString

diff_ext_for_kdiff3/diff_ext.cpp:343–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343STDMETHODIMP
344DIFF_EXT::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT*, LPSTR pszName, UINT cchMax)
345{
346 HRESULT ret = NOERROR;
347
348 if(uFlags == GCS_HELPTEXT)
349 {
350 QString helpString;
351 if(idCmd == m_id_Diff)
352 {
353 helpString = i18nc("Contexualmenu option", "Compare selected files");
354 }
355 else if(idCmd == m_id_DiffWith)
356 {
357 if(!m_recentFiles.empty())
358 {
359 helpString = i18nc("Contexualmenu option", "Compare '%1' with '%2'", toQString(_file_name1), toQString(m_recentFiles.front()));
360 }
361 }
362 else if(idCmd == m_id_DiffLater)
363 {
364 helpString = i18nc("Contexualmenu option", "Save '%1' for later operation", toQString(_file_name1));
365 }
366 else if((idCmd >= m_id_DiffWith_Base) && (idCmd < m_id_DiffWith_Base + m_recentFiles.size()))
367 {
368 if(!m_recentFiles.empty())
369 {
370 unsigned long long num = idCmd - m_id_DiffWith_Base;
371 std::list<tstring>::iterator i = m_recentFiles.begin();
372 for(unsigned long long j = 0; j < num && i != m_recentFiles.end(); j++)
373 i++;
374
375 if(i != m_recentFiles.end())
376 {
377 helpString = i18nc("Contexualmenu option", "Compare '%1' with '%2'", toQString(_file_name1), toQString(*i));
378 }
379 }
380 }
381 lstrcpyn((LPTSTR)pszName, fromQString(helpString).c_str(), cchMax);
382 }
383 else
384 {
385 ret = E_INVALIDARG;
386 }
387
388 return ret;
389}
390
391void DIFF_EXT::diff(const tstring& arguments)
392{

Callers

nothing calls this directly

Calls 2

endMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected