forked from qt-creator/qt-creator
VCS: Use category logging
+ clean the logs a bit. Change-Id: I5a196f7007eb2b76bcdce4b2ac152da84698b860 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
299c777c01
commit
0138b73469
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QLoggingCategory>
|
||||||
#include <QSharedData>
|
#include <QSharedData>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
@@ -57,7 +58,10 @@ using namespace Core;
|
|||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
enum { debug = 0, debugRepositorySearch = 0 };
|
namespace {
|
||||||
|
Q_LOGGING_CATEGORY(baseLog, "qtc.vcs.base")
|
||||||
|
Q_LOGGING_CATEGORY(findRepoLog, "qtc.vcs.find-repo")
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\namespace VcsBase
|
\namespace VcsBase
|
||||||
@@ -570,11 +574,10 @@ void VcsBasePlugin::extensionsInitialized()
|
|||||||
|
|
||||||
void VcsBasePlugin::slotSubmitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor, bool *result)
|
void VcsBasePlugin::slotSubmitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor, bool *result)
|
||||||
{
|
{
|
||||||
if (debug)
|
qCDebug(baseLog) << this << "plugin's submit editor" << d->m_submitEditor
|
||||||
qDebug() << this << "plugin's submit editor"
|
<< (d->m_submitEditor ? d->m_submitEditor->document()->id().name() : QByteArray())
|
||||||
<< d->m_submitEditor << (d->m_submitEditor ? d->m_submitEditor->document()->id().name() : "")
|
<< "closing submit editor" << submitEditor
|
||||||
<< "closing submit editor" << submitEditor
|
<< (submitEditor ? submitEditor->document()->id().name() : QByteArray());
|
||||||
<< (submitEditor ? submitEditor->document()->id().name() : "");
|
|
||||||
if (submitEditor == d->m_submitEditor)
|
if (submitEditor == d->m_submitEditor)
|
||||||
*result = submitEditorAboutToClose();
|
*result = submitEditorAboutToClose();
|
||||||
}
|
}
|
||||||
@@ -613,8 +616,7 @@ const VcsBasePluginState &VcsBasePlugin::currentState() const
|
|||||||
|
|
||||||
bool VcsBasePlugin::enableMenuAction(ActionState as, QAction *menuAction) const
|
bool VcsBasePlugin::enableMenuAction(ActionState as, QAction *menuAction) const
|
||||||
{
|
{
|
||||||
if (debug)
|
qCDebug(baseLog) << "enableMenuAction" << menuAction->text() << as;
|
||||||
qDebug() << "enableMenuAction" << menuAction->text() << as;
|
|
||||||
switch (as) {
|
switch (as) {
|
||||||
case NoVcsEnabled: {
|
case NoVcsEnabled: {
|
||||||
const bool supportsCreation = d->supportsRepositoryCreation();
|
const bool supportsCreation = d->supportsRepositoryCreation();
|
||||||
@@ -727,8 +729,7 @@ bool VcsBasePlugin::raiseSubmitEditor() const
|
|||||||
QString VcsBasePlugin::findRepositoryForDirectory(const QString &dirS,
|
QString VcsBasePlugin::findRepositoryForDirectory(const QString &dirS,
|
||||||
const QString &checkFile)
|
const QString &checkFile)
|
||||||
{
|
{
|
||||||
if (debugRepositorySearch)
|
qCDebug(findRepoLog) << ">" << dirS << checkFile;
|
||||||
qDebug() << ">VcsBasePlugin::findRepositoryForDirectory" << dirS << checkFile;
|
|
||||||
QTC_ASSERT(!dirS.isEmpty() && !checkFile.isEmpty(), return QString());
|
QTC_ASSERT(!dirS.isEmpty() && !checkFile.isEmpty(), return QString());
|
||||||
|
|
||||||
const QString root = QDir::rootPath();
|
const QString root = QDir::rootPath();
|
||||||
@@ -741,13 +742,11 @@ QString VcsBasePlugin::findRepositoryForDirectory(const QString &dirS,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (QFileInfo(directory, checkFile).isFile()) {
|
if (QFileInfo(directory, checkFile).isFile()) {
|
||||||
if (debugRepositorySearch)
|
qCDebug(findRepoLog) << "<" << absDirPath;
|
||||||
qDebug() << "<VcsBasePlugin::findRepositoryForDirectory> " << absDirPath;
|
|
||||||
return absDirPath;
|
return absDirPath;
|
||||||
}
|
}
|
||||||
} while (!directory.isRoot() && directory.cdUp());
|
} while (!directory.isRoot() && directory.cdUp());
|
||||||
if (debugRepositorySearch)
|
qCDebug(findRepoLog) << "< bailing out at" << directory.absolutePath();
|
||||||
qDebug() << "<VcsBasePlugin::findRepositoryForDirectory bailing out at " << directory.absolutePath();
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user