Commit 982cf5b1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Initialize pointer to nullptr

parent 3ab6fff7
Pipeline #135037 passed with stage
in 4 minutes and 32 seconds
......@@ -39,14 +39,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
namespace Gwenview
{
struct DialogPagePrivate : public Ui_DialogPage {
QVBoxLayout *mLayout;
QVBoxLayout *mLayout = nullptr;
QList<QPushButton *> mButtons;
QEventLoop *mEventLoop;
DialogPage *q;
QEventLoop *mEventLoop = nullptr;
DialogPage *q = nullptr;
QStringList failedFileList;
QStringList failedDirList;
QAction *fileDetails;
QAction *dirDetails;
QAction *fileDetails = nullptr;
QAction *dirDetails = nullptr;
void setupFailedListActions()
{
......
......@@ -36,7 +36,7 @@ namespace Gwenview
{
struct DocumentDirFinderPrivate {
QUrl mRootUrl;
KDirLister *mDirLister;
KDirLister *mDirLister = nullptr;
QUrl mFoundDirUrl;
};
......
......@@ -45,8 +45,8 @@ namespace FileUtils
{
bool contentsAreIdentical(const QUrl &url1, const QUrl &url2, QWidget *authWindow)
{
KIO::StatJob *statJob;
KIO::StoredTransferJob *fileJob;
KIO::StatJob *statJob = nullptr;
KIO::StoredTransferJob *fileJob = nullptr;
QScopedPointer<QIODevice> file1, file2;
QByteArray file1Bytes, file2Bytes;
......
......@@ -51,12 +51,12 @@ namespace Gwenview
class ImportDialogPrivate
{
public:
ImportDialog *q;
QStackedWidget *mCentralWidget;
ThumbnailPage *mThumbnailPage;
ProgressPage *mProgressPage;
DialogPage *mDialogPage;
Importer *mImporter;
ImportDialog *q = nullptr;
QStackedWidget *mCentralWidget = nullptr;
ThumbnailPage *mThumbnailPage = nullptr;
ProgressPage *mProgressPage = nullptr;
DialogPage *mDialogPage = nullptr;
Importer *mImporter = nullptr;
void checkForFailedUrls()
{
......
......@@ -43,7 +43,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
namespace Gwenview
{
struct SaveJobPrivate {
DocumentLoadedImpl *mImpl;
DocumentLoadedImpl *mImpl = nullptr;
QUrl mOldUrl;
QUrl mNewUrl;
QByteArray mFormat;
......
......@@ -33,7 +33,7 @@ namespace Gwenview
{
struct SvgDocumentLoadedImplPrivate {
QByteArray mRawData;
QSvgRenderer *mRenderer;
QSvgRenderer *mRenderer = nullptr;
};
SvgDocumentLoadedImpl::SvgDocumentLoadedImpl(Document *document, const QByteArray &data)
......
......@@ -43,7 +43,7 @@ struct AbstractImageViewPrivate {
Silent,
Notify,
};
AbstractImageView *q;
AbstractImageView *q = nullptr;
QCursor mZoomCursor;
Document::Ptr mDocument;
......
......@@ -51,10 +51,10 @@ inline QRectF alignedRectF(const QRectF &rect)
}
struct BirdEyeViewPrivate {
BirdEyeView *q;
DocumentView *mDocView;
QPropertyAnimation *mOpacityAnim;
QTimer *mAutoHideTimer;
BirdEyeView *q = nullptr;
DocumentView *mDocView = nullptr;
QPropertyAnimation *mOpacityAnim = nullptr;
QTimer *mAutoHideTimer = nullptr;
QRectF mVisibleRect;
QPointF mStartDragMousePos;
QPointF mStartDragViewPos;
......
......@@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
namespace Gwenview
{
struct GraphicsWidgetFloaterPrivate {
QGraphicsWidget *mParent;
QGraphicsWidget *mParent = nullptr;
QPointer<QGraphicsWidget> mChild;
Qt::Alignment mAlignment;
......
......@@ -47,8 +47,8 @@ struct LayoutInfo {
};
struct HudButtonPrivate {
HudButton *q;
QAction *mAction;
HudButton *q = nullptr;
QAction *mAction = nullptr;
QPalette mDarkPalette;
QPixmap mLightIcon;
......
......@@ -35,8 +35,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace Gwenview
{
struct HudButtonBoxPrivate {
QGraphicsLinearLayout *mLayout;
HudLabel *mLabel;
QGraphicsLinearLayout *mLayout = nullptr;
HudLabel *mLabel = nullptr;
QList<HudButton *> mButtonList;
HudCountDown *mCountDown;
......
......@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace Gwenview
{
struct HudCountDownPrivate {
QTimeLine *mTimeLine;
QTimeLine *mTimeLine = nullptr;
};
HudCountDown::HudCountDown(QGraphicsWidget *parent)
......
......@@ -39,10 +39,10 @@ namespace Gwenview
static const int TIMEOUT = 10000;
struct HudMessageBubblePrivate {
QGraphicsWidget *mWidget;
QGraphicsLinearLayout *mLayout;
HudCountDown *mCountDown;
HudLabel *mLabel;
QGraphicsWidget *mWidget = nullptr;
QGraphicsLinearLayout *mLayout = nullptr;
HudCountDown *mCountDown = nullptr;
HudLabel *mLabel = nullptr;
};
HudMessageBubble::HudMessageBubble(QGraphicsWidget *parent)
......
......@@ -40,7 +40,7 @@ namespace Gwenview
static const int FIRST_REPEAT_DELAY = 500;
struct HudSliderPrivate {
HudSlider *q;
HudSlider *q = nullptr;
int mMin, mMax, mPageStep, mSingleStep;
int mSliderPosition;
int mRepeatX;
......
......@@ -39,10 +39,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
namespace Gwenview
{
struct HudWidgetPrivate {
HudWidget *q;
QPropertyAnimation *mAnim;
QGraphicsWidget *mMainWidget;
HudButton *mCloseButton;
HudWidget *q = nullptr;
QPropertyAnimation *mAnim = nullptr;
QGraphicsWidget *mMainWidget = nullptr;
HudButton *mCloseButton = nullptr;
bool mAutoDeleteOnFadeout;
void fadeTo(qreal value)
......
......@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
namespace Gwenview
{
struct InvisibleButtonGroupPrivate {
QButtonGroup *mGroup;
QButtonGroup *mGroup = nullptr;
};
InvisibleButtonGroup::InvisibleButtonGroup(QWidget *parent)
......
......@@ -66,7 +66,7 @@ struct Node {
{
}
SortedDirModel *model;
SortedDirModel *model = nullptr;
QUrl parentUrl;
bool isPlace() const
......
......@@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
namespace Gwenview
{
struct PrintHelperPrivate {
QWidget *mParent;
QWidget *mParent = nullptr;
QSize adjustSize(PrintOptionsPage *optionsPage, Document::Ptr doc, int printerResolution, const QSize &viewportSize)
{
......
......@@ -70,7 +70,7 @@ private:
};
struct RecentFilesModelPrivate {
RecentFilesModel *q;
RecentFilesModel *q = nullptr;
QMap<QUrl, RecentFilesItem *> mRecentFilesItemForUrl;
};
......
......@@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
namespace Gwenview
{
struct RecursiveDirModelPrivate {
KDirLister *mDirLister;
KDirLister *mDirLister = nullptr;
int rowForUrl(const QUrl &url) const
{
......@@ -90,11 +90,7 @@ RecursiveDirModel::RecursiveDirModel(QObject *parent)
connect(d->mDirLister, QOverload<>::of(&KDirLister::completed), this, &RecursiveDirModel::completed);
connect(d->mDirLister, QOverload<>::of(&KDirLister::clear), this, &RecursiveDirModel::slotCleared);
#if KIO_VERSION < QT_VERSION_CHECK(5, 79, 0)
connect(d->mDirLister, QOverload<const QUrl &>::of(&KDirLister::clear), this, &RecursiveDirModel::slotDirCleared);
#else
connect(d->mDirLister, &KDirLister::clearDir, this, &RecursiveDirModel::slotDirCleared);
#endif
}
RecursiveDirModel::~RecursiveDirModel()
......
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