forked from qt-creator/qt-creator
Make method naming more consistent.
* Use id() for methods returning a string used to represent
some type of object.
* Use displayName() for strings that are meant to be user
visible.
* Quieten some warnings while touching the files anyway.
* Move Factories to their products in the plugins where that
was not done before.
Reviewed-by: dt
This commit is contained in:
@@ -194,7 +194,7 @@ void StateListener::slotStateChanged()
|
||||
Core::IVersionControl *projectControl = 0;
|
||||
if (const ProjectExplorer::Project *currentProject = pe->currentProject()) {
|
||||
state.currentProjectPath = QFileInfo(currentProject->file()->fileName()).absolutePath();
|
||||
state.currentProjectName = currentProject->name();
|
||||
state.currentProjectName = currentProject->displayName();
|
||||
projectControl = vcsManager->findVersionControlForDirectory(state.currentProjectPath,
|
||||
&state.currentProjectTopLevel);
|
||||
if (projectControl) {
|
||||
@@ -209,7 +209,7 @@ void StateListener::slotStateChanged()
|
||||
// Assemble state and emit signal.
|
||||
Core::IVersionControl *vc = state.currentFile.isEmpty() ? projectControl : fileControl;
|
||||
if (debug)
|
||||
qDebug() << state << (vc ? vc->name() : QString(QLatin1String("No version control")));
|
||||
qDebug() << state << (vc ? vc->displayName() : QString(QLatin1String("No version control")));
|
||||
emit stateChanged(state, vc);
|
||||
}
|
||||
|
||||
@@ -342,9 +342,9 @@ VCSBASE_EXPORT QDebug operator<<(QDebug in, const VCSBasePluginState &state)
|
||||
|
||||
// VCSBasePlugin
|
||||
struct VCSBasePluginPrivate {
|
||||
explicit VCSBasePluginPrivate(const QString &submitEditorKind);
|
||||
explicit VCSBasePluginPrivate(const QString &submitEditorId);
|
||||
|
||||
const QString m_submitEditorKind;
|
||||
const QString m_submitEditorId;
|
||||
Core::IVersionControl *m_versionControl;
|
||||
VCSBasePluginState m_state;
|
||||
int m_actionState;
|
||||
@@ -352,8 +352,8 @@ struct VCSBasePluginPrivate {
|
||||
static Internal::StateListener *m_listener;
|
||||
};
|
||||
|
||||
VCSBasePluginPrivate::VCSBasePluginPrivate(const QString &submitEditorKind) :
|
||||
m_submitEditorKind(submitEditorKind),
|
||||
VCSBasePluginPrivate::VCSBasePluginPrivate(const QString &submitEditorId) :
|
||||
m_submitEditorId(submitEditorId),
|
||||
m_versionControl(0),
|
||||
m_actionState(-1)
|
||||
{
|
||||
@@ -361,8 +361,8 @@ VCSBasePluginPrivate::VCSBasePluginPrivate(const QString &submitEditorKind) :
|
||||
|
||||
Internal::StateListener *VCSBasePluginPrivate::m_listener = 0;
|
||||
|
||||
VCSBasePlugin::VCSBasePlugin(const QString &submitEditorKind) :
|
||||
d(new VCSBasePluginPrivate(submitEditorKind))
|
||||
VCSBasePlugin::VCSBasePlugin(const QString &submitEditorId) :
|
||||
d(new VCSBasePluginPrivate(submitEditorId))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -391,8 +391,8 @@ void VCSBasePlugin::initialize(Core::IVersionControl *vc)
|
||||
void VCSBasePlugin::slotSubmitEditorAboutToClose(VCSBaseSubmitEditor *submitEditor, bool *result)
|
||||
{
|
||||
if (debug)
|
||||
qDebug() << this << d->m_submitEditorKind << "Closing submit editor" << submitEditor << submitEditor->kind();
|
||||
if (submitEditor->kind() == d->m_submitEditorKind)
|
||||
qDebug() << this << d->m_submitEditorId << "Closing submit editor" << submitEditor << submitEditor->id();
|
||||
if (submitEditor->id() == d->m_submitEditorId)
|
||||
*result = submitEditorAboutToClose(submitEditor);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user