Commit 58cb19e5 authored by hjk's avatar hjk Committed by hjk
Browse files

all: less QScopedPointer

Change-Id: I536bdb4d4f0c10fa858560f3c160fc0fff8da9b2
Reviewed-on: http://codereview.qt-project.org/5116

Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent dbe16537
......@@ -35,8 +35,6 @@
#include <languageutils/fakemetaobject.h>
#include <QtCore/QScopedPointer>
// for Q_DECLARE_TR_FUNCTIONS
#include <QtCore/QCoreApplication>
......
......@@ -37,6 +37,7 @@ namespace Utils {
ConsoleProcess::~ConsoleProcess()
{
stop();
delete d;
}
void ConsoleProcess::setMode(Mode m)
......
......@@ -41,7 +41,6 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QProcess>
#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
class QSettings;
......@@ -130,7 +129,7 @@ private:
void cleanupInferior();
#endif
QScopedPointer<ConsoleProcessPrivate> d;
ConsoleProcessPrivate *d;
};
} //namespace Utils
......
......@@ -261,6 +261,7 @@ CrumblePath::~CrumblePath()
{
qDeleteAll(d->m_buttons);
d->m_buttons.clear();
delete d;
}
void CrumblePath::selectIndex(int index)
......
......@@ -38,8 +38,6 @@
#include <QtGui/QWidget>
#include <QtCore/QVariant>
QT_FORWARD_DECLARE_CLASS(QResizeEvent)
namespace Utils {
struct CrumblePathPrivate;
......@@ -47,6 +45,7 @@ struct CrumblePathPrivate;
class QTCREATOR_UTILS_EXPORT CrumblePath : public QWidget
{
Q_OBJECT
public:
explicit CrumblePath(QWidget *parent = 0);
~CrumblePath();
......@@ -75,7 +74,7 @@ private:
void setBackgroundStyle();
private:
QScopedPointer<CrumblePathPrivate> d;
CrumblePathPrivate *d;
};
} // namespace Utils
......
......@@ -221,6 +221,7 @@ FileSystemWatcher::~FileSystemWatcher()
if (debug)
qDebug() << this << "Deleted watcher" << d->m_id;
}
delete d;
}
bool FileSystemWatcher::watchesFile(const QString &file) const
......
......@@ -86,7 +86,7 @@ signals:
private:
void init();
QScopedPointer<FileSystemWatcherPrivate> d;
FileSystemWatcherPrivate *d;
};
} // namespace Utils
......
......@@ -34,7 +34,6 @@
#define CLASSVIEWNAVIGATIONWIDGET_H
#include <QtCore/QList>
#include <QtCore/QScopedPointer>
#include <QtCore/QSharedPointer>
#include <QtGui/QStandardItem>
......
......@@ -39,7 +39,8 @@
namespace Core {
struct OpenEditorsModelPrivate {
struct OpenEditorsModelPrivate
{
OpenEditorsModelPrivate();
const QIcon m_lockedIcon;
......@@ -67,6 +68,7 @@ OpenEditorsModel::OpenEditorsModel(QObject *parent) :
OpenEditorsModel::~OpenEditorsModel()
{
delete d;
}
QIcon OpenEditorsModel::lockedIcon() const
......
......@@ -37,7 +37,6 @@
#include "../id.h"
#include <QtCore/QAbstractItemModel>
#include <QtCore/QScopedPointer>
QT_FORWARD_DECLARE_CLASS(QIcon)
......@@ -50,6 +49,7 @@ class IFile;
class CORE_EXPORT OpenEditorsModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit OpenEditorsModel(QObject *parent);
virtual ~OpenEditorsModel();
......@@ -107,7 +107,7 @@ private:
int findFileName(const QString &filename) const;
void removeEditor(int idx);
QScopedPointer<OpenEditorsModelPrivate> d;
OpenEditorsModelPrivate *d;
};
} // namespace Core
......
......@@ -179,6 +179,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
EditorToolBar::~EditorToolBar()
{
delete d;
}
void EditorToolBar::removeToolbarForEditor(IEditor *editor)
......
......@@ -35,12 +35,10 @@
#include "core_global.h"
#include <QtCore/QScopedPointer>
#include <utils/styledbar.h>
namespace Core {
class IEditor;
class IEditor;
struct EditorToolBarPrivate;
......@@ -104,7 +102,7 @@ private:
void updateToolBar(QWidget *toolBar);
IEditor *currentEditor() const;
QScopedPointer<EditorToolBarPrivate> d;
EditorToolBarPrivate *d;
};
} // namespace Core
......
......@@ -176,6 +176,7 @@ NavigationWidget::NavigationWidget(QAction *toggleSideBarAction) :
NavigationWidget::~NavigationWidget()
{
NavigationWidgetPrivate::m_instance = 0;
delete d;
}
NavigationWidget *NavigationWidget::instance()
......
......@@ -36,7 +36,6 @@
#include <coreplugin/minisplitter.h>
#include <QtCore/QHash>
#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
class QSettings;
......@@ -57,8 +56,9 @@ class NavigationSubWidget;
class CORE_EXPORT NavigationWidgetPlaceHolder : public QWidget
{
friend class Core::NavigationWidget;
Q_OBJECT
friend class Core::NavigationWidget;
public:
explicit NavigationWidgetPlaceHolder(Core::IMode *mode, QWidget *parent = 0);
virtual ~NavigationWidgetPlaceHolder();
......@@ -76,6 +76,7 @@ private:
class CORE_EXPORT NavigationWidget : public MiniSplitter
{
Q_OBJECT
public:
enum FactoryModelRoles {
FactoryObjectRole = Qt::UserRole,
......@@ -123,7 +124,7 @@ private:
Internal::NavigationSubWidget *insertSubItem(int position, int index);
int factoryIndex(const QString &id);
QScopedPointer<NavigationWidgetPrivate> d;
NavigationWidgetPrivate *d;
};
} // namespace Core
......
......@@ -83,6 +83,7 @@ OutputPanePlaceHolder::~OutputPanePlaceHolder()
om->hide();
}
}
delete d;
}
void OutputPanePlaceHolder::currentModeChanged(Core::IMode *mode)
......
......@@ -37,8 +37,6 @@
#include <QtGui/QWidget>
#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
class QSplitter;
QT_END_NAMESPACE
......@@ -54,8 +52,9 @@ struct OutputPanePlaceHolderPrivate;
class CORE_EXPORT OutputPanePlaceHolder : public QWidget
{
friend class Core::Internal::OutputPaneManager; // needs to set m_visible and thus access m_current
Q_OBJECT
friend class Core::Internal::OutputPaneManager; // needs to set m_visible and thus access m_current
public:
explicit OutputPanePlaceHolder(Core::IMode *mode, QSplitter *parent = 0);
~OutputPanePlaceHolder();
......@@ -73,7 +72,7 @@ private:
bool canMaximizeOrMinimize() const;
void maximizeOrMinimize(bool maximize);
QScopedPointer<OutputPanePlaceHolderPrivate> d;
OutputPanePlaceHolderPrivate *d;
};
} // namespace Core
......
......@@ -159,8 +159,8 @@ FutureProgress::FutureProgress(QWidget *parent) :
connect(&d->m_watcher, SIGNAL(finished()), this, SLOT(setFinished()));
connect(&d->m_watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(setProgressRange(int,int)));
connect(&d->m_watcher, SIGNAL(progressValueChanged(int)), this, SLOT(setProgressValue(int)));
connect(&d->m_watcher, SIGNAL(progressTextChanged(const QString&)),
this, SLOT(setProgressText(const QString&)));
connect(&d->m_watcher, SIGNAL(progressTextChanged(QString)),
this, SLOT(setProgressText(QString)));
connect(d->m_progress, SIGNAL(clicked()), this, SLOT(cancel()));
}
......@@ -170,8 +170,8 @@ FutureProgress::FutureProgress(QWidget *parent) :
*/
FutureProgress::~FutureProgress()
{
if (d->m_widget)
delete d->m_widget;
delete d->m_widget;
delete d;
}
/*!
......@@ -182,8 +182,7 @@ FutureProgress::~FutureProgress()
*/
void FutureProgress::setWidget(QWidget *widget)
{
if (d->m_widget)
delete d->m_widget;
delete d->m_widget;
QSizePolicy sp = widget->sizePolicy();
sp.setHorizontalPolicy(QSizePolicy::Ignored);
widget->setSizePolicy(sp);
......
......@@ -36,8 +36,6 @@
#include <coreplugin/core_global.h>
#include <QtCore/QString>
#include <QtCore/QScopedPointer>
#include <QtCore/QFuture>
#include <QtGui/QWidget>
......@@ -96,7 +94,7 @@ private slots:
void fadeAway();
private:
QScopedPointer<FutureProgressPrivate> d;
FutureProgressPrivate *d;
};
} // namespace Core
......
......@@ -117,6 +117,7 @@ SideBar::~SideBar()
if (!iter.value().isNull())
delete iter.value().data();
}
delete d;
}
QString SideBar::idForTitle(const QString &title) const
......
......@@ -38,7 +38,6 @@
#include <QtCore/QMap>
#include <QtCore/QList>
#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
class QSettings;
......@@ -83,21 +82,20 @@ public:
private:
const QString m_id;
QWidget *m_widget;
QWidget *m_widget;
};
class CORE_EXPORT SideBar : public MiniSplitter
{
Q_OBJECT
public:
/*
* The SideBar takes explicit ownership of the SideBarItems
* if you have one SideBar, or shared ownership in case
* of multiple SideBars.
*/
explicit SideBar(QList< SideBarItem*> widgetList,
QList< SideBarItem*> defaultVisible);
SideBar(QList<SideBarItem *> widgetList, QList<SideBarItem *> defaultVisible);
virtual ~SideBar();
QStringList availableItemIds() const;
......@@ -117,8 +115,8 @@ public:
void closeAllWidgets();
void activateItem(SideBarItem *item);
void setShortcutMap(const QMap<QString, Core::Command*> &shortcutMap);
QMap<QString, Core::Command*> shortcutMap() const;
void setShortcutMap(const QMap<QString, Core::Command *> &shortcutMap);
QMap<QString, Core::Command *> shortcutMap() const;
signals:
void availableItemsChanged();
......@@ -133,7 +131,7 @@ private:
const QString &title = QString());
void removeSideBarWidget(Internal::SideBarWidget *widget);
QScopedPointer<SideBarPrivate> d;
SideBarPrivate *d;
};
} // namespace Core
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment