Commit 99ee26a8 authored by Martin Heistermann's avatar Martin Heistermann

Core: consistently check for splashscreen availability.

Core::finishSplash had an unguarded callsite that would cause a crash if
the splash screen is disbled. This change makes everything a bit simpler.
parent a83bb4fc
......@@ -114,7 +114,8 @@ Core() :
nextBackupId_(0),
nextBackupGroupId_(0),
objectRoot_(0),
coreWidget_(0)
coreWidget_(0),
splash_(0)
{
//init logFile
......@@ -608,7 +609,7 @@ Core::init() {
QStringList optionFiles = OpenFlipper::Options::optionFiles();
for ( int i = 0 ; i < (int)optionFiles.size(); ++i) {
if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
if (splash_) {
splash_->showMessage(tr("Loading Configuration File %1/%2").arg(i+1).arg(optionFiles.size()),
Qt::AlignBottom | Qt::AlignLeft , Qt::white);
}
......@@ -621,7 +622,7 @@ Core::init() {
openIniFile( optionFiles[i] ,false,true,false);
}
if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() )
if (splash_)
splash_->clearMessage();
// ===============================================================================================
......@@ -674,7 +675,7 @@ Core::init() {
}
if ( OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
if ( splash_ ) {
splash_->raise();
splash_->showMessage(tr("Ready."), Qt::AlignBottom | Qt::AlignLeft , Qt::white);
finishSplash();
......@@ -2041,7 +2042,7 @@ void Core::showReducedMenuBar(bool reduced) {
}
void Core::finishSplash() {
splash_->finish(coreWidget_);
if (splash_) splash_->finish(coreWidget_);
}
......
......@@ -389,7 +389,7 @@ void Core::loadPlugins()
loadedPlugins.push_back(loader);
if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
if (splash_) {
splashMessage_ = tr("Loading Plugin %1/%2").arg(loadedPlugins.size()).arg(pluginlist.size()) ;
splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white);
}
......@@ -411,7 +411,7 @@ void Core::loadPlugins()
for (std::vector<QPluginLoader*>::iterator it = loadedPlugins.begin();
it != loadedPlugins.end(); ++it) {
if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
if (splash_) {
splashMessage_ = tr("Initializing Plugin %1/%2")
.arg(std::distance(loadedPlugins.begin(), it) + 1)
.arg(loadedPlugins.size());
......@@ -770,7 +770,7 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
emit log(LOGOUT,tr("Found Plugin : \t %1").arg(basePlugin->name()) );
if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
if (splash_) {
splashMessage_ = splashMessage_ + " " + basePlugin->name() ;
splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white);
}
......
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