summaryrefslogtreecommitdiffstats
path: root/tools/designer
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2009-06-10 11:46:23 (GMT)
committerRobert Griebl <rgriebl@trolltech.com>2009-06-10 11:46:23 (GMT)
commit7604f8087f88171ef933d8ae08f501467e647338 (patch)
tree51d071f462ed48d0b25884d9f62b8ba11c5dff13 /tools/designer
parent8c265860b41214daade7c8a28237c1e07ea71a3c (diff)
downloadQt-7604f8087f88171ef933d8ae08f501467e647338.zip
Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.gz
Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.bz2
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions, which also contains the full history. Rev-By: Harald Fernengel Rev-By: Ralf Engels
Diffstat (limited to 'tools/designer')
-rw-r--r--tools/designer/src/components/formeditor/brushmanagerproxy.cpp4
-rw-r--r--tools/designer/src/components/formeditor/brushmanagerproxy.h2
-rw-r--r--tools/designer/src/components/formeditor/qtbrushmanager.cpp5
-rw-r--r--tools/designer/src/components/formeditor/qtbrushmanager.h2
-rw-r--r--tools/designer/src/lib/shared/iconselector.cpp5
-rw-r--r--tools/designer/src/lib/shared/iconselector_p.h4
-rw-r--r--tools/designer/src/lib/shared/qtresourceeditordialog.cpp5
-rw-r--r--tools/designer/src/lib/shared/qtresourceeditordialog_p.h3
-rw-r--r--tools/designer/src/lib/shared/qtresourcemodel.cpp2
-rw-r--r--tools/designer/src/lib/shared/qtresourcemodel_p.h5
-rw-r--r--tools/designer/src/lib/shared/qtresourceview.cpp4
-rw-r--r--tools/designer/src/lib/shared/qtresourceview_p.h4
-rw-r--r--tools/designer/src/uitools/quiloader.cpp1
-rw-r--r--tools/designer/src/uitools/quiloader.h3
14 files changed, 17 insertions, 32 deletions
diff --git a/tools/designer/src/components/formeditor/brushmanagerproxy.cpp b/tools/designer/src/components/formeditor/brushmanagerproxy.cpp
index b1c056e..86880f3 100644
--- a/tools/designer/src/components/formeditor/brushmanagerproxy.cpp
+++ b/tools/designer/src/components/formeditor/brushmanagerproxy.cpp
@@ -146,14 +146,12 @@ QString BrushManagerProxyPrivate::uniqueBrushFileName(const QString &brushName)
BrushManagerProxy::BrushManagerProxy(QDesignerFormEditorInterface *core, QObject *parent)
- : QObject(parent)
+ : QObject(parent), d_ptr(new BrushManagerProxyPrivate(this, core))
{
- d_ptr = new BrushManagerProxyPrivate(this, core);
}
BrushManagerProxy::~BrushManagerProxy()
{
- delete d_ptr;
}
void BrushManagerProxy::setBrushManager(QtBrushManager *manager)
diff --git a/tools/designer/src/components/formeditor/brushmanagerproxy.h b/tools/designer/src/components/formeditor/brushmanagerproxy.h
index cbe50ae..43bcf29 100644
--- a/tools/designer/src/components/formeditor/brushmanagerproxy.h
+++ b/tools/designer/src/components/formeditor/brushmanagerproxy.h
@@ -63,7 +63,7 @@ public:
void setBrushManager(QtBrushManager *manager);
private:
- BrushManagerProxyPrivate *d_ptr;
+ QScopedPointer<BrushManagerProxyPrivate> d_ptr;
Q_DECLARE_PRIVATE(BrushManagerProxy)
Q_DISABLE_COPY(BrushManagerProxy)
Q_PRIVATE_SLOT(d_func(), void brushAdded(const QString &, const QBrush &))
diff --git a/tools/designer/src/components/formeditor/qtbrushmanager.cpp b/tools/designer/src/components/formeditor/qtbrushmanager.cpp
index c28c6b9..3ac9851 100644
--- a/tools/designer/src/components/formeditor/qtbrushmanager.cpp
+++ b/tools/designer/src/components/formeditor/qtbrushmanager.cpp
@@ -57,16 +57,13 @@ public:
};
QtBrushManager::QtBrushManager(QObject *parent)
- : QDesignerBrushManagerInterface(parent)
+ : QDesignerBrushManagerInterface(parent), d_ptr(new QtBrushManagerPrivate)
{
- d_ptr = new QtBrushManagerPrivate;
d_ptr->q_ptr = this;
-
}
QtBrushManager::~QtBrushManager()
{
- delete d_ptr;
}
QBrush QtBrushManager::brush(const QString &name) const
diff --git a/tools/designer/src/components/formeditor/qtbrushmanager.h b/tools/designer/src/components/formeditor/qtbrushmanager.h
index f8f1b8a..0855175 100644
--- a/tools/designer/src/components/formeditor/qtbrushmanager.h
+++ b/tools/designer/src/components/formeditor/qtbrushmanager.h
@@ -77,7 +77,7 @@ signals:
void currentBrushChanged(const QString &name, const QBrush &brush);
private:
- QtBrushManagerPrivate *d_ptr;
+ QScopedPointer<QtBrushManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtBrushManager)
Q_DISABLE_COPY(QtBrushManager)
};
diff --git a/tools/designer/src/lib/shared/iconselector.cpp b/tools/designer/src/lib/shared/iconselector.cpp
index 02a3dee..302a077 100644
--- a/tools/designer/src/lib/shared/iconselector.cpp
+++ b/tools/designer/src/lib/shared/iconselector.cpp
@@ -157,7 +157,6 @@ LanguageResourceDialog::LanguageResourceDialog(QDesignerResourceBrowserInterface
LanguageResourceDialog::~LanguageResourceDialog()
{
- delete d_ptr;
}
void LanguageResourceDialog::setCurrentPath(const QString &filePath)
@@ -427,9 +426,8 @@ void IconSelectorPrivate::slotResetAllActivated()
// ------------- IconSelector
IconSelector::IconSelector(QWidget *parent) :
- QWidget(parent)
+ QWidget(parent), d_ptr(new IconSelectorPrivate())
{
- d_ptr = new IconSelectorPrivate();
d_ptr->q_ptr = this;
d_ptr->m_stateComboBox = new QComboBox(this);
@@ -500,7 +498,6 @@ IconSelector::IconSelector(QWidget *parent) :
IconSelector::~IconSelector()
{
- delete d_ptr;
}
void IconSelector::setIcon(const PropertySheetIconValue &icon)
diff --git a/tools/designer/src/lib/shared/iconselector_p.h b/tools/designer/src/lib/shared/iconselector_p.h
index 6b70cd2..de4c54f 100644
--- a/tools/designer/src/lib/shared/iconselector_p.h
+++ b/tools/designer/src/lib/shared/iconselector_p.h
@@ -87,7 +87,7 @@ public:
QString currentPath() const;
private:
- class LanguageResourceDialogPrivate *d_ptr;
+ QScopedPointer<class LanguageResourceDialogPrivate> d_ptr;
Q_DECLARE_PRIVATE(LanguageResourceDialog)
Q_DISABLE_COPY(LanguageResourceDialog)
Q_PRIVATE_SLOT(d_func(), void slotAccepted())
@@ -120,7 +120,7 @@ public:
signals:
void iconChanged(const PropertySheetIconValue &icon);
private:
- class IconSelectorPrivate *d_ptr;
+ QScopedPointer<class IconSelectorPrivate> d_ptr;
Q_DECLARE_PRIVATE(IconSelector)
Q_DISABLE_COPY(IconSelector)
diff --git a/tools/designer/src/lib/shared/qtresourceeditordialog.cpp b/tools/designer/src/lib/shared/qtresourceeditordialog.cpp
index adddf72..bd6be95 100644
--- a/tools/designer/src/lib/shared/qtresourceeditordialog.cpp
+++ b/tools/designer/src/lib/shared/qtresourceeditordialog.cpp
@@ -1949,9 +1949,8 @@ bool QtResourceEditorDialogPrivate::saveQrcFile(const QtQrcFileData &qrcFileData
}
QtResourceEditorDialog::QtResourceEditorDialog(QDesignerFormEditorInterface *core, QDesignerDialogGuiInterface *dlgGui, QWidget *parent)
- : QDialog(parent)
+ : QDialog(parent), d_ptr(new QtResourceEditorDialogPrivate())
{
- d_ptr = new QtResourceEditorDialogPrivate();
d_ptr->q_ptr = this;
d_ptr->m_ui.setupUi(this);
d_ptr->m_qrcManager = new QtQrcManager(this);
@@ -2085,8 +2084,6 @@ QtResourceEditorDialog::~QtResourceEditorDialog()
settings->setValue(QLatin1String(SplitterPosition), d_ptr->m_ui.splitter->saveState());
settings->setValue(QLatin1String(Geometry), geometry());
settings->endGroup();
-
- delete d_ptr;
}
QtResourceModel *QtResourceEditorDialog::model() const
diff --git a/tools/designer/src/lib/shared/qtresourceeditordialog_p.h b/tools/designer/src/lib/shared/qtresourceeditordialog_p.h
index f2531d9..aa768e9 100644
--- a/tools/designer/src/lib/shared/qtresourceeditordialog_p.h
+++ b/tools/designer/src/lib/shared/qtresourceeditordialog_p.h
@@ -53,6 +53,7 @@
#ifndef QTRESOURCEEDITOR_H
#define QTRESOURCEEDITOR_H
+#include <QtCore/QScopedPointer>
#include <QtGui/QDialog>
QT_BEGIN_NAMESPACE
@@ -83,7 +84,7 @@ private:
QtResourceEditorDialog(QDesignerFormEditorInterface *core, QDesignerDialogGuiInterface *dlgGui, QWidget *parent = 0);
~QtResourceEditorDialog();
- class QtResourceEditorDialogPrivate *d_ptr;
+ QScopedPointer<class QtResourceEditorDialogPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceEditorDialog)
Q_DISABLE_COPY(QtResourceEditorDialog)
diff --git a/tools/designer/src/lib/shared/qtresourcemodel.cpp b/tools/designer/src/lib/shared/qtresourcemodel.cpp
index e6152be..89615c8 100644
--- a/tools/designer/src/lib/shared/qtresourcemodel.cpp
+++ b/tools/designer/src/lib/shared/qtresourcemodel.cpp
@@ -141,7 +141,6 @@ QtResourceSet::QtResourceSet(QtResourceModel *model) :
QtResourceSet::~QtResourceSet()
{
- delete d_ptr;
}
QStringList QtResourceSet::activeQrcPaths() const
@@ -489,7 +488,6 @@ QtResourceModel::~QtResourceModel()
while (it.hasNext())
removeResourceSet(it.next());
blockSignals(false);
- delete d_ptr;
}
QStringList QtResourceModel::loadedQrcFiles() const
diff --git a/tools/designer/src/lib/shared/qtresourcemodel_p.h b/tools/designer/src/lib/shared/qtresourcemodel_p.h
index 726db29..61d6763 100644
--- a/tools/designer/src/lib/shared/qtresourcemodel_p.h
+++ b/tools/designer/src/lib/shared/qtresourcemodel_p.h
@@ -56,6 +56,7 @@
#include "shared_global_p.h"
#include <QtCore/QMap>
#include <QtCore/QObject>
+#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
@@ -87,7 +88,7 @@ private:
~QtResourceSet();
friend class QtResourceModel;
- class QtResourceSetPrivate *d_ptr;
+ QScopedPointer<class QtResourceSetPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceSet)
Q_DISABLE_COPY(QtResourceSet)
};
@@ -132,7 +133,7 @@ signals:
private:
friend class QtResourceSet;
- class QtResourceModelPrivate *d_ptr;
+ QScopedPointer<class QtResourceModelPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceModel)
Q_DISABLE_COPY(QtResourceModel)
diff --git a/tools/designer/src/lib/shared/qtresourceview.cpp b/tools/designer/src/lib/shared/qtresourceview.cpp
index d956491..22439a2 100644
--- a/tools/designer/src/lib/shared/qtresourceview.cpp
+++ b/tools/designer/src/lib/shared/qtresourceview.cpp
@@ -499,8 +499,6 @@ QtResourceView::~QtResourceView()
{
if (!d_ptr->m_settingsKey.isEmpty())
d_ptr->saveSettings();
-
- delete d_ptr;
}
bool QtResourceView::event(QEvent *event)
@@ -737,8 +735,6 @@ QtResourceViewDialog::~QtResourceViewDialog()
settings->setValue(QLatin1String(Geometry), geometry());
settings->endGroup();
-
- delete d_ptr;
}
QString QtResourceViewDialog::selectedResource() const
diff --git a/tools/designer/src/lib/shared/qtresourceview_p.h b/tools/designer/src/lib/shared/qtresourceview_p.h
index 33162c5..1d3a1b0 100644
--- a/tools/designer/src/lib/shared/qtresourceview_p.h
+++ b/tools/designer/src/lib/shared/qtresourceview_p.h
@@ -102,7 +102,7 @@ protected:
private:
- class QtResourceViewPrivate *d_ptr;
+ QScopedPointer<class QtResourceViewPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceView)
Q_DISABLE_COPY(QtResourceView)
Q_PRIVATE_SLOT(d_func(), void slotResourceSetActivated(QtResourceSet *))
@@ -129,7 +129,7 @@ public:
void setResourceEditingEnabled(bool enable);
private:
- class QtResourceViewDialogPrivate *d_ptr;
+ QScopedPointer<class QtResourceViewDialogPrivate> d_ptr;
Q_DECLARE_PRIVATE(QtResourceViewDialog)
Q_DISABLE_COPY(QtResourceViewDialog)
Q_PRIVATE_SLOT(d_func(), void slotResourceSelected(const QString &))
diff --git a/tools/designer/src/uitools/quiloader.cpp b/tools/designer/src/uitools/quiloader.cpp
index 2a66095..9e904d4 100644
--- a/tools/designer/src/uitools/quiloader.cpp
+++ b/tools/designer/src/uitools/quiloader.cpp
@@ -648,7 +648,6 @@ QUiLoader::QUiLoader(QObject *parent)
*/
QUiLoader::~QUiLoader()
{
- delete d_ptr;
}
/*!
diff --git a/tools/designer/src/uitools/quiloader.h b/tools/designer/src/uitools/quiloader.h
index 6543ba8..90403bf 100644
--- a/tools/designer/src/uitools/quiloader.h
+++ b/tools/designer/src/uitools/quiloader.h
@@ -43,6 +43,7 @@
#define QUILOADER_H
#include <QtCore/QObject>
+#include <QtCore/QScopedPointer>
QT_BEGIN_HEADER
@@ -90,7 +91,7 @@ public:
bool isTranslationEnabled() const;
private:
- QUiLoaderPrivate *d_ptr;
+ QScopedPointer<QUiLoaderPrivate> d_ptr;
Q_DECLARE_PRIVATE(QUiLoader)
Q_DISABLE_COPY(QUiLoader)
};