2012-10-02 09:12:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/****************************************************************************
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								* * 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-15 14:57:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								* *  Copyright  ( C )  2016  The  Qt  Company  Ltd . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  Contact :  https : //www.qt.io/licensing/
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								* * 
							 
						 
					
						
							
								
									
										
										
										
											2012-10-02 09:12:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								* *  This  file  is  part  of  Qt  Creator . 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								* * 
							 
						 
					
						
							
								
									
										
										
										
											2012-10-02 09:12:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								* *  Commercial  License  Usage 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  Licensees  holding  valid  commercial  Qt  licenses  may  use  this  file  in 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  accordance  with  the  commercial  license  agreement  provided  with  the 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  Software  or ,  alternatively ,  in  accordance  with  the  terms  contained  in 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-15 14:57:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								* *  a  written  agreement  between  you  and  The  Qt  Company .  For  licensing  terms 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  and  conditions  see  https : //www.qt.io/terms-conditions. For further
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  information  use  the  contact  form  at  https : //www.qt.io/contact-us.
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 14:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								* * 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-15 14:57:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								* *  GNU  General  Public  License  Usage 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  Alternatively ,  this  file  may  be  used  under  the  terms  of  the  GNU 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  General  Public  License  version  3  as  published  by  the  Free  Software 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  Foundation  with  exceptions  as  appearing  in  the  file  LICENSE . GPL3 - EXCEPT 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  included  in  the  packaging  of  this  file .  Please  review  the  following 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  information  to  ensure  the  GNU  General  Public  License  requirements  will 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* *  be  met :  https : //www.gnu.org/licenses/gpl-3.0.html.
 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-17 16:01:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								* * 
							 
						 
					
						
							
								
									
										
										
										
											2012-10-02 09:12:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 16:19:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "perforceplugin.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-09 15:25:01 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "changenumberdialog.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-09 15:25:01 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "pendingchangesdialog.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "perforcechecker.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "perforceeditor.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "perforcesettings.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-09 15:25:01 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "perforcesubmiteditor.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-01-13 13:39:31 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <coreplugin/actionmanager/actionmanager.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-18 10:59:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <coreplugin/actionmanager/actioncontainer.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <coreplugin/actionmanager/command.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <coreplugin/coreconstants.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-09 15:25:01 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <coreplugin/editormanager/editormanager.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2012-02-14 16:43:51 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <coreplugin/documentmanager.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-09 15:25:01 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <coreplugin/icore.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <coreplugin/messagemanager.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-13 16:17:34 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <coreplugin/locator/commandlocator.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-26 13:22:35 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <texteditor/textdocument.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-04 09:32:46 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <utils/fileutils.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <utils/parameteraction.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-09 15:25:01 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <utils/qtcassert.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <utils/synchronousprocess.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2017-01-19 16:44:22 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <utils/temporarydirectory.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <vcsbase/basevcseditorfactory.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <vcsbase/basevcssubmiteditorfactory.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <vcsbase/vcsbaseconstants.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <vcsbase/vcsbaseeditorconfig.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <vcsbase/vcsbaseeditor.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <vcsbase/vcsbaseplugin.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <vcsbase/vcsoutputwindow.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <QAction> 
 
							 
						 
					
						
							
								
									
										
										
										
											2012-02-15 10:42:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <QDebug> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <QDir> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <QFileDialog> 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <QFileInfo> 
 
							 
						 
					
						
							
								
									
										
										
										
											2012-02-15 10:42:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <QMainWindow> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <QMenu> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <QMessageBox> 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-23 16:02:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <QRegularExpression> 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <QSettings> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <QTextCodec> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								using  namespace  Core ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								using  namespace  Utils ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								using  namespace  VcsBase ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								using  namespace  std : : placeholders ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								namespace  Perforce  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								namespace  Internal  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  SUBMIT_MIMETYPE [ ]  =  " text/vnd.qtcreator.p4.submit " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_CONTEXT [ ]  =  " Perforce Context " ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_SUBMIT_EDITOR_ID [ ]  =  " Perforce.SubmitEditor " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_SUBMIT_EDITOR_DISPLAY_NAME [ ]  =  QT_TRANSLATE_NOOP ( " VCS " ,  " Perforce.SubmitEditor " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_LOG_EDITOR_ID [ ]  =  " Perforce.LogEditor " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_LOG_EDITOR_DISPLAY_NAME [ ]  =  QT_TRANSLATE_NOOP ( " VCS " ,  " Perforce Log Editor " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_DIFF_EDITOR_ID [ ]  =  " Perforce.DiffEditor " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_DIFF_EDITOR_DISPLAY_NAME [ ]  =  QT_TRANSLATE_NOOP ( " VCS " ,  " Perforce Diff Editor " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_ANNOTATION_EDITOR_ID [ ]  =  " Perforce.AnnotationEditor " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  PERFORCE_ANNOTATION_EDITOR_DISPLAY_NAME [ ]  =  QT_TRANSLATE_NOOP ( " VCS " ,  " Perforce Annotation Editor " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Ensure adding "..." to relative paths which is p4's convention
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// for the current directory
 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 15:14:54 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  inline  QString  perforceRelativeFileArguments ( const  QString  & args ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( args . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 15:14:54 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  QLatin1String ( " ... " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  args  +  QLatin1String ( " /... " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  inline  QStringList  perforceRelativeProjectDirectory ( const  VcsBasePluginState  & s ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 15:14:54 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  QStringList ( perforceRelativeFileArguments ( s . relativeCurrentProject ( ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Clean user setting off diff-binary for 'p4 resolve' and 'p4 diff'.
 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 18:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  Environment  overrideDiffEnvironmentVariable ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 18:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    Environment  rc  =  Environment : : systemEnvironment ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    rc . unset ( " P4DIFF " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  rc ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-10 11:02:12 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_PERFORCE_MENU [ ]  =  " Perforce.Menu " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_EDIT [ ]  =  " Perforce.Edit " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_ADD [ ]  =  " Perforce.Add " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_DELETE_FILE [ ]  =  " Perforce.Delete " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_OPENED [ ]  =  " Perforce.Opened " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_PROJECTLOG [ ]  =  " Perforce.ProjectLog " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_REPOSITORYLOG [ ]  =  " Perforce.RepositoryLog " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_REVERT [ ]  =  " Perforce.Revert " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_DIFF_CURRENT [ ]  =  " Perforce.DiffCurrent " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_DIFF_PROJECT [ ]  =  " Perforce.DiffProject " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_UPDATE_PROJECT [ ]  =  " Perforce.UpdateProject " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_REVERT_PROJECT [ ]  =  " Perforce.RevertProject " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_REVERT_UNCHANGED_PROJECT [ ]  =  " Perforce.RevertUnchangedProject " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_DIFF_ALL [ ]  =  " Perforce.DiffAll " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_SUBMIT [ ]  =  " Perforce.Submit " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_PENDING_CHANGES [ ]  =  " Perforce.PendingChanges " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_DESCRIBE [ ]  =  " Perforce.Describe " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_ANNOTATE_CURRENT [ ]  =  " Perforce.AnnotateCurrent " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_ANNOTATE [ ]  =  " Perforce.Annotate " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_FILELOG_CURRENT [ ]  =  " Perforce.FilelogCurrent " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_FILELOG [ ]  =  " Perforce.Filelog " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  char  CMD_ID_UPDATEALL [ ]  =  " Perforce.UpdateAll " ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Helpers
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								struct  PerforceResponse 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    bool  error  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    int  exitCode  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  stdOut ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  stdErr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  message ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  VcsBaseSubmitEditorParameters  submitEditorParameters  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    SUBMIT_MIMETYPE , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PERFORCE_SUBMIT_EDITOR_ID , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PERFORCE_SUBMIT_EDITOR_DISPLAY_NAME , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    VcsBaseSubmitEditorParameters : : DiffFiles 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  VcsBaseEditorParameters  logEditorParameters  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    LogOutput , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PERFORCE_LOG_EDITOR_ID , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PERFORCE_LOG_EDITOR_DISPLAY_NAME , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " text/vnd.qtcreator.p4.log " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  VcsBaseEditorParameters  annotateEditorParameters  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    AnnotateOutput , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PERFORCE_ANNOTATION_EDITOR_ID , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PERFORCE_ANNOTATION_EDITOR_DISPLAY_NAME , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " text/vnd.qtcreator.p4.annotation " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  VcsBaseEditorParameters  diffEditorParameters  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    DiffOutput , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PERFORCE_DIFF_EDITOR_ID , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PERFORCE_DIFF_EDITOR_DISPLAY_NAME , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    " text/x-patch " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Flags for runP4Cmd.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								enum  RunFlags 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    CommandToWindow  =  0x1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    StdOutToWindow  =  0x2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    StdErrToWindow  =  0x4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ErrorToWindow  =  0x8 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    OverrideDiffEnvironment  =  0x10 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // Run completely synchronously, no signals emitted
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    RunFullySynchronous  =  0x20 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    IgnoreExitCode  =  0x40 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ShowBusyCursor  =  0x80 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    LongTimeOut  =  0x100 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    SilentStdOut  =  0x200 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								struct  PerforceDiffParameters 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QString  workingDir ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  diffArguments ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  files ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								class  PerforcePluginPrivate  final  :  public  VcsBasePluginPrivate 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    Q_DECLARE_TR_FUNCTIONS ( Perforce : : Internal : : PerforcePlugin ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								public : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforcePluginPrivate ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // IVersionControl
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  displayName ( )  const  final  {  return  { " perforce " } ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    Id  id ( )  const  final  {  return  VcsBase : : Constants : : VCS_ID_PERFORCE ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  isVcsFileOrDirectory ( const  FilePath  & fileName )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  managesDirectory ( const  QString  & directory ,  QString  * topLevel  =  nullptr )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  managesFile ( const  QString  & workingDirectory ,  const  QString  & fileName )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  isConfigured ( )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  supportsOperation ( Operation  operation )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    OpenSupportMode  openSupportMode ( const  QString  & fileName )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsOpen ( const  QString  & fileName )  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    SettingsFlags  settingsFlags ( )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsAdd ( const  QString  & fileName )  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsDelete ( const  QString  & filename )  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsMove ( const  QString  & from ,  const  QString  & to )  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsCreateRepository ( const  QString  & directory )  final ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:34:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    void  vcsAnnotate ( const  QString  & file ,  int  line )  final ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:50:30 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    void  vcsDescribe ( const  QString  & source ,  const  QString  & n )  final ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QString  vcsOpenText ( )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  vcsMakeWritableText ( )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ///
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsOpen ( const  QString  & workingDir ,  const  QString  & fileName ,  bool  silently  =  false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsAdd ( const  QString  & workingDir ,  const  QString  & fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsDelete ( const  QString  & workingDir ,  const  QString  & filename ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  vcsMove ( const  QString  & workingDir ,  const  QString  & from ,  const  QString  & to ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  p4Diff ( const  QString  & workingDir ,  const  QStringList  & files ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    IEditor  * openPerforceSubmitEditor ( const  QString  & fileName ,  const  QStringList  & depotFileNames ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  getTopLevel ( const  QString  & workingDirectory  =  QString ( ) ,  bool  isSync  =  false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  updateActions ( ActionState )  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  submitEditorAboutToClose ( )  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  commitDisplayName ( )  const  final ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  p4Diff ( const  PerforceDiffParameters  & p ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  openCurrentFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  addCurrentFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  revertCurrentFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  printOpenedFileList ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  diffCurrentFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  diffCurrentProject ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  updateCurrentProject ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  revertCurrentProject ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  revertUnchangedCurrentProject ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  updateAll ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  diffAllOpened ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  startSubmitProject ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  describeChange ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  annotateCurrentFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  annotateFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  filelogCurrentFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  filelogFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  logProject ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  logRepository ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  commitFromEditor ( )  override ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  printPendingChanges ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  slotSubmitDiff ( const  QStringList  & files ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  setTopLevel ( const  QString  & ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  slotTopLevelFailed ( const  QString  & ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    class  DirectoryCacheEntry 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    public : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        DirectoryCacheEntry ( bool  isManaged ,  const  QString  & topLevel ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            m_isManaged ( isManaged ) ,  m_topLevel ( topLevel ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        {  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        bool  m_isManaged ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        QString  m_topLevel ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    typedef  QHash < QString ,  DirectoryCacheEntry >  ManagedDirectoryCache ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    IEditor  * showOutputInEditor ( const  QString  & title ,  const  QString  & output , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                Id  id ,  const  QString  & source , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                QTextCodec  * codec  =  nullptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // args are passed as command line arguments
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // extra args via a tempfile and the option -x "temp-filename"
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceResponse  runP4Cmd ( const  QString  & workingDir , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                              const  QStringList  & args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                              unsigned  flags  =  CommandToWindow | StdErrToWindow | ErrorToWindow , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                              const  QStringList  & extraArgs  =  { } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                              const  QByteArray  & stdInput  =  { } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                              QTextCodec  * outputCodec  =  nullptr )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceResponse  synchronousProcess ( const  QString  & workingDir , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                        const  QStringList  & args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                        unsigned  flags , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                        const  QByteArray  & stdInput , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                        QTextCodec  * outputCodec )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceResponse  fullySynchronousProcess ( const  QString  & workingDir , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             const  QStringList  & args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             unsigned  flags , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             const  QByteArray  & stdInput , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             QTextCodec  * outputCodec )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  clientFilePath ( const  QString  & serverFilePath ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  annotate ( const  QString  & workingDir ,  const  QString  & fileName , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                  const  QString  & changeList  =  QString ( ) ,  int  lineNumber  =  - 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  filelog ( const  QString  & workingDir ,  const  QString  & fileName  =  QString ( ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 bool  enableAnnotationContextMenu  =  false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  changelists ( const  QString  & workingDir ,  const  QString  & fileName  =  QString ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  cleanCommitMessageFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  isCommitEditorOpen ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    static  QSharedPointer < TempFileSaver >  createTemporaryArgumentFile ( const  QStringList  & extraArgs , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                                            QString  * errorString ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  pendingChangesData ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  updateCheckout ( const  QString  & workingDir  =  QString ( ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                        const  QStringList  & dirs  =  QStringList ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  revertProject ( const  QString  & workingDir ,  const  QStringList  & args ,  bool  unchangedOnly ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  managesDirectoryFstat ( const  QString  & directory ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  applySettings ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    CommandLocator  * m_commandLocator  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_editAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_addAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_deleteAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_openedAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_revertFileAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_diffFileAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_diffProjectAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_updateProjectAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_revertProjectAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_revertUnchangedAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_diffAllAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_submitProjectAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_pendingAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_describeAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_annotateCurrentAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_annotateAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_filelogCurrentAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_filelogAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ParameterAction  * m_logProjectAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_logRepositoryAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_updateAllAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  m_submitActionTriggered  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  m_commitMessageFileName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    mutable  QString  m_tempFilePattern ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QAction  * m_menuAction  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceSettings  m_settings ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-06 08:48:21 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    PerforceSettingsPage  m_settingsPage { & m_settings } ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ManagedDirectoryCache  m_managedDirectoryCache ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    VcsSubmitEditorFactory  submitEditorFactory  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        submitEditorParameters , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        [ ]  {  return  new  PerforceSubmitEditor ;  } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        this 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    VcsEditorFactory  logEditorFactory  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        & logEditorParameters , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        [ ]  {  return  new  PerforceEditorWidget ;  } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:50:30 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        std : : bind ( & PerforcePluginPrivate : : vcsDescribe ,  this ,  _1 ,  _2 ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    VcsEditorFactory  annotateEditorFactory  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        & annotateEditorParameters , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        [ ]  {  return  new  PerforceEditorWidget ;  } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:50:30 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        std : : bind ( & PerforcePluginPrivate : : vcsDescribe ,  this ,  _1 ,  _2 ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    VcsEditorFactory  diffEditorFactory  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        & diffEditorParameters , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        [ ]  {  return  new  PerforceEditorWidget ;  } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:50:30 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        std : : bind ( & PerforcePluginPrivate : : vcsDescribe ,  this ,  _1 ,  _2 ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  PerforcePluginPrivate  * dd  =  nullptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								PerforcePluginPrivate : : PerforcePluginPrivate ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    :  VcsBasePluginPrivate ( Context ( PERFORCE_CONTEXT ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    Context  context ( PERFORCE_CONTEXT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    dd  =  this ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_settings . readSettings ( ICore : : settings ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  prefix  =  QLatin1String ( " p4 " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-02 10:08:21 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator  =  new  CommandLocator ( " Perforce " ,  prefix ,  prefix ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-19 09:43:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > setDescription ( tr ( " Triggers a Perforce version control operation. " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    ActionContainer  * mtools  =  ActionManager : : actionContainer ( Core : : Constants : : M_TOOLS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    ActionContainer  * perforceContainer  =  ActionManager : : createMenu ( CMD_ID_PERFORCE_MENU ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > menu ( ) - > setTitle ( tr ( " &Perforce " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    mtools - > addMenu ( perforceContainer ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_menuAction  =  perforceContainer - > menu ( ) - > menuAction ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    Command  * command ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_diffFileAction  =  new  ParameterAction ( tr ( " Diff Current File " ) ,  tr ( " Diff  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_diffFileAction ,  CMD_ID_DIFF_CURRENT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( tr ( " Diff Current File " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_diffFileAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : diffCurrentFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_annotateCurrentAction  =  new  ParameterAction ( tr ( " Annotate Current File " ) ,  tr ( " Annotate  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_annotateCurrentAction ,  CMD_ID_ANNOTATE_CURRENT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( tr ( " Annotate Current File " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_annotateCurrentAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : annotateCurrentFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_filelogCurrentAction  =  new  ParameterAction ( tr ( " Filelog Current File " ) ,  tr ( " Filelog  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_filelogCurrentAction ,  CMD_ID_FILELOG_CURRENT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-02 13:39:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDefaultKeySequence ( QKeySequence ( useMacShortcuts  ?  tr ( " Meta+P,Meta+F " )  :  tr ( " Alt+P,Alt+F " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( tr ( " Filelog Current File " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_filelogCurrentAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : filelogCurrentFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addSeparator ( context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_editAction  =  new  ParameterAction ( tr ( " Edit " ) ,  tr ( " Edit  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_editAction ,  CMD_ID_EDIT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-02 13:39:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDefaultKeySequence ( QKeySequence ( useMacShortcuts  ?  tr ( " Meta+P,Meta+E " )  :  tr ( " Alt+P,Alt+E " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( tr ( " Edit File " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_editAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : openCurrentFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_addAction  =  new  ParameterAction ( tr ( " Add " ) ,  tr ( " Add  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_addAction ,  CMD_ID_ADD ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-02 13:39:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDefaultKeySequence ( QKeySequence ( useMacShortcuts  ?  tr ( " Meta+P,Meta+A " )  :  tr ( " Alt+P,Alt+A " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( tr ( " Add File " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_addAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : addCurrentFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_deleteAction  =  new  ParameterAction ( tr ( " Delete... " ) ,  tr ( " Delete  \" %1 \" ... " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_deleteAction ,  CMD_ID_DELETE_FILE ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( tr ( " Delete File " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_deleteAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : promptToDeleteCurrentFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_revertFileAction  =  new  ParameterAction ( tr ( " Revert " ) ,  tr ( " Revert  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_revertFileAction ,  CMD_ID_REVERT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-02 13:39:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDefaultKeySequence ( QKeySequence ( useMacShortcuts  ?  tr ( " Meta+P,Meta+R " )  :  tr ( " Alt+P,Alt+R " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( tr ( " Revert File " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_revertFileAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : revertCurrentFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addSeparator ( context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  diffProjectDefaultText  =  tr ( " Diff Current Project/Session " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_diffProjectAction  =  new  ParameterAction ( diffProjectDefaultText ,  tr ( " Diff Project  \" %1 \" " ) ,  ParameterAction : : AlwaysEnabled ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_diffProjectAction ,  CMD_ID_DIFF_PROJECT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-02 13:39:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDefaultKeySequence ( QKeySequence ( useMacShortcuts  ?  tr ( " Meta+P,Meta+D " )  :  tr ( " Alt+P,Alt+D " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( diffProjectDefaultText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_diffProjectAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : diffCurrentProject ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_logProjectAction  =  new  ParameterAction ( tr ( " Log Project " ) ,  tr ( " Log Project  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_logProjectAction ,  CMD_ID_PROJECTLOG ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_logProjectAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : logProject ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_submitProjectAction  =  new  ParameterAction ( tr ( " Submit Project " ) ,  tr ( " Submit Project  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_submitProjectAction ,  CMD_ID_SUBMIT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-02 13:39:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDefaultKeySequence ( QKeySequence ( useMacShortcuts  ?  tr ( " Meta+P,Meta+S " )  :  tr ( " Alt+P,Alt+S " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_submitProjectAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : startSubmitProject ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  updateProjectDefaultText  =  tr ( " Update Current Project " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_updateProjectAction  =  new  ParameterAction ( updateProjectDefaultText ,  tr ( " Update Project  \" %1 \" " ) ,  ParameterAction : : AlwaysEnabled ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_updateProjectAction ,  CMD_ID_UPDATE_PROJECT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-01-06 17:13:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDescription ( updateProjectDefaultText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_updateProjectAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : updateCurrentProject ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_revertUnchangedAction  =  new  ParameterAction ( tr ( " Revert Unchanged " ) ,  tr ( " Revert Unchanged Files of Project  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_revertUnchangedAction ,  CMD_ID_REVERT_UNCHANGED_PROJECT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_revertUnchangedAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : revertUnchangedCurrentProject ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_revertProjectAction  =  new  ParameterAction ( tr ( " Revert Project " ) ,  tr ( " Revert Project  \" %1 \" " ) ,  ParameterAction : : EnabledWithParameter ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_revertProjectAction ,  CMD_ID_REVERT_PROJECT ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setAttribute ( Command : : CA_UpdateText ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_revertProjectAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : revertCurrentProject ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addSeparator ( context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_diffAllAction  =  new  QAction ( tr ( " Diff Opened Files " ) ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_diffAllAction ,  CMD_ID_DIFF_ALL ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_diffAllAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : diffAllOpened ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_openedAction  =  new  QAction ( tr ( " Opened " ) ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_openedAction ,  CMD_ID_OPENED ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-02 13:39:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command - > setDefaultKeySequence ( QKeySequence ( useMacShortcuts  ?  tr ( " Meta+P,Meta+O " )  :  tr ( " Alt+P,Alt+O " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_openedAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : printOpenedFileList ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_logRepositoryAction  =  new  QAction ( tr ( " Repository Log " ) ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_logRepositoryAction ,  CMD_ID_REPOSITORYLOG ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_logRepositoryAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : logRepository ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_pendingAction  =  new  QAction ( tr ( " Pending Changes... " ) ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_pendingAction ,  CMD_ID_PENDING_CHANGES ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_pendingAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : printPendingChanges ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_updateAllAction  =  new  QAction ( tr ( " Update All " ) ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_updateAllAction ,  CMD_ID_UPDATEALL ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_updateAllAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : updateAll ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 16:03:08 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_commandLocator - > appendCommand ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addSeparator ( context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-11 17:17:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    m_describeAction  =  new  QAction ( tr ( " Describe... " ) ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_describeAction ,  CMD_ID_DESCRIBE ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_describeAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : describeChange ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_annotateAction  =  new  QAction ( tr ( " Annotate... " ) ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_annotateAction ,  CMD_ID_ANNOTATE ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_annotateAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : annotateFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_filelogAction  =  new  QAction ( tr ( " Filelog... " ) ,  this ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    command  =  ActionManager : : registerAction ( m_filelogAction ,  CMD_ID_FILELOG ,  context ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( m_filelogAction ,  & QAction : : triggered ,  this ,  & PerforcePluginPrivate : : filelogFile ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-16 12:05:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    perforceContainer - > addAction ( command ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-06 08:48:21 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QObject : : connect ( & m_settings ,  & AspectContainer : : applied ,  [ this ]  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-06 08:48:21 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        m_settings . clearTopLevel ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        applySettings ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  PerforcePlugin : : extensionsInitialized ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    dd - > extensionsInitialized ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    dd - > getTopLevel ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : openCurrentFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasFile ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    vcsOpen ( state . currentFileTopLevel ( ) ,  state . relativeCurrentFile ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : addCurrentFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasFile ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    vcsAdd ( state . currentFileTopLevel ( ) ,  state . relativeCurrentFile ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : revertCurrentFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasFile ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTextCodec  * codec  =  VcsBaseEditor : : getCodec ( state . currentFile ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " diff " )  < <  QLatin1String ( " -sa " )  < <  state . relativeCurrentFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceResponse  result  =  runP4Cmd ( state . currentFileTopLevel ( ) ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                       RunFullySynchronous | CommandToWindow | StdErrToWindow | ErrorToWindow , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                       QStringList ( ) ,  QByteArray ( ) ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( result . error ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // "foo.cpp - file(s) not opened on this client."
 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-02 09:40:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // also revert when the output is empty: The file is unchanged but open then.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( result . stdOut . contains ( QLatin1String ( "  -  " ) )  | |  result . stdErr . contains ( QLatin1String ( "  -  " ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-08-02 09:40:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    bool  doNotRevert  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! result . stdOut . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        doNotRevert  =  ( QMessageBox : : warning ( ICore : : dialogParent ( ) ,  tr ( " p4 revert " ) , 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-02 09:40:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                            tr ( " The file has been changed. Do you want to revert it? " ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                            QMessageBox : : Yes ,  QMessageBox : : No )  = =  QMessageBox : : No ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( doNotRevert ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    FileChangeBlocker  fcb ( state . currentFile ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " revert " )  < <  state . relativeCurrentFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceResponse  result2  =  runP4Cmd ( state . currentFileTopLevel ( ) ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                        CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 14:32:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! result2 . error ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        emit  filesChanged ( QStringList ( state . currentFile ( ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : diffCurrentFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasFile ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    p4Diff ( state . currentFileTopLevel ( ) ,  QStringList ( state . relativeCurrentFile ( ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : diffCurrentProject ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasProject ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    p4Diff ( state . currentProjectTopLevel ( ) ,  perforceRelativeProjectDirectory ( state ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : diffAllOpened ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    p4Diff ( m_settings . topLevel ( ) ,  QStringList ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : updateCurrentProject ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasProject ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    updateCheckout ( state . currentProjectTopLevel ( ) ,  perforceRelativeProjectDirectory ( state ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : updateAll ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    updateCheckout ( m_settings . topLevel ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : revertCurrentProject ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasProject ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QString  msg  =  tr ( " Do you want to revert all changes to the project  \" %1 \" ? " ) . arg ( state . currentProjectName ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( QMessageBox : : warning ( ICore : : dialogParent ( ) ,  tr ( " p4 revert " ) ,  msg ,  QMessageBox : : Yes ,  QMessageBox : : No )  = =  QMessageBox : : No ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    revertProject ( state . currentProjectTopLevel ( ) ,  perforceRelativeProjectDirectory ( state ) ,  false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : revertUnchangedCurrentProject ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // revert -a.
 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasProject ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    revertProject ( state . currentProjectTopLevel ( ) ,  perforceRelativeProjectDirectory ( state ) ,  true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : revertProject ( const  QString  & workingDir ,  const  QStringList  & pathArgs ,  bool  unchangedOnly ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ( QLatin1String ( " revert " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( unchangedOnly ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        args . push_back ( QLatin1String ( " -a " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args . append ( pathArgs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  resp  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                           RunFullySynchronous | CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  ! resp . error ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : updateCheckout ( const  QString  & workingDir ,  const  QStringList  & dirs ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ( QLatin1String ( " sync " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args . append ( dirs ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  resp  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                           CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( dirs . empty ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        if  ( ! workingDir . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            emit  repositoryChanged ( workingDir ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        const  QChar  slash  =  QLatin1Char ( ' / ' ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-11-28 20:44:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        foreach  ( const  QString  & dir ,  dirs ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            emit  repositoryChanged ( workingDir  +  slash  +  dir ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 14:48:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : printOpenedFileList ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-15 14:20:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  perforceResponse 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            =  runP4Cmd ( m_settings . topLevel ( ) ,  QStringList ( QLatin1String ( " opened " ) ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                       CommandToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( perforceResponse . error  | |  perforceResponse . stdOut . isEmpty ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // reformat "//depot/file.cpp#1 - description" into "file.cpp # - description"
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // for context menu opening to work. This produces absolute paths, then.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  errorMessage ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QString  mapped ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QChar  delimiter  =  QLatin1Char ( ' # ' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    foreach  ( const  QString  & line ,  perforceResponse . stdOut . split ( QLatin1Char ( ' \n ' ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        mapped . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        const  int  delimiterPos  =  line . indexOf ( delimiter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        if  ( delimiterPos  >  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            mapped  =  PerforcePlugin : : fileNameFromPerforceName ( line . left ( delimiterPos ) ,  true ,  & errorMessage ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											 
										 
										
											2013-01-08 03:32:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        if  ( mapped . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            VcsOutputWindow : : appendSilently ( line ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											 
										 
										
											2013-01-08 03:32:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        else 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            VcsOutputWindow : : appendSilently ( mapped  +  QLatin1Char ( '   ' )  +  line . mid ( delimiterPos ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-15 14:20:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    VcsOutputWindow : : instance ( ) - > popup ( IOutputPane : : ModeSwitch  |  IOutputPane : : WithFocus ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : startSubmitProject ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-08 12:52:35 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! promptBeforeCommit ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-27 16:17:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-04-18 12:06:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( raiseSubmitEditor ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 12:23:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( isCommitEditorOpen ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendWarning ( tr ( " Another submit is currently executed. " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasProject ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // Revert all unchanged files.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! revertProject ( state . currentProjectTopLevel ( ) ,  perforceRelativeProjectDirectory ( state ) ,  true ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // Start a change
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " change " )  < <  QLatin1String ( " -o " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceResponse  result  =  runP4Cmd ( state . currentProjectTopLevel ( ) ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                       RunFullySynchronous | CommandToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( result . error )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 12:23:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        cleanCommitMessageFile ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    TempFileSaver  saver ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    saver . setAutoRemove ( false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-09-21 13:54:38 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    saver . write ( result . stdOut . toLatin1 ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! saver . finalize ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendError ( saver . errorString ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        cleanCommitMessageFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_commitMessageFileName  =  saver . fileName ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args . clear ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 13:37:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " files " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args . append ( perforceRelativeProjectDirectory ( state ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 13:37:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    PerforceResponse  filesResult  =  runP4Cmd ( state . currentProjectTopLevel ( ) ,  args , 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                            RunFullySynchronous | CommandToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 13:37:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( filesResult . error )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 12:23:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        cleanCommitMessageFile ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 13:37:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  filesLines  =  filesResult . stdOut . split ( QLatin1Char ( ' \n ' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  depotFileNames ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 13:37:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    foreach  ( const  QString  & line ,  filesLines )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-23 16:02:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        depotFileNames . append ( line . left ( line . lastIndexOf ( QRegularExpression ( " #[0-9]+ \\ s- \\ s " ) ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( depotFileNames . isEmpty ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendWarning ( tr ( " Project has no files " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 12:23:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        cleanCommitMessageFile ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 12:23:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    openPerforceSubmitEditor ( m_commitMessageFileName ,  depotFileNames ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								IEditor  * PerforcePluginPrivate : : openPerforceSubmitEditor ( const  QString  & fileName ,  const  QStringList  & depotFileNames ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    IEditor  * editor  =  EditorManager : : openEditor ( fileName ,  PERFORCE_SUBMIT_EDITOR_ID ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-20 00:57:24 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    auto  submitEditor  =  static_cast < PerforceSubmitEditor * > ( editor ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-18 12:06:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    setSubmitEditor ( submitEditor ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    submitEditor - > restrictToProjectFiles ( depotFileNames ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-04 14:56:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( submitEditor ,  & VcsBaseSubmitEditor : : diffSelectedFiles , 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            this ,  & PerforcePluginPrivate : : slotSubmitDiff ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 10:29:59 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    submitEditor - > setCheckScriptWorkingDirectory ( m_settings . topLevel ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    return  editor ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : printPendingChanges ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-24 17:01:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QGuiApplication : : setOverrideCursor ( Qt : : WaitCursor ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-02 09:10:40 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    PendingChangesDialog  dia ( pendingChangesData ( ) ,  ICore : : dialogParent ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-24 17:01:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QGuiApplication : : restoreOverrideCursor ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( dia . exec ( )  = =  QDialog : : Accepted )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-04 16:24:15 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        const  int  i  =  dia . changeNumber ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        QStringList  args ( QLatin1String ( " submit " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        args  < <  QLatin1String ( " -c " )  < <  QString : : number ( i ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        runP4Cmd ( m_settings . topLevel ( ) ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                 CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : describeChange ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ChangeNumberDialog  dia ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( dia . exec ( )  = =  QDialog : : Accepted  & &  dia . number ( )  >  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:50:30 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        vcsDescribe ( QString ( ) ,  QString : : number ( dia . number ( ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : annotateCurrentFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasFile ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    annotate ( state . currentFileTopLevel ( ) ,  state . relativeCurrentFile ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : annotateFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  file  =  QFileDialog : : getOpenFileName ( ICore : : dialogParent ( ) ,  tr ( " p4 annotate " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! file . isEmpty ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        const  QFileInfo  fi ( file ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        annotate ( fi . absolutePath ( ) ,  fi . fileName ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : annotate ( const  QString  & workingDir , 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-06 17:24:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                              const  QString  & fileName , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                              const  QString  & changeList  /* = QString() */ , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                              int  lineNumber  /* = -1 */ ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QStringList  files  =  QStringList ( fileName ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTextCodec  * codec  =  VcsBaseEditor : : getCodec ( workingDir ,  files ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QString  id  =  VcsBaseEditor : : getTitleId ( workingDir ,  files ,  changeList ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QString  source  =  VcsBaseEditor : : getSource ( workingDir ,  files ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-06 17:24:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " annotate " )  < <  QLatin1String ( " -cqi " ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											 
										 
										
											2013-01-08 03:32:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( changeList . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-06 17:24:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        args  < <  fileName ; 
							 
						 
					
						
							
								
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											 
										 
										
											2013-01-08 03:32:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    else 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-06 17:24:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        args  < <  ( fileName  +  QLatin1Char ( ' @ ' )  +  changeList ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  result  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             CommandToWindow | StdErrToWindow | ErrorToWindow , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             QStringList ( ) ,  QByteArray ( ) ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! result . error )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-06 17:24:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        if  ( lineNumber  <  1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            lineNumber  =  VcsBaseEditor : : lineNumberOfCurrentEditor ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        IEditor  * ed  =  showOutputInEditor ( tr ( " p4 annotate %1 " ) . arg ( id ) , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                         result . stdOut ,  annotateEditorParameters . id , 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                         source ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsBaseEditor : : gotoLineOfEditor ( ed ,  lineNumber ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : filelogCurrentFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasFile ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 15:14:54 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    filelog ( state . currentFileTopLevel ( ) ,  state . relativeCurrentFile ( ) ,  true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : filelogFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  file  =  QFileDialog : : getOpenFileName ( ICore : : dialogParent ( ) ,  tr ( " p4 filelog " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! file . isEmpty ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        const  QFileInfo  fi ( file ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 15:14:54 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        filelog ( fi . absolutePath ( ) ,  fi . fileName ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : logProject ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasProject ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-26 11:42:07 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    changelists ( state . currentProjectTopLevel ( ) ,  perforceRelativeFileArguments ( state . relativeCurrentProject ( ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : logRepository ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBasePluginState  state  =  currentState ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( state . hasTopLevel ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-26 11:42:07 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    changelists ( state . topLevel ( ) ,  perforceRelativeFileArguments ( QString ( ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : filelog ( const  QString  & workingDir ,  const  QString  & fileName , 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                             bool  enableAnnotationContextMenu ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  id  =  VcsBaseEditor : : getTitleId ( workingDir ,  QStringList ( fileName ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QTextCodec  * codec  =  VcsBaseEditor : : getCodec ( workingDir ,  QStringList ( fileName ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " filelog " )  < <  QLatin1String ( " -li " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( m_settings . logCount . value ( )  >  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        args  < <  " -m "  < <  QString : : number ( m_settings . logCount . value ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 15:14:54 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! fileName . isEmpty ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        args . append ( fileName ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  result  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             CommandToWindow | StdErrToWindow | ErrorToWindow , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             QStringList ( ) ,  QByteArray ( ) ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! result . error )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        const  QString  source  =  VcsBaseEditor : : getSource ( workingDir ,  fileName ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        IEditor  * editor  =  showOutputInEditor ( tr ( " p4 filelog %1 " ) . arg ( id ) ,  result . stdOut , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                             logEditorParameters . id ,  source ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        if  ( enableAnnotationContextMenu ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            VcsBaseEditor : : getVcsBaseEditor ( editor ) - > setFileLogAnnotateEnabled ( true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : changelists ( const  QString  & workingDir ,  const  QString  & fileName ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-26 11:42:07 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QString  id  =  VcsBaseEditor : : getTitleId ( workingDir ,  QStringList ( fileName ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QTextCodec  * codec  =  VcsBaseEditor : : getCodec ( workingDir ,  QStringList ( fileName ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " changelists " )  < <  QLatin1String ( " -lit " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( m_settings . logCount . value ( )  >  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        args  < <  " -m "  < <  QString : : number ( m_settings . logCount . value ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-26 11:42:07 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! fileName . isEmpty ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        args . append ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  result  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             CommandToWindow | StdErrToWindow | ErrorToWindow , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             QStringList ( ) ,  QByteArray ( ) ,  codec ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! result . error )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        const  QString  source  =  VcsBaseEditor : : getSource ( workingDir ,  fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        IEditor  * editor  =  showOutputInEditor ( tr ( " p4 changelists %1 " ) . arg ( id ) ,  result . stdOut , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                             logEditorParameters . id ,  source ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-26 11:42:07 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsBaseEditor : : gotoLineOfEditor ( editor ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : updateActions ( VcsBasePluginPrivate : : ActionState  as ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-09-26 13:42:22 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  bool  menuActionEnabled  =  enableMenuAction ( as ,  m_menuAction ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  bool  enableActions  =  currentState ( ) . hasTopLevel ( )  & &  menuActionEnabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_commandLocator - > setEnabled ( enableActions ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! menuActionEnabled ) 
							 
						 
					
						
							
								
									
										
										
										
											2012-11-28 20:28:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  fileName  =  currentState ( ) . currentFileName ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_editAction - > setParameter ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_addAction - > setParameter ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_deleteAction - > setParameter ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_revertFileAction - > setParameter ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_diffFileAction - > setParameter ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_annotateCurrentAction - > setParameter ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_filelogCurrentAction - > setParameter ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QString  projectName  =  currentState ( ) . currentProjectName ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 11:33:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_logProjectAction - > setParameter ( projectName ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_updateProjectAction - > setParameter ( projectName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_diffProjectAction - > setParameter ( projectName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_submitProjectAction - > setParameter ( projectName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_revertProjectAction - > setParameter ( projectName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_revertUnchangedAction - > setParameter ( projectName ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : managesDirectory ( const  QString  & directory ,  QString  * topLevel  /* = 0 */ )  const 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-20 16:24:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  bool  rc  =  const_cast < PerforcePluginPrivate  * > ( this ) - > managesDirectoryFstat ( directory ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-20 16:24:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( topLevel )  { 
							 
						 
					
						
							
								
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											 
										 
										
											2013-01-08 03:32:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        if  ( rc ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-20 16:24:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            * topLevel  =  m_settings . topLevelSymLinkTarget ( ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											 
										 
										
											2013-01-08 03:32:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        else 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-20 16:24:39 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            topLevel - > clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  rc ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : managesFile ( const  QString  & workingDirectory ,  const  QString  & fileName )  const 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-02 00:18:39 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " fstat " )  < <  QLatin1String ( " -m1 " )  < <  fileName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  result  =  runP4Cmd ( workingDirectory ,  args ,  RunFullySynchronous ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  result . stdOut . contains ( QLatin1String ( " depotFile " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : managesDirectoryFstat ( const  QString  & directory ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Cached?
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  ManagedDirectoryCache : : const_iterator  cit  =  m_managedDirectoryCache . constFind ( directory ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-05 12:56:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( cit  ! =  m_managedDirectoryCache . constEnd ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        const  DirectoryCacheEntry  & entry  =  cit . value ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        setTopLevel ( entry . m_topLevel ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  entry . m_isManaged ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! m_settings . isValid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-11 09:40:45 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        if  ( m_settings . topLevel ( ) . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-05 12:56:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            getTopLevel ( directory ,  true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        if  ( ! m_settings . isValid ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Determine value and insert into cache
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  managed  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    do  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        // Quick check: Must be at or below top level and not "../../other_path"
 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 15:14:54 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        const  QString  relativeDirArgs  =  m_settings . relativeToTopLevelArguments ( directory ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-05 12:56:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        if  ( ! relativeDirArgs . isEmpty ( )  & &  relativeDirArgs . startsWith ( QLatin1String ( " .. " ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            if  ( ! m_settings . defaultEnv ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                getTopLevel ( directory ,  true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        // Is it actually managed by perforce?
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        args  < <  QLatin1String ( " fstat " )  < <  QLatin1String ( " -m1 " )  < <  perforceRelativeFileArguments ( relativeDirArgs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        const  PerforceResponse  result  =  runP4Cmd ( m_settings . topLevel ( ) ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                 RunFullySynchronous ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-05 12:56:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-01-31 10:57:10 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        managed  =  result . stdOut . contains ( QLatin1String ( " depotFile " ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                  | |  result . stdErr . contains ( QLatin1String ( " ... - no such file(s) " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-11-28 20:44:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    }  while  ( false ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-05 12:56:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_managedDirectoryCache . insert ( directory ,  DirectoryCacheEntry ( managed ,  m_settings . topLevel ( ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  managed ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsOpen ( const  QString  & workingDir ,  const  QString  & fileName ,  bool  silently ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " edit " )  < <  QDir : : toNativeSeparators ( fileName ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-11 19:57:24 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-08-28 10:24:13 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    uint  flags  =  CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-11 19:57:24 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( silently )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        flags  | =  SilentStdOut ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  result  =  runP4Cmd ( workingDir ,  args ,  flags ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    return  ! result . error ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsAdd ( const  QString  & workingDir ,  const  QString  & fileName ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " add " )  < <  fileName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  result  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-04 16:24:15 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                       CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    return  ! result . error ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsDelete ( const  QString  & workingDir ,  const  QString  & fileName ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " revert " )  < <  fileName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  revertResult  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-04 16:24:15 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                       CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( revertResult . error ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " delete " )  < <  fileName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  deleteResult  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    // TODO need to carefully parse the actual messages from perforce
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // or do a fstat before to decide what to do
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // Different states are:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // File is in depot and unopened => p4 delete %
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // File is in depot and opened => p4 revert %, p4 delete %
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // File is not in depot => p4 revert %
 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  ! deleteResult . error ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsMove ( const  QString  & workingDir ,  const  QString  & from ,  const  QString  & to ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-11 14:13:38 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // TODO verify this works
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " edit " )  < <  from ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  editResult  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-22 14:53:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                 RunFullySynchronous | CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-11 14:13:38 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( editResult . error ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " move " )  < <  from  < <  to ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  moveResult  =  runP4Cmd ( workingDir ,  args , 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-22 14:53:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                 RunFullySynchronous | CommandToWindow | StdOutToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-11 14:13:38 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  ! moveResult . error ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Write extra args to temporary file
 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								QSharedPointer < TempFileSaver > 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PerforcePluginPrivate : : createTemporaryArgumentFile ( const  QStringList  & extraArgs , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-02 12:54:36 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                            QString  * errorString ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( extraArgs . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  QSharedPointer < TempFileSaver > ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // create pattern
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QString  pattern  =  dd - > m_tempFilePattern ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-02 12:54:36 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( pattern . isEmpty ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        pattern  =  TemporaryDirectory : : masterDirectoryPath ( )  +  " /qtc_p4_XXXXXX.args " ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        dd - > m_tempFilePattern  =  pattern ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QSharedPointer < TempFileSaver >  rc ( new  TempFileSaver ( pattern ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    rc - > setAutoRemove ( true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  int  last  =  extraArgs . size ( )  -  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    for  ( int  i  =  0 ;  i  < =  last ;  i + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        rc - > write ( extraArgs . at ( i ) . toLocal8Bit ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        if  ( i  ! =  last ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            rc - > write ( " \n " ,  1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! rc - > finalize ( errorString ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  QSharedPointer < TempFileSaver > ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  rc ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : isVcsFileOrDirectory ( const  FilePath  & fileName )  const 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    Q_UNUSED ( fileName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  false ;  // Perforce does not seem to litter its files into the source tree.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : isConfigured ( )  const 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  binary  =  m_settings . p4BinaryPath . value ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( binary . isEmpty ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QFileInfo  fi ( binary ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  fi . exists ( )  & &  fi . isFile ( )  & &  fi . isExecutable ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : supportsOperation ( Operation  operation )  const 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bool  supported  =  isConfigured ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    switch  ( operation )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    case  AddOperation : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    case  DeleteOperation : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    case  MoveOperation : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    case  AnnotateOperation : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  supported ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    case  CreateRepositoryOperation : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    case  SnapshotOperations : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    case  InitialCheckoutOperation : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								IVersionControl : : OpenSupportMode  PerforcePluginPrivate : : openSupportMode ( const  QString  & fileName )  const 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    Q_UNUSED ( fileName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  OpenOptional ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsOpen ( const  QString  & fileName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QFileInfo  fi ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  vcsOpen ( fi . absolutePath ( ) ,  fi . fileName ( ) ,  true ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								IVersionControl : : SettingsFlags  PerforcePluginPrivate : : settingsFlags ( )  const 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    SettingsFlags  rc ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( m_settings . autoOpen . value ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        rc  | =  AutoOpen ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  rc ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsAdd ( const  QString  & fileName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QFileInfo  fi ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  vcsAdd ( fi . absolutePath ( ) ,  fi . fileName ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsDelete ( const  QString  & fileName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QFileInfo  fi ( fileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  vcsDelete ( fi . absolutePath ( ) ,  fi . fileName ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsMove ( const  QString  & from ,  const  QString  & to ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QFileInfo  fromInfo ( from ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QFileInfo  toInfo ( to ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  vcsMove ( fromInfo . absolutePath ( ) ,  fromInfo . absoluteFilePath ( ) ,  toInfo . absoluteFilePath ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : vcsCreateRepository ( const  QString  & ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:34:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : vcsAnnotate ( const  QString  & file ,  int  line ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QFileInfo  fi ( file ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:34:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    annotate ( fi . absolutePath ( ) ,  fi . fileName ( ) ,  QString ( ) ,  line ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-30 12:31:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								QString  PerforcePluginPrivate : : vcsOpenText ( )  const 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  tr ( " &Edit " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								QString  PerforcePluginPrivate : : vcsMakeWritableText ( )  const 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  tr ( " &Hijack " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Run messages
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  inline  QString  msgNotStarted ( const  QString  & cmd ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  PerforcePluginPrivate : : tr ( " Could not start perforce  \" %1 \" . Please check your settings in the preferences. " ) . arg ( cmd ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-04-14 22:30:46 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  inline  QString  msgTimeout ( int  timeOutS ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  PerforcePluginPrivate : : tr ( " Perforce did not respond within timeout limit (%1 s). " ) . arg ( timeOutS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  inline  QString  msgCrash ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  PerforcePluginPrivate : : tr ( " The process terminated abnormally. " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  inline  QString  msgExitCode ( int  ex ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  PerforcePluginPrivate : : tr ( " The process terminated with exit code %1. " ) . arg ( ex ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Run using a SynchronousProcess, emitting signals to the message window
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PerforceResponse  PerforcePluginPrivate : : synchronousProcess ( const  QString  & workingDir , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                           const  QStringList  & args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                           unsigned  flags , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                           const  QByteArray  & stdInput , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                           QTextCodec  * outputCodec )  const 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( stdInput . isEmpty ( ) ,  return  PerforceResponse ( ) ) ;  // Not supported here
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    VcsOutputWindow  * outputWindow  =  VcsOutputWindow : : instance ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    // Run, connect stderr to the output window
 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    SynchronousProcess  process ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  int  timeOutS  =  ( flags  &  LongTimeOut )  ?  m_settings . longTimeOutS ( )  :  m_settings . timeOutS . value ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-14 22:30:46 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    process . setTimeoutS ( timeOutS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-11 09:45:51 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( outputCodec ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        process . setCodec ( outputCodec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( flags  &  OverrideDiffEnvironment ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 18:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        process . setEnvironment ( overrideDiffEnvironmentVariable ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! workingDir . isEmpty ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        process . setWorkingDirectory ( workingDir ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // connect stderr to the output window if desired
 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( flags  &  StdErrToWindow )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        process . setStdErrBufferedSignalsEnabled ( true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 23:40:19 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        connect ( & process ,  & SynchronousProcess : : stdErrBuffered , 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 22:42:51 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                outputWindow ,  [ ] ( const  QString  & lines )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            VcsOutputWindow : : append ( lines ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 23:40:19 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // connect stdout to the output window if desired
 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( flags  &  StdOutToWindow )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        process . setStdOutBufferedSignalsEnabled ( true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-11 19:57:24 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        if  ( flags  &  SilentStdOut )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 23:40:19 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            connect ( & process ,  & SynchronousProcess : : stdOutBuffered , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                    outputWindow ,  & VcsOutputWindow : : appendSilently ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								            connect ( & process ,  & SynchronousProcess : : stdOutBuffered , 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 22:42:51 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                    outputWindow ,  [ ] ( const  QString  & lines )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                VcsOutputWindow : : append ( lines ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 23:40:19 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-11 19:57:24 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-21 17:46:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    process . setTimeOutMessageBoxEnabled ( true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  SynchronousProcessResponse  sp_resp  =  process . run ( { m_settings . p4BinaryPath . value ( ) ,  args } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    PerforceResponse  response ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    response . error  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    response . exitCode  =  sp_resp . exitCode ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-07-05 12:00:59 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    response . stdErr  =  sp_resp . stdErr ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    response . stdOut  =  sp_resp . stdOut ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    switch  ( sp_resp . result )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    case  SynchronousProcessResponse : : Finished : 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        response . error  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        break ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    case  SynchronousProcessResponse : : FinishedError : 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        response . message  =  msgExitCode ( sp_resp . exitCode ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        response . error  =  ! ( flags  &  IgnoreExitCode ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        break ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    case  SynchronousProcessResponse : : TerminatedAbnormally : 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        response . message  =  msgCrash ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        break ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    case  SynchronousProcessResponse : : StartFailed : 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        response . message  =  msgNotStarted ( m_settings . p4BinaryPath . value ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        break ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    case  SynchronousProcessResponse : : Hang : 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        response . message  =  msgCrash ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  response ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Run using a QProcess, for short queries
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PerforceResponse  PerforcePluginPrivate : : fullySynchronousProcess ( const  QString  & workingDir , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                                const  QStringList  & args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                                unsigned  flags , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                                const  QByteArray  & stdInput , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                                QTextCodec  * outputCodec )  const 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 18:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QtcProcess  process ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( flags  &  OverrideDiffEnvironment ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 18:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        process . setEnvironment ( overrideDiffEnvironmentVariable ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! workingDir . isEmpty ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        process . setWorkingDirectory ( workingDir ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceResponse  response ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 18:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    process . setCommand ( { m_settings . p4BinaryPath . value ( ) ,  args } ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    process . start ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( stdInput . isEmpty ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        process . closeWriteChannel ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! process . waitForStarted ( 3000 ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        response . error  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        response . message  =  msgNotStarted ( m_settings . p4BinaryPath . value ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  response ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! stdInput . isEmpty ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        if  ( process . write ( stdInput )  = =  - 1 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-30 18:26:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            process . stopProcess ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            response . error  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-07-05 09:52:32 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            response . message  =  tr ( " Unable to write input data to process %1: %2 " ) . 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                               arg ( QDir : : toNativeSeparators ( m_settings . p4BinaryPath . value ( ) ) , 
							 
						 
					
						
							
								
									
										
										
										
											2010-07-05 09:52:32 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                   process . errorString ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            return  response ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        process . closeWriteChannel ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-01 10:06:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QByteArray  stdOut ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QByteArray  stdErr ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  int  timeOutS  =  ( flags  &  LongTimeOut )  ?  m_settings . longTimeOutS ( )  :  m_settings . timeOutS . value ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-04 07:33:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! process . readDataFromProcess ( timeOutS ,  & stdOut ,  & stdErr ,  true ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        process . stopProcess ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        response . error  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-14 22:30:46 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        response . message  =  msgTimeout ( timeOutS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  response ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( process . exitStatus ( )  ! =  QProcess : : NormalExit )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        response . error  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        response . message  =  msgCrash ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  response ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    response . exitCode  =  process . exitCode ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    response . error  =  response . exitCode  ?  ! ( flags  &  IgnoreExitCode )  :  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-01 10:06:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    response . stdErr  =  QString : : fromLocal8Bit ( stdErr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    response . stdOut  =  outputCodec  ?  outputCodec - > toUnicode ( stdOut . constData ( ) ,  stdOut . size ( ) )  : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                    QString : : fromLocal8Bit ( stdOut ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 17:04:13 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QChar  cr  =  QLatin1Char ( ' \r ' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    response . stdErr . remove ( cr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    response . stdOut . remove ( cr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Logging
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ( flags  &  StdErrToWindow )  & &  ! response . stdErr . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendError ( response . stdErr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ( flags  &  StdOutToWindow )  & &  ! response . stdOut . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : append ( response . stdOut ,  VcsOutputWindow : : None ,  flags  &  SilentStdOut ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  response ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PerforceResponse  PerforcePluginPrivate : : runP4Cmd ( const  QString  & workingDir , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                 const  QStringList  & args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                 unsigned  flags , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                 const  QStringList  & extraArgs , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                 const  QByteArray  & stdInput , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                 QTextCodec  * outputCodec )  const 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! m_settings . isValid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        PerforceResponse  invalidConfigResponse ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        invalidConfigResponse . error  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        invalidConfigResponse . message  =  tr ( " Perforce is not correctly configured. " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendError ( invalidConfigResponse . message ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  invalidConfigResponse ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  actualArgs  =  m_settings . commonP4Arguments ( workingDir ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QString  errorMessage ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QSharedPointer < TempFileSaver >  tempFile  =  createTemporaryArgumentFile ( extraArgs ,  & errorMessage ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! tempFile . isNull ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        actualArgs  < <  QLatin1String ( " -x " )  < <  tempFile - > fileName ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    }  else  if  ( ! errorMessage . isEmpty ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        PerforceResponse  tempFailResponse ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        tempFailResponse . error  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        tempFailResponse . message  =  errorMessage ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  tempFailResponse ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    actualArgs . append ( args ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( flags  &  CommandToWindow ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendCommand ( workingDir ,  { m_settings . p4BinaryPath . value ( ) ,  actualArgs } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( flags  &  ShowBusyCursor ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        QApplication : : setOverrideCursor ( QCursor ( Qt : : WaitCursor ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse   response  =  ( flags  &  RunFullySynchronous )   ? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        fullySynchronousProcess ( workingDir ,  actualArgs ,  flags ,  stdInput ,  outputCodec )  : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        synchronousProcess ( workingDir ,  actualArgs ,  flags ,  stdInput ,  outputCodec ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( flags  &  ShowBusyCursor ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        QApplication : : restoreOverrideCursor ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 14:14:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( response . error  & &  ( flags  &  ErrorToWindow ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendError ( response . message ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    return  response ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								IEditor  * PerforcePluginPrivate : : showOutputInEditor ( const  QString  & title , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                   const  QString  & output , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-26 13:59:38 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                   Utils : : Id  id , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                   const  QString  & source , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                   QTextCodec  * codec ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    QString  s  =  title ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-25 11:52:31 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QString  content  =  output ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 14:14:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  int  maxSize  =  int ( EditorManager : : maxTextFileSize ( )  /  2   -  1000L ) ;  // ~25 MB, 600000 lines
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-25 11:52:31 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( content . size ( )  > =  maxSize )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-25 14:22:33 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        content  =  content . left ( maxSize ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-28 10:24:13 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        content  + =  QLatin1Char ( ' \n ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                   +  tr ( " [Only %n MB of output shown] " ,  nullptr ,  maxSize  /  1024  /  1024 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-25 11:52:31 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    IEditor  * editor  =  EditorManager : : openEditorWithContents ( id ,  & s ,  content . toUtf8 ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-28 10:24:13 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( editor ,  return  nullptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 14:14:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    auto  e  =  qobject_cast < PerforceEditorWidget * > ( editor - > widget ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! e ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-28 10:24:13 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  nullptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( e ,  & VcsBaseEditorWidget : : annotateRevisionRequested ,  this ,  & PerforcePluginPrivate : : annotate ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-06-07 14:53:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    e - > setForceReadOnly ( true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-06 17:24:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    e - > setSource ( source ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    s . replace ( QLatin1Char ( '   ' ) ,  QLatin1Char ( ' _ ' ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-14 14:45:01 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    e - > textDocument ( ) - > setFallbackSaveAsFileName ( s ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( codec ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        e - > setCodec ( codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-19 10:22:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  editor ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : slotSubmitDiff ( const  QStringList  & files ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 10:29:59 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    p4Diff ( m_settings . topLevel ( ) ,  files ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Parameter widget controlling whitespace diff mode, associated with a parameter
 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 04:42:43 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								class  PerforceDiffConfig  :  public  VcsBaseEditorConfig 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    Q_OBJECT 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								public : 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 04:42:43 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    explicit  PerforceDiffConfig ( const  PerforceDiffParameters  & p ,  QToolBar  * toolBar ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-20 10:45:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    void  triggerReRun ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								signals : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    void  reRunDiff ( const  Perforce : : Internal : : PerforceDiffParameters  & ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								private : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceDiffParameters  m_parameters ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 04:42:43 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PerforceDiffConfig : : PerforceDiffConfig ( const  PerforceDiffParameters  & p ,  QToolBar  * toolBar )  : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    VcsBaseEditorConfig ( toolBar ) ,  m_parameters ( p ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    setBaseArguments ( p . diffArguments ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-10 10:37:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    addToggleButton ( QLatin1String ( " w " ) ,  tr ( " Ignore Whitespace " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 04:42:43 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( this ,  & VcsBaseEditorConfig : : argumentsChanged ,  this ,  & PerforceDiffConfig : : triggerReRun ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 04:42:43 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforceDiffConfig : : triggerReRun ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceDiffParameters  effectiveParameters  =  m_parameters ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    effectiveParameters . diffArguments  =  arguments ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    emit  reRunDiff ( effectiveParameters ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								QString  PerforcePluginPrivate : : commitDisplayName ( )  const 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-08 12:52:35 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-28 08:35:38 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  tr ( " Submit " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-08 12:52:35 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : p4Diff ( const  QString  & workingDir ,  const  QStringList  & files ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    PerforceDiffParameters  p ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    p . workingDir  =  workingDir ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    p . files  =  files ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    p . diffArguments . push_back ( QString ( QLatin1Char ( ' u ' ) ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    p4Diff ( p ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : p4Diff ( const  PerforceDiffParameters  & p ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTextCodec  * codec  =  VcsBaseEditor : : getCodec ( p . workingDir ,  p . files ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QString  id  =  VcsBaseEditor : : getTitleId ( p . workingDir ,  p . files ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Reuse existing editors for that id
 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-03 23:52:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  tag  =  VcsBaseEditor : : editorTag ( DiffOutput ,  p . workingDir ,  p . files ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    IEditor  * existingEditor  =  VcsBaseEditor : : locateEditorByTag ( tag ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Split arguments according to size
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " diff " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! p . diffArguments . isEmpty ( ) )  // -duw..
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        args  < <  ( QLatin1String ( " -d " )  +  p . diffArguments . join ( QString ( ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  extraArgs ; 
							 
						 
					
						
							
								
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											 
										 
										
											2013-01-08 03:32:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( p . files . size ( )  >  1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        extraArgs  =  p . files ; 
							 
						 
					
						
							
								
									
										
										
											
												Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
											 
										 
										
											2013-01-08 03:32:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    else 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        args . append ( p . files ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  unsigned  flags  =  CommandToWindow | StdErrToWindow | ErrorToWindow | OverrideDiffEnvironment ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  result  =  runP4Cmd ( p . workingDir ,  args ,  flags , 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                             extraArgs ,  QByteArray ( ) ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( result . error ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( existingEditor )  { 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-15 15:14:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        existingEditor - > document ( ) - > setContents ( result . stdOut . toUtf8 ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        EditorManager : : activateEditor ( existingEditor ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Create new editor
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    IEditor  * editor  =  showOutputInEditor ( tr ( " p4 diff %1 " ) . arg ( id ) ,  result . stdOut , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                         diffEditorParameters . id , 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                         VcsBaseEditor : : getSource ( p . workingDir ,  p . files ) , 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                         codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-27 17:50:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    VcsBaseEditor : : tagEditor ( editor ,  tag ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 14:14:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    auto  diffEditorWidget  =  qobject_cast < VcsBaseEditorWidget  * > ( editor - > widget ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Wire up the parameter widget to trigger a re-run on
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // parameter change and 'revert' from inside the diff editor.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 04:42:43 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    auto  pw  =  new  PerforceDiffConfig ( p ,  diffEditorWidget - > toolBar ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    connect ( pw ,  & PerforceDiffConfig : : reRunDiff , 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 14:14:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            this ,  [ this ] ( const  PerforceDiffParameters  & p )  {  p4Diff ( p ) ;  } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-20 10:45:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( diffEditorWidget ,  & VcsBaseEditorWidget : : diffChunkReverted , 
							 
						 
					
						
							
								
									
										
										
										
											2016-10-23 04:42:43 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            pw ,  & PerforceDiffConfig : : triggerReRun ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-11 17:44:32 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    diffEditorWidget - > setEditorConfig ( pw ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 23:50:30 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : vcsDescribe ( const  QString  &  source ,  const  QString  & n ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-28 10:24:13 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTextCodec  * codec  =  source . isEmpty ( )  ?  static_cast < QTextCodec  * > ( nullptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                         :  VcsBaseEditor : : getCodec ( source ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " describe " )  < <  QLatin1String ( " -du " )  < <  n ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  result  =  runP4Cmd ( m_settings . topLevel ( ) ,  args ,  CommandToWindow | StdErrToWindow | ErrorToWindow , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                             QStringList ( ) ,  QByteArray ( ) ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! result . error ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-07 07:51:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        showOutputInEditor ( tr ( " p4 describe %1 " ) . arg ( n ) ,  result . stdOut ,  diffEditorParameters . id ,  source ,  codec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : commitFromEditor ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 10:16:18 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_submitActionTriggered  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-19 16:15:57 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( submitEditor ( ) ,  return ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-29 10:24:48 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    EditorManager : : closeDocuments ( { submitEditor ( ) - > document ( ) } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : cleanCommitMessageFile ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 16:52:22 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 12:23:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! m_commitMessageFileName . isEmpty ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        QFile : : remove ( m_commitMessageFileName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        m_commitMessageFileName . clear ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 16:52:22 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : isCommitEditorOpen ( )  const 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 12:23:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  ! m_commitMessageFileName . isEmpty ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  PerforcePluginPrivate : : submitEditorAboutToClose ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 14:26:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! isCommitEditorOpen ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        return  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-10 14:14:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    auto  perforceEditor  =  qobject_cast < PerforceSubmitEditor  * > ( submitEditor ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-18 12:06:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( perforceEditor ,  return  true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    IDocument  * editorDocument  =  perforceEditor - > document ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-18 12:06:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( editorDocument ,  return  true ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Prompt the user. Force a prompt unless submit was actually invoked (that
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // is, the editor was closed or shutdown).
 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    bool  wantsPrompt  =  m_settings . promptToSubmit . value ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  VcsBaseSubmitEditor : : PromptSubmitResult  answer  = 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-09 09:59:40 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            perforceEditor - > promptSubmit ( this ,  & wantsPrompt ,  ! m_submitActionTriggered ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_submitActionTriggered  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-19 17:40:01 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( answer  = =  VcsBaseSubmitEditor : : SubmitCanceled ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    // Set without triggering the checking mechanism
 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( wantsPrompt  ! =  m_settings . promptToSubmit . value ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        m_settings . promptToSubmit . setValue ( wantsPrompt ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        m_settings . writeSettings ( ICore : : settings ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! DocumentManager : : saveDocument ( editorDocument ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 12:43:17 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( answer  = =  VcsBaseSubmitEditor : : SubmitDiscarded )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-22 12:23:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        cleanCommitMessageFile ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // Pipe file into p4 submit -i
 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-28 17:47:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    FileReader  reader ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( ! reader . fetch ( m_commitMessageFileName ,  QIODevice : : Text ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendError ( reader . errorString ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  submitArgs ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    submitArgs  < <  QLatin1String ( " submit " )  < <  QLatin1String ( " -i " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  submitResponse  =  runP4Cmd ( m_settings . topLevelSymLinkTarget ( ) ,  submitArgs , 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-14 09:41:38 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                     LongTimeOut | RunFullySynchronous | CommandToWindow | StdErrToWindow | ErrorToWindow | ShowBusyCursor , 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 15:15:15 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                     QStringList ( ) ,  reader . data ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( submitResponse . error )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        VcsOutputWindow : : appendError ( tr ( " p4 submit failed: %1 " ) . arg ( submitResponse . message ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    VcsOutputWindow : : append ( submitResponse . stdOut ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( submitResponse . stdOut . contains ( QLatin1String ( " Out of date files must be resolved or reverted) " ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-18 12:06:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        QMessageBox : : warning ( perforceEditor - > widget ( ) ,  tr ( " Pending change " ) ,  tr ( " Could not submit the change, because your workspace was out of date. Created a pending submit instead. " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    cleanCommitMessageFile ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								QString  PerforcePluginPrivate : : clientFilePath ( const  QString  & serverFilePath ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( m_settings . isValid ( ) ,  return  QString ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " fstat " )  < <  serverFilePath ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  response  =  runP4Cmd ( m_settings . topLevelSymLinkTarget ( ) ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                               ShowBusyCursor | RunFullySynchronous | CommandToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( response . error ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-02 17:09:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  QString ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-23 16:02:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QRegularExpression  r ( " \\ . \\ . \\ . \\ sclientFile \\ s(.+?) \ n " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QRegularExpressionMatch  match  =  r . match ( response . stdOut ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  match . hasMatch ( )  ?  match . captured ( 1 ) . trimmed ( )  :  QString ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								QString  PerforcePluginPrivate : : pendingChangesData ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( m_settings . isValid ( ) ,  return  QString ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  args  =  QStringList ( QLatin1String ( " info " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  userResponse  =  runP4Cmd ( m_settings . topLevelSymLinkTarget ( ) ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                               RunFullySynchronous | CommandToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( userResponse . error ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-02 17:09:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  QString ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-23 16:02:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QRegularExpression  r ( " User \\ sname: \\ s( \\ S+?) \ \ s * ? \ n " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-04-17 08:01:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QTC_ASSERT ( r . isValid ( ) ,  return  QString ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-23 16:02:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QRegularExpressionMatch  match  =  r . match ( userResponse . stdOut ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QString  user  =  match . hasMatch ( )  ?  match . captured ( 1 ) . trimmed ( )  :  QString ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( user . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-02 17:09:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  QString ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    args . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " changes " )  < <  QLatin1String ( " -s " )  < <  QLatin1String ( " pending " )  < <  QLatin1String ( " -u " )  < <  user ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  dataResponse  =  runP4Cmd ( m_settings . topLevelSymLinkTarget ( ) ,  args , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                                                   RunFullySynchronous | CommandToWindow | StdErrToWindow | ErrorToWindow ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-02 17:09:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  dataResponse . error  ?  QString ( )  :  dataResponse . stdOut ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  inline  QString  msgWhereFailed ( const  QString  &  file ,  const  QString  & why ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-25 14:52:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    //: Failed to run p4 "where" to resolve a Perforce file name to a local
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    //: file system name.
 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  PerforcePluginPrivate : : tr ( " Error running  \" where \"  on %1: %2 " ) . 
							 
						 
					
						
							
								
									
										
										
										
											2010-07-05 09:52:32 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								            arg ( QDir : : toNativeSeparators ( file ) ,  why ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								// Map a perforce name "//xx" to its real name in the file system
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								QString  PerforcePlugin : : fileNameFromPerforceName ( const  QString &  perforceName , 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-15 14:20:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                 bool  quiet , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-02 12:54:36 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                                                 QString  * errorMessage ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // All happy, already mapped
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! perforceName . startsWith ( QLatin1String ( " // " ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return  perforceName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // "where" remaps the file to client file tree
 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QStringList  args ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    args  < <  QLatin1String ( " where " )  < <  perforceName ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-15 14:20:06 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    unsigned  flags  =  RunFullySynchronous ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( ! quiet ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        flags  | =  CommandToWindow | StdErrToWindow | ErrorToWindow ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  PerforceResponse  response  =  dd - > runP4Cmd ( dd - > m_settings . topLevelSymLinkTarget ( ) ,  args ,  flags ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( response . error )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        * errorMessage  =  msgWhereFailed ( perforceName ,  response . message ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-25 15:27:13 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return  QString ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    QString  output  =  response . stdOut ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    if  ( output . endsWith ( QLatin1Char ( ' \r ' ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        output . chop ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( output . endsWith ( QLatin1Char ( ' \n ' ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        output . chop ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( output . isEmpty ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-25 14:52:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        //: File is not managed by Perforce
 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        * errorMessage  =  msgWhereFailed ( perforceName ,  tr ( " The file is not mapped " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        return  QString ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    const  QString  p4fileSpec  =  output . mid ( output . lastIndexOf ( QLatin1Char ( '   ' ) )  +  1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    return  dd - > m_settings . mapToFileSystem ( p4fileSpec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : setTopLevel ( const  QString  & topLevel ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-05 12:56:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( m_settings . topLevel ( )  = =  topLevel ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    m_settings . setTopLevel ( topLevel ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const  QString  msg  =  tr ( " Perforce repository: %1 " ) . arg ( QDir : : toNativeSeparators ( topLevel ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    VcsOutputWindow : : appendSilently ( msg ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : applySettings ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_settings . writeSettings ( ICore : : settings ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    m_managedDirectoryCache . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    getTopLevel ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    emit  configurationChanged ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : slotTopLevelFailed ( const  QString  & errorMessage ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2014-08-26 00:02:47 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    VcsOutputWindow : : appendSilently ( tr ( " Perforce: Unable to determine the repository: %1 " ) . arg ( errorMessage ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  PerforcePluginPrivate : : getTopLevel ( const  QString  & workingDirectory ,  bool  isSync ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // Run a new checker
 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if  ( m_settings . p4BinaryPath . value ( ) . isEmpty ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    auto  checker  =  new  PerforceChecker ( dd ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    connect ( checker ,  & PerforceChecker : : failed ,  dd ,  & PerforcePluginPrivate : : slotTopLevelFailed ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-22 13:53:26 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( checker ,  & PerforceChecker : : failed ,  checker ,  & QObject : : deleteLater ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-23 17:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( checker ,  & PerforceChecker : : succeeded ,  dd ,  & PerforcePluginPrivate : : setTopLevel ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-22 13:53:26 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    connect ( checker ,  & PerforceChecker : : succeeded , checker ,  & QObject : : deleteLater ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-05 12:56:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-13 08:09:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    checker - > start ( m_settings . p4BinaryPath . value ( ) ,  workingDirectory , 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								                   m_settings . commonP4Arguments ( QString ( ) ) ,  30000 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-05 12:56:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if  ( isSync ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        checker - > waitForFinished ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-11 16:43:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:09:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PerforcePlugin : : ~ PerforcePlugin ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    delete  dd ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    dd  =  nullptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bool  PerforcePlugin : : initialize ( const  QStringList  &  /* arguments */ ,  QString  * errorMessage ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    Q_UNUSED ( errorMessage ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    dd  =  new  PerforcePluginPrivate ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-01-28 22:02:35 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# ifdef WITH_TESTS 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  PerforcePlugin : : testLogResolving ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // Source: http://mail.opensolaris.org/pipermail/opengrok-discuss/2008-October/001668.html
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    QByteArray  data ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                " ... #4 change 12345 edit on 2013/01/28 by User at UserWorkspaceName(text) \n " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                " \n " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                "         Comment \n " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                " ... #3 change 12344 edit on 2013/01/27 by User at UserWorkspaceName(text) \n " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                " \n " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                "         Comment \n " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								                ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 11:51:45 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    VcsBaseEditorWidget : : testLogResolving ( dd - > logEditorFactory ,  data ,  " 12345 " ,  " 12344 " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2013-01-28 22:02:35 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-08-21 01:24:38 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								}  // namespace Internal
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}  // namespace Perforce
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 12:01:29 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-31 10:57:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "perforceplugin.moc"