forked from qt-creator/qt-creator
		
	Git: Support Log for selected commit in git editors
Change-Id: I5081471b3be65de1948d9bfdd52fd812df5e6a7a Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
		
				
					committed by
					
						
						Orgad Shaneh
					
				
			
			
				
	
			
			
			
						parent
						
							690a545f8e
						
					
				
				
					commit
					478a2e86f9
				
			@@ -892,16 +892,22 @@ void GitClient::status(const QString &workingDirectory)
 | 
			
		||||
void GitClient::log(const QString &workingDirectory, const QString &fileName,
 | 
			
		||||
                    bool enableAnnotationContextMenu, const QStringList &args)
 | 
			
		||||
{
 | 
			
		||||
    const QString msgArg = fileName.isEmpty() ? workingDirectory : fileName;
 | 
			
		||||
    QString msgArg;
 | 
			
		||||
    if (!fileName.isEmpty())
 | 
			
		||||
        msgArg = fileName;
 | 
			
		||||
    else if (!args.isEmpty())
 | 
			
		||||
        msgArg = args.first();
 | 
			
		||||
    else
 | 
			
		||||
        msgArg = workingDirectory;
 | 
			
		||||
    const QString title = tr("Git Log \"%1\"").arg(msgArg);
 | 
			
		||||
    const Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
 | 
			
		||||
    const QString sourceFile = VcsBaseEditor::getSource(workingDirectory, fileName);
 | 
			
		||||
    VcsBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile);
 | 
			
		||||
    VcsBaseEditorWidget *editor = findExistingVCSEditor("logTitle", msgArg);
 | 
			
		||||
    if (!editor) {
 | 
			
		||||
        auto *argWidget = new GitLogArgumentsWidget(settings());
 | 
			
		||||
        connect(argWidget, &VcsBaseEditorParameterWidget::commandExecutionRequested,
 | 
			
		||||
                [=]() { this->log(workingDirectory, fileName, enableAnnotationContextMenu, args); });
 | 
			
		||||
        editor = createVcsEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile,
 | 
			
		||||
        editor = createVcsEditor(editorId, title, sourceFile, CodecLogOutput, "logTitle", msgArg,
 | 
			
		||||
                                 argWidget);
 | 
			
		||||
    }
 | 
			
		||||
    editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user