diff options
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 2 | ||||
-rw-r--r-- | lumina-desktop/LSession.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 81d57cb8..c64f327f 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -395,7 +395,7 @@ void LDesktop::UpdateBackground(){ } //Determine which background to use next int index = bgL.indexOf(CBG); - if( (index < 0) || (index >= bgL.length()-1) ){ index = 0; } //use the first file + if( (index < 0) || (index >= bgL.length()-1) ){ index = ( qrand() % bgL.length() ); } //pick a random file else{ index++; } //use the next file in the list QString bgFile; if( bgL.isEmpty() && CBG.isEmpty()){ bgFile = "default"; } diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 0507f920..00728d23 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -10,6 +10,7 @@ #include <Phonon/MediaObject> #include <Phonon/AudioOutput> #include <QThread> +#include <QTime> //X includes (these need to be last due to Qt compile issues) #include <X11/Xlib.h> @@ -57,6 +58,8 @@ LSession::~LSession(){ void LSession::setupSession(){ qDebug() << "Initializing Session"; + //Seed random number generator (if needed) + qsrand( QTime::currentTime().msec() ); //Setup the QSettings default paths QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina"); sessionsettings = new QSettings("LuminaDE", "sessionsettings"); |