summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-01-21 12:07:19 +0100
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-01-21 12:07:19 +0100
commit31f7b0fbadecbbf2e7de34e0c188c0b68784dae8 (patch)
tree64d37237ae24b3999340536bd15f3f4aabc3ce6c /src/plugins
parentdf92275f4622de20a680cb4b8a53c2cae7cb7e13 (diff)
downloadqt-creator-31f7b0fbadecbbf2e7de34e0c188c0b68784dae8.tar.gz
Fixes: Unified debug enum in the designer plugin
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/designer/cpp/formclasswizard.cpp4
-rw-r--r--src/plugins/designer/designerconstants.h3
-rw-r--r--src/plugins/designer/formeditorw.cpp23
-rw-r--r--src/plugins/designer/formwindoweditor.cpp26
-rw-r--r--src/plugins/designer/formwindowfile.cpp19
-rw-r--r--src/plugins/designer/formwindowhost.cpp10
-rw-r--r--src/plugins/designer/formwizard.cpp2
-rw-r--r--src/plugins/designer/settingsmanager.cpp21
-rw-r--r--src/plugins/designer/workbenchintegration.cpp15
9 files changed, 54 insertions, 69 deletions
diff --git a/src/plugins/designer/cpp/formclasswizard.cpp b/src/plugins/designer/cpp/formclasswizard.cpp
index 77d002f2d7..c480fc059f 100644
--- a/src/plugins/designer/cpp/formclasswizard.cpp
+++ b/src/plugins/designer/cpp/formclasswizard.cpp
@@ -43,8 +43,6 @@
#include <QtCore/QDir>
#include <QtCore/QDebug>
-enum { debugFormClassWizard = 0 };
-
using namespace Designer;
using namespace Designer::Internal;
@@ -111,7 +109,7 @@ Core::GeneratedFiles FormClassWizard::generateFiles(const QWizard *w, QString *e
sourceFile.setContents(source);
headerFile.setContents(header);
- if (debugFormClassWizard)
+ if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << '\n' << header << '\n' << source;
return Core::GeneratedFiles() << headerFile << sourceFile << uiFile;
diff --git a/src/plugins/designer/designerconstants.h b/src/plugins/designer/designerconstants.h
index 0f4024f2b9..f403f6322f 100644
--- a/src/plugins/designer/designerconstants.h
+++ b/src/plugins/designer/designerconstants.h
@@ -67,6 +67,9 @@ enum EditModes
NumEditModes
};
+namespace Internal {
+ enum { debug = 0 };
+}
} // Constants
} // Designer
diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp
index 0067b5b50f..da8374091d 100644
--- a/src/plugins/designer/formeditorw.cpp
+++ b/src/plugins/designer/formeditorw.cpp
@@ -83,7 +83,6 @@
#include <QtCore/QDebug>
#include <QtCore/QSettings>
-enum { debugFormEditor = 0 };
enum { wantCodeGenerationAction = 0 };
static const char *editorWidgetStateKeyC = "editorWidgetState";
@@ -169,7 +168,7 @@ FormEditorW::FormEditorW() :
m_actionPrint(0),
m_actionGenerateCode(0)
{
- if (debugFormEditor)
+ if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO;
QTC_ASSERT(!m_self, return);
m_self = this;
@@ -220,7 +219,7 @@ void FormEditorW::fullInit()
{
QTC_ASSERT(m_initStage == RegisterPlugins, return);
QTime *initTime = 0;
- if (debugFormEditor) {
+ if (Designer::Constants::Internal::debug) {
initTime = new QTime;
initTime->start();
}
@@ -244,7 +243,7 @@ void FormEditorW::fullInit()
}
}
- if (debugFormEditor) {
+ if (Designer::Constants::Internal::debug) {
qDebug() << Q_FUNC_INFO << initTime->elapsed() << "ms";
delete initTime;
}
@@ -282,7 +281,7 @@ void FormEditorW::initDesignerSubWindows()
void FormEditorW::ensureInitStage(InitializationStage s)
{
- if (debugFormEditor)
+ if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << s;
if (!m_self)
m_self = new FormEditorW;
@@ -573,8 +572,8 @@ void FormEditorW::editorDestroyed()
{
QObject *source = sender();
- if (debugFormEditor)
- qDebug() << "FormEditorW::editorDestroyed()" << source;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << source;
for (EditorList::iterator it = m_formWindows.begin(); it != m_formWindows.end(); ) {
if (*it == source) {
@@ -588,8 +587,8 @@ void FormEditorW::editorDestroyed()
void FormEditorW::currentEditorChanged(Core::IEditor *editor)
{
- if (debugFormEditor)
- qDebug() << "FormEditorW::currentEditorChanged" << editor << " of " << m_fwm->formWindowCount();
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << editor << " of " << m_fwm->formWindowCount();
// Deactivate Designer if a non-form is being edited
if (editor && !qstrcmp(editor->kind(), Constants::C_FORMWINDOW)) {
@@ -604,9 +603,8 @@ void FormEditorW::currentEditorChanged(Core::IEditor *editor)
void FormEditorW::activeFormWindowChanged(QDesignerFormWindowInterface *afw)
{
- if (debugFormEditor)
- qDebug() << "FormEditorW::activeFormWindowChanged" << afw
- << " of " << m_fwm->formWindowCount() << m_formWindows;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << afw << " of " << m_fwm->formWindowCount() << m_formWindows;
m_fwm->closeAllPreviews();
@@ -718,7 +716,6 @@ void FormEditorW::print()
painter.drawPixmap(0, 0, pixmap);
m_core->mainWindow()->setCursor(oldCursor);
-// m_core->statusBar()->showMessage(tr("Printed %1...").arg(QFileInfo(fw->fileName()).fileName()));
} while (false);
m_core->printer()->setFullPage(oldFullPage);
m_core->printer()->setOrientation(oldOrientation);
diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp
index 3865716f82..be6b763e61 100644
--- a/src/plugins/designer/formwindoweditor.cpp
+++ b/src/plugins/designer/formwindoweditor.cpp
@@ -64,8 +64,6 @@ using ProjectExplorer::ProjectNode;
using ProjectExplorer::FolderNode;
using ProjectExplorer::FileNode;
-enum { debugFormWindowEditor = 0 };
-
class QrcFilesVisitor : public NodesVisitor
{
public:
@@ -109,8 +107,8 @@ FormWindowEditor::FormWindowEditor(const QList<int> &context,
m_sessionNode(0),
m_sessionWatcher(0)
{
- if (debugFormWindowEditor)
- qDebug() << "FormWindowEditor::FormWindowEditor" << form << parent;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << form << parent;
connect(m_file, SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
connect(m_file, SIGNAL(setDisplayName(QString)), this, SLOT(slotSetDisplayName(QString)));
@@ -130,8 +128,8 @@ FormWindowEditor::~FormWindowEditor()
delete m_toolBar;
delete m_host;
delete m_editorWidget;
- if (debugFormWindowEditor)
- qDebug() << "FormWindowEditor::~FormWindowEditor" << m_displayName;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << m_displayName;
if (m_sessionNode && m_sessionWatcher) {
m_sessionNode->unregisterWatcher(m_sessionWatcher);
delete m_sessionWatcher;
@@ -140,8 +138,8 @@ FormWindowEditor::~FormWindowEditor()
bool FormWindowEditor::createNew(const QString &contents)
{
- if (debugFormWindowEditor)
- qDebug() << "FormWindowEditor::createNew()" << contents.size() << "chars";
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << contents.size() << "chars";
if (!m_formWindow)
return false;
@@ -157,8 +155,8 @@ bool FormWindowEditor::createNew(const QString &contents)
bool FormWindowEditor::open(const QString &fileName /*= QString()*/)
{
- if (debugFormWindowEditor)
- qDebug() << "FormWindowEditor::open" << fileName;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << fileName;
if (fileName.isEmpty()) {
setDisplayName(tr("untitled"));
@@ -240,8 +238,8 @@ void FormWindowEditor::slotOpen(const QString &fileName)
void FormWindowEditor::slotSetDisplayName(const QString &title)
{
- if (debugFormWindowEditor)
- qDebug() << "FormWindowEditor::slotSetDisplayName" << title;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << title;
setDisplayName(title);
}
@@ -304,8 +302,8 @@ QWidget *FormWindowEditor::widget()
bool FormWindowEditor::generateCode(QByteArray &header, QString &errorMessage) const
{
- if (debugFormWindowEditor)
- qDebug() << "FormWindowEditor::generateCode";
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO;
QString tempPattern = QDir::tempPath();
if (!tempPattern.endsWith(QDir::separator())) // platform-dependant
diff --git a/src/plugins/designer/formwindowfile.cpp b/src/plugins/designer/formwindowfile.cpp
index f638c04358..f2d833642a 100644
--- a/src/plugins/designer/formwindowfile.cpp
+++ b/src/plugins/designer/formwindowfile.cpp
@@ -53,9 +53,6 @@ using namespace Designer::Internal;
using namespace Designer::Constants;
using namespace SharedTools;
-enum { debugFormWindowFile = 0 };
-
-
FormWindowFile::FormWindowFile(QDesignerFormWindowInterface *form, QObject *parent)
: Core::IFile(parent),
m_mimeType(QLatin1String(FORM_MIMETYPE)),
@@ -67,8 +64,8 @@ bool FormWindowFile::save(const QString &name /*= QString()*/)
{
const QString actualName = name.isEmpty() ? fileName() : name;
- if (debugFormWindowFile)
- qDebug() << "FormWindowFile::save" << name << "->" << actualName;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << name << "->" << actualName;
if (actualName.isEmpty())
return false;
@@ -118,8 +115,8 @@ bool FormWindowFile::isSaveAsAllowed() const
void FormWindowFile::modified(Core::IFile::ReloadBehavior *behavior)
{
- if (debugFormWindowFile)
- qDebug() << "FormWindowFile::modified" << m_fileName << *behavior;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << m_fileName << *behavior;
switch (*behavior) {
case Core::IFile::ReloadNone:
@@ -157,8 +154,8 @@ QString FormWindowFile::defaultPath() const
void FormWindowFile::setSuggestedFileName(const QString &fileName)
{
- if (debugFormWindowFile)
- qDebug() << "FormWindowFile:setSuggestedFileName" << m_fileName << fileName;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << m_fileName << fileName;
m_suggestedName = fileName;
}
@@ -175,8 +172,8 @@ QString FormWindowFile::mimeType() const
bool FormWindowFile::writeFile(const QString &fileName, QString &errorString) const
{
- if (debugFormWindowFile)
- qDebug() << "FormWindowFile::writeFile" << m_fileName << fileName;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << m_fileName << fileName;
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
diff --git a/src/plugins/designer/formwindowhost.cpp b/src/plugins/designer/formwindowhost.cpp
index e1de87af80..a2f3da0f0f 100644
--- a/src/plugins/designer/formwindowhost.cpp
+++ b/src/plugins/designer/formwindowhost.cpp
@@ -44,8 +44,6 @@
using namespace Designer::Internal;
using namespace SharedTools;
-enum { debugFormWindowHost = 0 };
-
FormWindowHost::FormWindowHost(QDesignerFormWindowInterface *form,
QWidget *parent) :
WidgetHost(parent, form)
@@ -57,14 +55,14 @@ FormWindowHost::FormWindowHost(QDesignerFormWindowInterface *form,
FormWindowHost::~FormWindowHost()
{
- if (debugFormWindowHost)
- qDebug() << "FormWindowHost::~FormWindowHost";
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO;
}
void FormWindowHost::formSizeChanged(int w, int h)
{
- if (debugFormWindowHost)
- qDebug() << "FormWindowHost::formSizeChanged" << w << h;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << w << h;
formWindow()->setDirty(true);
static const QString geometry = QLatin1String("geometry");
diff --git a/src/plugins/designer/formwizard.cpp b/src/plugins/designer/formwizard.cpp
index d69c2abbbb..77029f6500 100644
--- a/src/plugins/designer/formwizard.cpp
+++ b/src/plugins/designer/formwizard.cpp
@@ -39,8 +39,6 @@
#include <QtCore/QFile>
#include <QtCore/QDebug>
-enum { debugFormWizard = 0 };
-
using namespace Designer;
using namespace Designer::Internal;
diff --git a/src/plugins/designer/settingsmanager.cpp b/src/plugins/designer/settingsmanager.cpp
index 3edad0921b..a827ddf162 100644
--- a/src/plugins/designer/settingsmanager.cpp
+++ b/src/plugins/designer/settingsmanager.cpp
@@ -32,26 +32,23 @@
***************************************************************************/
#include "settingsmanager.h"
+#include "designerconstants.h"
#include <QtCore/QDebug>
using namespace Designer::Internal;
-namespace {
- bool debug = false;
-}
-
void SettingsManager::beginGroup(const QString &prefix)
{
- if (debug)
- qDebug() << "Designer - beginning group " << addPrefix(prefix);
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << addPrefix(prefix);
m_settings.beginGroup(addPrefix(prefix));
}
void SettingsManager::endGroup()
{
- if (debug)
- qDebug() << "Designer - end group";
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO;
m_settings.endGroup();
}
@@ -62,16 +59,16 @@ bool SettingsManager::contains(const QString &key) const
void SettingsManager::setValue(const QString &key, const QVariant &value)
{
- if (debug)
- qDebug() << "Designer - storing " << addPrefix(key) << ": " << value;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << addPrefix(key) << ": " << value;
m_settings.setValue(addPrefix(key), value);
}
QVariant SettingsManager::value(const QString &key, const QVariant &defaultValue) const
{
QVariant result = m_settings.value(addPrefix(key), defaultValue);
- if (debug)
- qDebug() << "Designer - retrieving " << addPrefix(key) << ": " << result;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << addPrefix(key) << ": " << result;
return result;
}
diff --git a/src/plugins/designer/workbenchintegration.cpp b/src/plugins/designer/workbenchintegration.cpp
index 9e25f80432..6f699b8381 100644
--- a/src/plugins/designer/workbenchintegration.cpp
+++ b/src/plugins/designer/workbenchintegration.cpp
@@ -59,7 +59,6 @@
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
-enum { debugSlotNavigation = 0 };
enum { indentation = 4 };
using namespace Designer::Internal;
@@ -149,7 +148,7 @@ static bool matchMemberClassName(const QString &needle, const QString &hayStack)
// Find class definition in namespace
static const Class *findClass(const Namespace *parentNameSpace, const QString &className, QString *namespaceName)
{
- if (debugSlotNavigation)
+ if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << className;
const Overview o;
@@ -487,7 +486,7 @@ static ClassDocumentPtrPair
const Document::Ptr &doc, const QString &className,
unsigned maxIncludeDepth, QString *namespaceName)
{
- if (debugSlotNavigation)
+ if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << doc->fileName() << maxIncludeDepth;
// Check document
if (const Class *cl = findClass(doc->globalNamespace(), className, namespaceName))
@@ -548,8 +547,8 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName,
const CPlusPlus::Snapshot docTable = cppModelManagerInstance()->snapshot();
QList<Document::Ptr> docList = findDocumentsIncluding(docTable, uicedName, true); // change to false when we know the absolute path to generated ui_<>.h file
- if (debugSlotNavigation)
- qDebug() << objectName << signalSignature << "Looking for " << uicedName << " returned " << docList.size();
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << objectName << signalSignature << "Looking for " << uicedName << " returned " << docList.size();
if (docList.isEmpty()) {
*errorMessage = tr("No documents matching %1 could be found.").arg(uicedName);
return false;
@@ -559,7 +558,7 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName,
const QString uiClass = uiClassName(fwi->mainContainer()->objectName());
- if (debugSlotNavigation)
+ if (Designer::Constants::Internal::debug)
qDebug() << "Checking docs for " << uiClass;
// Find the class definition in the file itself or in the directly
@@ -587,8 +586,8 @@ bool WorkbenchIntegration::navigateToSlot(const QString &objectName,
const QString functionName = QLatin1String("on_") + objectName + QLatin1Char('_') + signalSignature;
const QString functionNameWithParameterNames = addParameterNames(functionName, parameterNames);
- if (debugSlotNavigation)
- qDebug() << "Found " << uiClass << doc->fileName() << " checking " << functionName << functionNameWithParameterNames;
+ if (Designer::Constants::Internal::debug)
+ qDebug() << Q_FUNC_INFO << "Found " << uiClass << doc->fileName() << " checking " << functionName << functionNameWithParameterNames;
int line = 0;
Document::Ptr sourceDoc;