diff --git a/screensaver/screensaver.cpp b/screensaver/screensaver.cpp index 5c06727..fb5acd0 100644 --- a/screensaver/screensaver.cpp +++ b/screensaver/screensaver.cpp @@ -637,6 +637,10 @@ void Screensaver::setUpdateCenterWidget() QString languageDirPath=cwdPath+"language/"; QString defaultLanguageFilePath=languageDirPath+"screensaver-en_US.ini"; qDebug()<<"homePath="<childGroups(); @@ -1197,6 +1201,8 @@ void Screensaver::setPreviewText(bool bVisible) void Screensaver::setCenterWidget() { + if (!qsettings) + return ; QStringList qlist = qsettings->childGroups(); if(qlist.count()<1) return; diff --git a/screensaver/screensaver.h b/screensaver/screensaver.h index 39bb7a1..e010fe1 100644 --- a/screensaver/screensaver.h +++ b/screensaver/screensaver.h @@ -111,7 +111,7 @@ private: QPushButton *settingsButton; QPushButton *WallpaperButton; QWidget *buttonWidget; - QSettings *qsettings; + QSettings *qsettings = nullptr; MBackground *m_background;