Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
cacdc6c7
Commit
cacdc6c7
authored
Jan 08, 2010
by
Tobias Hunger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add display name to VCS plugin structs
Reviewed-by: Friedemann Kleint
parent
a22e64a0
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
119 additions
and
57 deletions
+119
-57
src/plugins/cvs/cvsconstants.h
src/plugins/cvs/cvsconstants.h
+2
-1
src/plugins/cvs/cvsplugin.cpp
src/plugins/cvs/cvsplugin.cpp
+12
-7
src/plugins/git/gitclient.cpp
src/plugins/git/gitclient.cpp
+12
-12
src/plugins/git/gitconstants.h
src/plugins/git/gitconstants.h
+12
-5
src/plugins/git/gitplugin.cpp
src/plugins/git/gitplugin.cpp
+12
-7
src/plugins/mercurial/constants.h
src/plugins/mercurial/constants.h
+10
-1
src/plugins/mercurial/mercurialplugin.cpp
src/plugins/mercurial/mercurialplugin.cpp
+14
-9
src/plugins/perforce/perforceconstants.h
src/plugins/perforce/perforceconstants.h
+7
-0
src/plugins/perforce/perforceplugin.cpp
src/plugins/perforce/perforceplugin.cpp
+5
-0
src/plugins/subversion/subversionconstants.h
src/plugins/subversion/subversionconstants.h
+6
-2
src/plugins/subversion/subversionplugin.cpp
src/plugins/subversion/subversionplugin.cpp
+12
-7
src/plugins/vcsbase/basevcseditorfactory.cpp
src/plugins/vcsbase/basevcseditorfactory.cpp
+5
-1
src/plugins/vcsbase/vcsbaseeditor.cpp
src/plugins/vcsbase/vcsbaseeditor.cpp
+4
-1
src/plugins/vcsbase/vcsbaseeditor.h
src/plugins/vcsbase/vcsbaseeditor.h
+2
-2
src/plugins/vcsbase/vcsbasesubmiteditor.cpp
src/plugins/vcsbase/vcsbasesubmiteditor.cpp
+2
-0
src/plugins/vcsbase/vcsbasesubmiteditor.h
src/plugins/vcsbase/vcsbasesubmiteditor.h
+2
-2
No files found.
src/plugins/cvs/cvsconstants.h
View file @
cacdc6c7
...
...
@@ -37,7 +37,8 @@ const char * const CVS_SUBMIT_MIMETYPE = "application/vnd.nokia.text.cvs.submit"
const
char
*
const
CVSEDITOR
=
"CVS Editor"
;
const
char
*
const
CVSEDITOR_KIND
=
"CVS Editor"
;
const
char
*
const
CVSCOMMITEDITOR
=
"CVS Commit Editor"
;
const
char
*
const
CVSCOMMITEDITOR_KIND
=
"CVS Commit Editor"
;
const
char
*
const
CVSCOMMITEDITOR_ID
=
"CVS Commit Editor"
;
const
char
*
const
CVSCOMMITEDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"CVS Commit Editor"
);
const
char
*
const
SUBMIT_CURRENT
=
"CVS.SubmitCurrentLog"
;
const
char
*
const
DIFF_SELECTED
=
"CVS.DiffSelectedFilesInLog"
;
enum
{
debug
=
0
};
...
...
src/plugins/cvs/cvsplugin.cpp
View file @
cacdc6c7
...
...
@@ -102,22 +102,26 @@ static const char * const CMD_ID_SEPARATOR4 = "CVS.Separator4";
static
const
VCSBase
::
VCSBaseEditorParameters
editorParameters
[]
=
{
{
VCSBase
::
RegularCommandOutput
,
"CVS Command Log Editor"
,
// kind
"CVS Command Log Editor"
,
// id
QT_TRANSLATE_NOOP
(
"VCS"
,
"CVS Command Log Editor"
),
// display name
"CVS Command Log Editor"
,
// context
"application/vnd.nokia.text.scs_cvs_commandlog"
,
"scslog"
},
{
VCSBase
::
LogOutput
,
"CVS File Log Editor"
,
// kind
"CVS File Log Editor"
,
// id
QT_TRANSLATE_NOOP
(
"VCS"
,
"CVS File Log Editor"
),
// display name
"CVS File Log Editor"
,
// context
"application/vnd.nokia.text.scs_cvs_filelog"
,
"scsfilelog"
},
{
VCSBase
::
AnnotateOutput
,
"CVS Annotation Editor"
,
// kind
"CVS Annotation Editor"
,
// id
QT_TRANSLATE_NOOP
(
"VCS"
,
"CVS Annotation Editor"
),
// display name
"CVS Annotation Editor"
,
// context
"application/vnd.nokia.text.scs_cvs_annotation"
,
"scsannotate"
},
{
VCSBase
::
DiffOutput
,
"CVS Diff Editor"
,
// kind
"CVS Diff Editor"
,
// id
QT_TRANSLATE_NOOP
(
"VCS"
,
"CVS Diff Editor"
),
// display name
"CVS Diff Editor"
,
// context
"text/x-patch"
,
"diff"
}
};
...
...
@@ -146,7 +150,7 @@ Core::IEditor* locateEditor(const char *property, const QString &entry)
CVSPlugin
*
CVSPlugin
::
m_cvsPluginInstance
=
0
;
CVSPlugin
::
CVSPlugin
()
:
VCSBase
::
VCSBasePlugin
(
QLatin1String
(
CVS
::
Constants
::
CVSCOMMITEDITOR_
KIN
D
)),
VCSBase
::
VCSBasePlugin
(
QLatin1String
(
CVS
::
Constants
::
CVSCOMMITEDITOR_
I
D
)),
m_addAction
(
0
),
m_deleteAction
(
0
),
m_revertAction
(
0
),
...
...
@@ -189,7 +193,8 @@ bool CVSPlugin::isCommitEditorOpen() const
static
const
VCSBase
::
VCSBaseSubmitEditorParameters
submitParameters
=
{
CVS
::
Constants
::
CVS_SUBMIT_MIMETYPE
,
CVS
::
Constants
::
CVSCOMMITEDITOR_KIND
,
CVS
::
Constants
::
CVSCOMMITEDITOR_ID
,
CVS
::
Constants
::
CVSCOMMITEDITOR_DISPLAY_NAME
,
CVS
::
Constants
::
CVSCOMMITEDITOR
};
...
...
@@ -478,7 +483,7 @@ void CVSPlugin::cvsDiff(const QString &workingDir, const QStringList &files)
CVSSubmitEditor
*
CVSPlugin
::
openCVSSubmitEditor
(
const
QString
&
fileName
)
{
Core
::
IEditor
*
editor
=
Core
::
EditorManager
::
instance
()
->
openEditor
(
fileName
,
QLatin1String
(
Constants
::
CVSCOMMITEDITOR_
KIN
D
));
Core
::
IEditor
*
editor
=
Core
::
EditorManager
::
instance
()
->
openEditor
(
fileName
,
QLatin1String
(
Constants
::
CVSCOMMITEDITOR_
I
D
));
CVSSubmitEditor
*
submitEditor
=
qobject_cast
<
CVSSubmitEditor
*>
(
editor
);
QTC_ASSERT
(
submitEditor
,
/**/
);
submitEditor
->
registerActions
(
m_submitUndoAction
,
m_submitRedoAction
,
m_submitCurrentLogAction
,
m_submitDiffAction
);
...
...
src/plugins/git/gitclient.cpp
View file @
cacdc6c7
...
...
@@ -152,7 +152,7 @@ QString GitClient::findRepositoryForDirectory(const QString &dir)
* existing instance and to reuse it (in case, say, 'git diff foo' is
* already open). */
VCSBase
::
VCSBaseEditor
*
GitClient
::
createVCSEditor
(
const
QString
&
kin
d
,
*
GitClient
::
createVCSEditor
(
const
QString
&
i
d
,
QString
title
,
// Source file or directory
const
QString
&
source
,
...
...
@@ -170,7 +170,7 @@ VCSBase::VCSBaseEditor
QTC_ASSERT
(
rc
,
return
0
);
}
else
{
// Create new, set wait message, set up with source and codec
outputEditor
=
m_core
->
editorManager
()
->
openEditorWithContents
(
kin
d
,
&
title
,
m_msgWait
);
outputEditor
=
m_core
->
editorManager
()
->
openEditorWithContents
(
i
d
,
&
title
,
m_msgWait
);
outputEditor
->
file
()
->
setProperty
(
registerDynamicProperty
,
dynamicPropertyValue
);
rc
=
VCSBase
::
VCSBaseEditor
::
getVcsBaseEditor
(
outputEditor
);
connect
(
rc
,
SIGNAL
(
annotateRevisionRequested
(
QString
,
QString
,
int
)),
...
...
@@ -194,10 +194,10 @@ void GitClient::diff(const QString &workingDirectory,
qDebug
()
<<
"diff"
<<
workingDirectory
<<
unstagedFileNames
<<
stagedFileNames
;
const
QString
binary
=
QLatin1String
(
Constants
::
GIT_BINARY
);
const
QString
kind
=
QLatin1String
(
Git
::
Constants
::
GIT_DIFF_EDITOR_KIN
D
);
const
QString
editorId
=
QLatin1String
(
Git
::
Constants
::
GIT_DIFF_EDITOR_I
D
);
const
QString
title
=
tr
(
"Git Diff"
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
kin
d
,
title
,
workingDirectory
,
true
,
"originalFileName"
,
workingDirectory
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
editorI
d
,
title
,
workingDirectory
,
true
,
"originalFileName"
,
workingDirectory
);
editor
->
setDiffBaseDirectory
(
workingDirectory
);
// Create a batch of 2 commands to be run after each other in case
...
...
@@ -241,10 +241,10 @@ void GitClient::diff(const QString &workingDirectory,
if
(
!
fileName
.
isEmpty
())
arguments
<<
diffArgs
<<
QLatin1String
(
"--"
)
<<
fileName
;
const
QString
kind
=
QLatin1String
(
Git
::
Constants
::
GIT_DIFF_EDITOR_KIN
D
);
const
QString
editorId
=
QLatin1String
(
Git
::
Constants
::
GIT_DIFF_EDITOR_I
D
);
const
QString
title
=
tr
(
"Git Diff %1"
).
arg
(
fileName
);
const
QString
sourceFile
=
VCSBase
::
VCSBaseEditor
::
getSource
(
workingDirectory
,
fileName
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
kin
d
,
title
,
sourceFile
,
true
,
"originalFileName"
,
sourceFile
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
editorI
d
,
title
,
sourceFile
,
true
,
"originalFileName"
,
sourceFile
);
executeGit
(
workingDirectory
,
arguments
,
editor
);
}
...
...
@@ -277,9 +277,9 @@ void GitClient::log(const QString &workingDirectory, const QStringList &fileName
const
QString
msgArg
=
fileNames
.
empty
()
?
workingDirectory
:
fileNames
.
join
(
QString
(
", "
));
const
QString
title
=
tr
(
"Git Log %1"
).
arg
(
msgArg
);
const
QString
kind
=
QLatin1String
(
Git
::
Constants
::
GIT_LOG_EDITOR_KIN
D
);
const
QString
editorId
=
QLatin1String
(
Git
::
Constants
::
GIT_LOG_EDITOR_I
D
);
const
QString
sourceFile
=
VCSBase
::
VCSBaseEditor
::
getSource
(
workingDirectory
,
fileNames
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
kin
d
,
title
,
sourceFile
,
false
,
"logFileName"
,
sourceFile
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
editorI
d
,
title
,
sourceFile
,
false
,
"logFileName"
,
sourceFile
);
editor
->
setFileLogAnnotateEnabled
(
enableAnnotationContextMenu
);
executeGit
(
workingDirectory
,
arguments
,
editor
);
}
...
...
@@ -292,8 +292,8 @@ void GitClient::show(const QString &source, const QString &id)
arguments
<<
QLatin1String
(
"show"
)
<<
QLatin1String
(
noColorOption
)
<<
id
;
const
QString
title
=
tr
(
"Git Show %1"
).
arg
(
id
);
const
QString
kind
=
QLatin1String
(
Git
::
Constants
::
GIT_DIFF_EDITOR_KIN
D
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
kin
d
,
title
,
source
,
true
,
"show"
,
id
);
const
QString
editorId
=
QLatin1String
(
Git
::
Constants
::
GIT_DIFF_EDITOR_I
D
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
editorI
d
,
title
,
source
,
true
,
"show"
,
id
);
const
QFileInfo
sourceFi
(
source
);
const
QString
workDir
=
sourceFi
.
isDir
()
?
sourceFi
.
absoluteFilePath
()
:
sourceFi
.
absolutePath
();
...
...
@@ -325,12 +325,12 @@ void GitClient::blame(const QString &workingDirectory,
arguments
<<
QLatin1String
(
"--"
)
<<
fileName
;
if
(
!
revision
.
isEmpty
())
arguments
<<
revision
;
const
QString
kind
=
QLatin1String
(
Git
::
Constants
::
GIT_BLAME_EDITOR_KIN
D
);
const
QString
editorId
=
QLatin1String
(
Git
::
Constants
::
GIT_BLAME_EDITOR_I
D
);
const
QString
id
=
VCSBase
::
VCSBaseEditor
::
getTitleId
(
workingDirectory
,
QStringList
(
fileName
),
revision
);
const
QString
title
=
tr
(
"Git Blame %1"
).
arg
(
id
);
const
QString
sourceFile
=
VCSBase
::
VCSBaseEditor
::
getSource
(
workingDirectory
,
fileName
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
kin
d
,
title
,
sourceFile
,
true
,
"blameFileName"
,
id
);
VCSBase
::
VCSBaseEditor
*
editor
=
createVCSEditor
(
editorI
d
,
title
,
sourceFile
,
true
,
"blameFileName"
,
id
);
executeGit
(
workingDirectory
,
arguments
,
editor
,
false
,
GitCommand
::
NoReport
,
lineNumber
);
}
...
...
src/plugins/git/gitconstants.h
View file @
cacdc6c7
...
...
@@ -30,20 +30,27 @@
#ifndef GIT_CONSTANTS_H
#define GIT_CONSTANTS_H
#include <QtCore/QtGlobal>
namespace
Git
{
namespace
Constants
{
const
char
*
const
GIT_COMMAND_LOG_EDITOR_KIND
=
"Git Command Log Editor"
;
const
char
*
const
GIT_COMMAND_LOG_EDITOR_ID
=
"Git Command Log Editor"
;
const
char
*
const
GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Git Command Log Editor"
);
const
char
*
const
C_GIT_COMMAND_LOG_EDITOR
=
"Git Command Log Editor"
;
const
char
*
const
GIT_LOG_EDITOR_KIND
=
"Git File Log Editor"
;
const
char
*
const
GIT_LOG_EDITOR_ID
=
"Git File Log Editor"
;
const
char
*
const
GIT_LOG_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Git File Log Editor"
);
const
char
*
const
C_GIT_LOG_EDITOR
=
"Git File Log Editor"
;
const
char
*
const
GIT_BLAME_EDITOR_KIND
=
"Git Annotation Editor"
;
const
char
*
const
GIT_BLAME_EDITOR_ID
=
"Git Annotation Editor"
;
const
char
*
const
GIT_BLAME_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Git Annotation Editor"
);
const
char
*
const
C_GIT_BLAME_EDITOR
=
"Git Annotation Editor"
;
const
char
*
const
GIT_DIFF_EDITOR_KIND
=
"Git Diff Editor"
;
const
char
*
const
GIT_DIFF_EDITOR_ID
=
"Git Diff Editor"
;
const
char
*
const
GIT_DIFF_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Git Diff Editor"
);
const
char
*
const
C_GIT_DIFF_EDITOR
=
"Git Diff Editor"
;
const
char
*
const
C_GITSUBMITEDITOR
=
"Git Submit Editor"
;
const
char
*
const
GITSUBMITEDITOR_KIND
=
"Git Submit Editor"
;
const
char
*
const
GITSUBMITEDITOR_ID
=
"Git Submit Editor"
;
const
char
*
const
GITSUBMITEDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Git Submit Editor"
);
const
char
*
const
SUBMIT_CURRENT
=
"Git.SubmitCurrentLog"
;
const
char
*
const
DIFF_SELECTED
=
"Git.DiffSelectedFilesInLog"
;
const
char
*
const
SUBMIT_MIMETYPE
=
"application/vnd.nokia.text.git.submit"
;
...
...
src/plugins/git/gitplugin.cpp
View file @
cacdc6c7
...
...
@@ -71,22 +71,26 @@
static
const
VCSBase
::
VCSBaseEditorParameters
editorParameters
[]
=
{
{
VCSBase
::
RegularCommandOutput
,
Git
::
Constants
::
GIT_COMMAND_LOG_EDITOR_KIND
,
Git
::
Constants
::
GIT_COMMAND_LOG_EDITOR_ID
,
Git
::
Constants
::
GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME
,
Git
::
Constants
::
C_GIT_COMMAND_LOG_EDITOR
,
"application/vnd.nokia.text.scs_git_commandlog"
,
"gitlog"
},
{
VCSBase
::
LogOutput
,
Git
::
Constants
::
GIT_LOG_EDITOR_KIND
,
Git
::
Constants
::
GIT_LOG_EDITOR_ID
,
Git
::
Constants
::
GIT_LOG_EDITOR_DISPLAY_NAME
,
Git
::
Constants
::
C_GIT_LOG_EDITOR
,
"application/vnd.nokia.text.scs_git_filelog"
,
"gitfilelog"
},
{
VCSBase
::
AnnotateOutput
,
Git
::
Constants
::
GIT_BLAME_EDITOR_KIND
,
Git
::
Constants
::
GIT_BLAME_EDITOR_ID
,
Git
::
Constants
::
GIT_BLAME_EDITOR_DISPLAY_NAME
,
Git
::
Constants
::
C_GIT_BLAME_EDITOR
,
"application/vnd.nokia.text.scs_git_annotation"
,
"gitsannotate"
},
{
VCSBase
::
DiffOutput
,
Git
::
Constants
::
GIT_DIFF_EDITOR_KIND
,
Git
::
Constants
::
GIT_DIFF_EDITOR_ID
,
Git
::
Constants
::
GIT_DIFF_EDITOR_DISPLAY_NAME
,
Git
::
Constants
::
C_GIT_DIFF_EDITOR
,
"text/x-patch"
,
"diff"
}
};
...
...
@@ -106,7 +110,7 @@ using namespace Git::Internal;
GitPlugin
*
GitPlugin
::
m_instance
=
0
;
GitPlugin
::
GitPlugin
()
:
VCSBase
::
VCSBasePlugin
(
QLatin1String
(
Git
::
Constants
::
GITSUBMITEDITOR_
KIN
D
)),
VCSBase
::
VCSBasePlugin
(
QLatin1String
(
Git
::
Constants
::
GITSUBMITEDITOR_
I
D
)),
m_core
(
0
),
m_diffAction
(
0
),
m_diffProjectAction
(
0
),
...
...
@@ -166,7 +170,8 @@ GitPlugin *GitPlugin::instance()
static
const
VCSBase
::
VCSBaseSubmitEditorParameters
submitParameters
=
{
Git
::
Constants
::
SUBMIT_MIMETYPE
,
Git
::
Constants
::
GITSUBMITEDITOR_KIND
,
Git
::
Constants
::
GITSUBMITEDITOR_ID
,
Git
::
Constants
::
GITSUBMITEDITOR_DISPLAY_NAME
,
Git
::
Constants
::
C_GITSUBMITEDITOR
};
...
...
@@ -518,7 +523,7 @@ void GitPlugin::startCommit()
Core
::
IEditor
*
GitPlugin
::
openSubmitEditor
(
const
QString
&
fileName
,
const
CommitData
&
cd
)
{
Core
::
IEditor
*
editor
=
m_core
->
editorManager
()
->
openEditor
(
fileName
,
QLatin1String
(
Constants
::
GITSUBMITEDITOR_
KIN
D
));
Core
::
IEditor
*
editor
=
m_core
->
editorManager
()
->
openEditor
(
fileName
,
QLatin1String
(
Constants
::
GITSUBMITEDITOR_
I
D
));
if
(
Git
::
Constants
::
debug
)
qDebug
()
<<
Q_FUNC_INFO
<<
fileName
<<
editor
;
m_core
->
editorManager
()
->
ensureEditorManagerVisible
();
...
...
src/plugins/mercurial/constants.h
View file @
cacdc6c7
...
...
@@ -54,24 +54,33 @@ const char * const CHANGEIDEXACT40 = "[a-f0-9]{40,40}";
const
char
*
const
DIFFIDENTIFIER
=
"^[-+]{3,3} [ab]{1,1}.*"
;
// match e.g. +++ b/filename
//BaseEditorParameters
const
char
*
const
COMMANDLOG_ID
=
"Mercurial Command Log Editor"
;
const
char
*
const
COMMANDLOG_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Mercurial Command Log Editor"
);
const
char
*
const
COMMANDLOG
=
"Mercurial Command Log Editor"
;
const
char
*
const
COMMANDAPP
=
"application/vnd.nokia.text.scs_mercurial_commandlog"
;
const
char
*
const
COMMANDEXT
=
"vcsMercurialCommand"
;
const
char
*
const
FILELOG_ID
=
"Mercurial File Log Editor"
;
const
char
*
const
FILELOG_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Mercurial File Log Editor"
);
const
char
*
const
FILELOG
=
"Mercurial File Log Editor"
;
const
char
*
const
LOGAPP
=
"application/vnd.nokia.text.scs_mercurial_log"
;
const
char
*
const
LOGEXT
=
"vcsMercurialLog"
;
const
char
*
const
ANNOTATELOG_ID
=
"Mercurial Annotation Editor"
;
const
char
*
const
ANNOTATELOG_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Mercurial Annotation Editor"
);
const
char
*
const
ANNOTATELOG
=
"Mercurial Annotation Editor"
;
const
char
*
const
ANNOTATEAPP
=
"application/vnd.nokia.text.scs_mercurial_annotatelog"
;
const
char
*
const
ANNOTATEEXT
=
"vcsMercurialAnnotate"
;
const
char
*
const
DIFFLOG_ID
=
"Mercurial Diff Editor"
;
const
char
*
const
DIFFLOG_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Mercurial Diff Editor"
);
const
char
*
const
DIFFLOG
=
"Mercurial Diff Editor"
;
const
char
*
const
DIFFAPP
=
"text/x-patch"
;
const
char
*
const
DIFFEXT
=
"diff"
;
//SubmitEditorParameters
const
char
*
const
COMMITKIND
=
"Mercurial Commit Log Editor"
;
const
char
*
const
COMMIT_ID
=
"Mercurial Commit Log Editor"
;
const
char
*
const
COMMIT_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Mercurial Commit Log Editor"
);
const
char
*
const
COMMITMIMETYPE
=
"application/vnd.nokia.text.scs_mercurial_commitlog"
;
//menu items
...
...
src/plugins/mercurial/mercurialplugin.cpp
View file @
cacdc6c7
...
...
@@ -74,25 +74,29 @@ using namespace Mercurial;
static
const
VCSBase
::
VCSBaseEditorParameters
editorParameters
[]
=
{
{
VCSBase
::
RegularCommandOutput
,
//type
Constants
::
COMMANDLOG
,
// kind
Constants
::
COMMANDLOG_ID
,
// id
Constants
::
COMMANDLOG_DISPLAY_NAME
,
// display name
Constants
::
COMMANDLOG
,
// context
Constants
::
COMMANDAPP
,
// mime type
Constants
::
COMMANDEXT
},
//extension
{
VCSBase
::
LogOutput
,
Constants
::
FILELOG
,
Constants
::
FILELOG_ID
,
Constants
::
FILELOG_DISPLAY_NAME
,
Constants
::
FILELOG
,
Constants
::
LOGAPP
,
Constants
::
LOGEXT
},
{
VCSBase
::
AnnotateOutput
,
Constants
::
ANNOTATELOG
,
Constants
::
ANNOTATELOG_ID
,
Constants
::
ANNOTATELOG_DISPLAY_NAME
,
Constants
::
ANNOTATELOG
,
Constants
::
ANNOTATEAPP
,
Constants
::
ANNOTATEEXT
},
{
VCSBase
::
DiffOutput
,
Constants
::
DIFFLOG
,
Constants
::
DIFFLOG_ID
,
Constants
::
DIFFLOG_DISPLAY_NAME
,
Constants
::
DIFFLOG
,
Constants
::
DIFFAPP
,
Constants
::
DIFFEXT
}
...
...
@@ -100,8 +104,9 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
static
const
VCSBase
::
VCSBaseSubmitEditorParameters
submitEditorParameters
=
{
Constants
::
COMMITMIMETYPE
,
Constants
::
COMMITKIND
,
Constants
::
COMMITKIND
Constants
::
COMMIT_ID
,
Constants
::
COMMIT_DISPLAY_NAME
,
Constants
::
COMMIT_ID
};
// Utility to find a parameter set by type
...
...
@@ -115,7 +120,7 @@ static inline const VCSBase::VCSBaseEditorParameters *findType(int ie)
MercurialPlugin
*
MercurialPlugin
::
m_instance
=
0
;
MercurialPlugin
::
MercurialPlugin
()
:
VCSBase
::
VCSBasePlugin
(
QLatin1String
(
Constants
::
COMMIT
KIN
D
)),
VCSBase
::
VCSBasePlugin
(
QLatin1String
(
Constants
::
COMMIT
_I
D
)),
optionsPage
(
0
),
m_client
(
0
),
changeLog
(
0
),
...
...
@@ -475,7 +480,7 @@ void MercurialPlugin::outgoing()
void
MercurialPlugin
::
createSubmitEditorActions
()
{
QList
<
int
>
context
=
QList
<
int
>
()
<<
core
->
uniqueIDManager
()
->
uniqueIdentifier
(
QLatin1String
(
Constants
::
COMMIT
KIN
D
));
QList
<
int
>
context
=
QList
<
int
>
()
<<
core
->
uniqueIDManager
()
->
uniqueIdentifier
(
QLatin1String
(
Constants
::
COMMIT
_I
D
));
Core
::
Command
*
command
;
editorCommit
=
new
QAction
(
VCSBase
::
VCSBaseSubmitEditor
::
submitIcon
(),
tr
(
"Commit"
),
this
);
...
...
@@ -529,7 +534,7 @@ void MercurialPlugin::showCommitWidget(const QList<QPair<QString, QString> > &st
}
Core
::
IEditor
*
editor
=
core
->
editorManager
()
->
openEditor
(
changeLog
->
fileName
(),
QLatin1String
(
Constants
::
COMMIT
KIN
D
));
QLatin1String
(
Constants
::
COMMIT
_I
D
));
if
(
!
editor
)
{
outputWindow
->
appendError
(
tr
(
"Unable to create an editor for the commit."
));
return
;
...
...
src/plugins/perforce/perforceconstants.h
View file @
cacdc6c7
...
...
@@ -30,24 +30,31 @@
#ifndef PERFORCE_CONSTANTS_H
#define PERFORCE_CONSTANTS_H
#include <QtCore/QtGlobal>
namespace
Perforce
{
namespace
Constants
{
const
char
*
const
PERFORCEEDITOR_CONTEXT
=
"Perforce Editor"
;
const
char
*
const
PERFORCE_SUBMIT_EDITOR_ID
=
"Perforce.SubmitEditor"
;
const
char
*
const
PERFORCE_SUBMIT_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Perforce.SubmitEditor"
);
const
char
*
const
PERFORCESUBMITEDITOR_CONTEXT
=
"Perforce Submit Editor"
;
const
char
*
const
PERFORCE_COMMANDLOG_EDITOR_ID
=
"Perfoirce.CommandLogEditor"
;
const
char
*
const
PERFORCE_COMMANDLOG_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Perforce CommandLog Editor"
);
const
char
*
const
PERFORCE_COMMANDLOG_EDITOR_CONTEXT
=
"Perforce Command Log Editor"
;
const
char
*
const
PERFORCE_LOG_EDITOR_ID
=
"Perforce.LogEditor"
;
const
char
*
const
PERFORCE_LOG_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Perforce Log Editor"
);
const
char
*
const
PERFORCE_LOG_EDITOR_CONTEXT
=
"Perforce Log Editor"
;
const
char
*
const
PERFORCE_DIFF_EDITOR_ID
=
"Perforce.DiffEditor"
;
const
char
*
const
PERFORCE_DIFF_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Perforce Diff Editor"
);
const
char
*
const
PERFORCE_DIFF_EDITOR_CONTEXT
=
"Perforce Diff Editor"
;
const
char
*
const
PERFORCE_ANNOTATION_EDITOR_ID
=
"Perforce.AnnotationEditor"
;
const
char
*
const
PERFORCE_ANNOTATION_EDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Perforce Annotation Editor"
);
const
char
*
const
PERFORCE_ANNOTATION_EDITOR_CONTEXT
=
"Perforce Annotation Editor"
;
const
char
*
const
SUBMIT_CURRENT
=
"Perforce.SubmitCurrentLog"
;
...
...
src/plugins/perforce/perforceplugin.cpp
View file @
cacdc6c7
...
...
@@ -72,21 +72,25 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
{
VCSBase
::
RegularCommandOutput
,
Perforce
::
Constants
::
PERFORCE_COMMANDLOG_EDITOR_ID
,
Perforce
::
Constants
::
PERFORCE_COMMANDLOG_EDITOR_DISPLAY_NAME
,
Perforce
::
Constants
::
PERFORCE_COMMANDLOG_EDITOR_CONTEXT
,
"application/vnd.nokia.text.scs_commandlog"
,
"scslog"
},
{
VCSBase
::
LogOutput
,
Perforce
::
Constants
::
PERFORCE_LOG_EDITOR_ID
,
Perforce
::
Constants
::
PERFORCE_LOG_EDITOR_DISPLAY_NAME
,
Perforce
::
Constants
::
PERFORCE_LOG_EDITOR_CONTEXT
,
"application/vnd.nokia.text.scs_filelog"
,
"scsfilelog"
},
{
VCSBase
::
AnnotateOutput
,
Perforce
::
Constants
::
PERFORCE_ANNOTATION_EDITOR_ID
,
Perforce
::
Constants
::
PERFORCE_ANNOTATION_EDITOR_DISPLAY_NAME
,
Perforce
::
Constants
::
PERFORCE_ANNOTATION_EDITOR_CONTEXT
,
"application/vnd.nokia.text.scs_annotation"
,
"scsannotate"
},
{
VCSBase
::
DiffOutput
,
Perforce
::
Constants
::
PERFORCE_DIFF_EDITOR_ID
,
Perforce
::
Constants
::
PERFORCE_DIFF_EDITOR_DISPLAY_NAME
,
Perforce
::
Constants
::
PERFORCE_DIFF_EDITOR_CONTEXT
,
"text/x-patch"
,
"diff"
}
};
...
...
@@ -205,6 +209,7 @@ PerforcePlugin::PerforcePlugin() :
static
const
VCSBase
::
VCSBaseSubmitEditorParameters
submitParameters
=
{
Perforce
::
Constants
::
SUBMIT_MIMETYPE
,
Perforce
::
Constants
::
PERFORCE_SUBMIT_EDITOR_ID
,
Perforce
::
Constants
::
PERFORCE_SUBMIT_EDITOR_DISPLAY_NAME
,
Perforce
::
Constants
::
PERFORCESUBMITEDITOR_CONTEXT
};
...
...
src/plugins/subversion/subversionconstants.h
View file @
cacdc6c7
...
...
@@ -30,14 +30,18 @@
#ifndef SUBVERSION_CONSTANTS_H
#define SUBVERSION_CONSTANTS_H
#include <QtCore/QtGlobal>
namespace
Subversion
{
namespace
Constants
{
const
char
*
const
SUBVERSION_SUBMIT_MIMETYPE
=
"application/vnd.nokia.text.subversion.submit"
;
const
char
*
const
SUBVERSIONEDITOR
=
"Subversion Editor"
;
const
char
*
const
SUBVERSIONEDITOR_KIND
=
"Subversion Editor"
;
const
char
*
const
SUBVERSIONEDITOR_ID
=
"Subversion Editor"
;
const
char
*
const
SUBVERSIONEDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Subversion Editor"
);
const
char
*
const
SUBVERSIONCOMMITEDITOR
=
"Subversion Commit Editor"
;
const
char
*
const
SUBVERSIONCOMMITEDITOR_KIND
=
"Subversion Commit Editor"
;
const
char
*
const
SUBVERSIONCOMMITEDITOR_ID
=
"Subversion Commit Editor"
;
const
char
*
const
SUBVERSIONCOMMITEDITOR_DISPLAY_NAME
=
QT_TRANSLATE_NOOP
(
"VCS"
,
"Subversion Commit Editor"
);
const
char
*
const
SUBMIT_CURRENT
=
"Subversion.SubmitCurrentLog"
;
const
char
*
const
DIFF_SELECTED
=
"Subversion.DiffSelectedFilesInLog"
;
enum
{
debug
=
0
};
...
...
src/plugins/subversion/subversionplugin.cpp
View file @
cacdc6c7
...
...
@@ -97,22 +97,26 @@ static const char *nonInteractiveOptionC = "--non-interactive";
static
const
VCSBase
::
VCSBaseEditorParameters
editorParameters
[]
=
{
{
VCSBase
::
RegularCommandOutput
,
"Subversion Command Log Editor"
,
// kind
"Subversion Command Log Editor"
,
// id
QT_TRANSLATE_NOOP
(
"VCS"
,
"Subversion Command Log Editor"
),
// display name
"Subversion Command Log Editor"
,
// context
"application/vnd.nokia.text.scs_svn_commandlog"
,
"scslog"
},
{
VCSBase
::
LogOutput
,
"Subversion File Log Editor"
,
// kind
"Subversion File Log Editor"
,
// id
QT_TRANSLATE_NOOP
(
"VCS"
,
"Subversion File Log Editor"
),
// display_name
"Subversion File Log Editor"
,
// context
"application/vnd.nokia.text.scs_svn_filelog"
,
"scsfilelog"
},
{
VCSBase
::
AnnotateOutput
,
"Subversion Annotation Editor"
,
// kind
"Subversion Annotation Editor"
,
// id
QT_TRANSLATE_NOOP
(
"VCS"
,
"Subversion Annotation Editor"
),
// display_name
"Subversion Annotation Editor"
,
// context
"application/vnd.nokia.text.scs_svn_annotation"
,
"scsannotate"
},
{
VCSBase
::
DiffOutput
,
"Subversion Diff Editor"
,
// kind
"Subversion Diff Editor"
,
// id
QT_TRANSLATE_NOOP
(
"VCS"
,
"Subversion Diff Editor"
),
// display_name
"Subversion Diff Editor"
,
// context
"text/x-patch"
,
"diff"
}
};
...
...
@@ -175,7 +179,7 @@ static inline QStringList svnDirectories()
SubversionPlugin
*
SubversionPlugin
::
m_subversionPluginInstance
=
0
;
SubversionPlugin
::
SubversionPlugin
()
:
VCSBase
::
VCSBasePlugin
(
QLatin1String
(
Subversion
::
Constants
::
SUBVERSIONCOMMITEDITOR_
KIN
D
)),
VCSBase
::
VCSBasePlugin
(
QLatin1String
(
Subversion
::
Constants
::
SUBVERSIONCOMMITEDITOR_
I
D
)),
m_svnDirectories
(
svnDirectories
()),
m_addAction
(
0
),
m_deleteAction
(
0
),
...
...
@@ -221,7 +225,8 @@ bool SubversionPlugin::isCommitEditorOpen() const
static
const
VCSBase
::
VCSBaseSubmitEditorParameters
submitParameters
=
{
Subversion
::
Constants
::
SUBVERSION_SUBMIT_MIMETYPE
,
Subversion
::
Constants
::
SUBVERSIONCOMMITEDITOR_KIND
,
Subversion
::
Constants
::
SUBVERSIONCOMMITEDITOR_ID
,
Subversion
::
Constants
::
SUBVERSIONCOMMITEDITOR_DISPLAY_NAME
,
Subversion
::
Constants
::
SUBVERSIONCOMMITEDITOR
};
...
...
@@ -506,7 +511,7 @@ void SubversionPlugin::svnDiff(const QString &workingDir, const QStringList &fil
SubversionSubmitEditor
*
SubversionPlugin
::
openSubversionSubmitEditor
(
const
QString
&
fileName
)
{
Core
::
IEditor
*
editor
=
Core
::
EditorManager
::
instance
()
->
openEditor
(
fileName
,
QLatin1String
(
Constants
::
SUBVERSIONCOMMITEDITOR_
KIN
D
));
Core
::
IEditor
*
editor
=
Core
::
EditorManager
::
instance
()
->
openEditor
(
fileName
,
QLatin1String
(
Constants
::
SUBVERSIONCOMMITEDITOR_
I
D
));
SubversionSubmitEditor
*
submitEditor
=
qobject_cast
<
SubversionSubmitEditor
*>
(
editor
);
QTC_ASSERT
(
submitEditor
,
/**/
);
submitEditor
->
registerActions
(
m_submitUndoAction
,
m_submitRedoAction
,
m_submitCurrentLogAction
,
m_submitDiffAction
);
...
...
src/plugins/vcsbase/basevcseditorfactory.cpp
View file @
cacdc6c7
...
...
@@ -35,6 +35,8 @@
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorsettings.h>
#include <QtCore/QCoreApplication>
namespace
VCSBase
{
struct
BaseVCSEditorFactoryPrivate
...
...
@@ -43,6 +45,7 @@ struct BaseVCSEditorFactoryPrivate
const
VCSBaseEditorParameters
*
m_type
;
const
QString
m_id
;
QString
m_displayName
;
const
QStringList
m_mimeTypes
;
TextEditor
::
TextEditorActionHandler
*
m_editorHandler
;
};
...
...
@@ -58,6 +61,7 @@ BaseVCSEditorFactoryPrivate::BaseVCSEditorFactoryPrivate(const VCSBaseEditorPara
BaseVCSEditorFactory
::
BaseVCSEditorFactory
(
const
VCSBaseEditorParameters
*
t
)
:
m_d
(
new
BaseVCSEditorFactoryPrivate
(
t
))
{
m_d
->
m_displayName
=
QCoreApplication
::
translate
(
"VCS"
,
t
->
displayName
);
}
BaseVCSEditorFactory
::~
BaseVCSEditorFactory
()
...
...
@@ -77,7 +81,7 @@ QString BaseVCSEditorFactory::id() const
QString
BaseVCSEditorFactory
::
displayName
()
const
{
return
tr
(
"Base VCS Editor"
,
"VCSBase BaseVCSEditorFactory display name."
)
;
return
m_d
->
m_displayName
;
}
Core
::
IFile
*
BaseVCSEditorFactory
::
open
(
const
QString
&
fileName
)
...
...
src/plugins/vcsbase/vcsbaseeditor.cpp
View file @
cacdc6c7
...
...
@@ -82,6 +82,7 @@ public:
bool
duplicateSupported
()
const
{
return
false
;
}
Core
::
IEditor
*
duplicate
(
QWidget
*
/*parent*/
)
{
return
0
;
}
QString
id
()
const
{
return
m_id
;
}
QString
displayName
()
const
{
return
m_displayName
;
}
bool
isTemporary
()
const
{
return
true
;
}
...
...
@@ -91,13 +92,15 @@ signals:
private:
QString
m_id
;
QString
m_displayName
;
QList
<
int
>
m_context
;
};
VCSBaseEditorEditable
::
VCSBaseEditorEditable
(
VCSBaseEditor
*
editor
,
const
VCSBaseEditorParameters
*
type
)
:
BaseTextEditorEditable
(
editor
),
m_id
(
type
->
id
)
m_id
(
type
->
id
),
m_displayName
(
QCoreApplication
::
translate
(
"VCS"
,
type
->
displayName
))
{
Core
::
UniqueIDManager
*
uidm
=
Core
::
UniqueIDManager
::
instance
();
m_context
<<
uidm
->
uniqueIdentifier
(
QLatin1String
(
type
->
context
))
...
...
src/plugins/vcsbase/vcsbaseeditor.h
View file @
cacdc6c7
...
...
@@ -74,8 +74,8 @@ enum EditorContentType {
// VCS commands with redirection.
struct
VCSBASE_EXPORT
VCSBaseEditorParameters
{
EditorContentType
type
;
QString
id
;
QString
displayName
;
const
char
*
id
;
const
char
*
displayName
;
const
char
*
context
;
const
char
*
mimeType
;
const
char
*
extension
;
...
...
src/plugins/vcsbase/vcsbasesubmiteditor.cpp
View file @
cacdc6c7
...
...
@@ -308,6 +308,8 @@ Core::IFile *VCSBaseSubmitEditor::file()
QString
VCSBaseSubmitEditor
::
displayName
()
const
{
if
(
m_d
->
m_displayName
.
isEmpty
())
m_d
->
m_displayName
=
QCoreApplication
::
translate
(
"VCS"
,
m_d
->
m_parameters
->
displayName
);
return
m_d
->
m_displayName
;
}
...
...
src/plugins/vcsbase/vcsbasesubmiteditor.h
View file @
cacdc6c7
...
...
@@ -56,8 +56,8 @@ struct VCSBaseSubmitEditorPrivate;
/* Utility struct to parametrize a VCSBaseSubmitEditor. */
struct
VCSBASE_EXPORT
VCSBaseSubmitEditorParameters
{
const
char
*
mimeType
;
QString
id
;
QString
displayName
;
const
char
*
id
;
const
char
*
displayName
;
const
char
*
context
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment