[PATCH] Check if there is an album at startup and also init m_urlList.

Aurélien Gâteau agateau at kde.org
Tue May 26 13:47:09 CEST 2009


Makes plugin work with Gwenview.
---
 .../advancedslideshow/plugin_advancedslideshow.cpp |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/kipi-plugins/advancedslideshow/plugin_advancedslideshow.cpp b/kipi-plugins/advancedslideshow/plugin_advancedslideshow.cpp
index 54aa57f..f44ed92 100644
--- a/kipi-plugins/advancedslideshow/plugin_advancedslideshow.cpp
+++ b/kipi-plugins/advancedslideshow/plugin_advancedslideshow.cpp
@@ -102,6 +102,11 @@ void Plugin_AdvancedSlideshow::setup( QWidget* widget )
 
     connect(m_interface, SIGNAL( currentAlbumChanged( bool )),
             this, SLOT( slotAlbumChanged( bool )));
+
+    if ( m_interface->currentAlbum().isValid() )
+    {
+        slotAlbumChanged( true );
+    }
 }
 
 Plugin_AdvancedSlideshow::~Plugin_AdvancedSlideshow()
@@ -184,6 +189,14 @@ void Plugin_AdvancedSlideshow::slotSlideShow()
     shuffle          = grp.readEntry("Shuffle", false);
     wantKB           = grp.readEntry("Effect Name (OpenGL)") == QString("Ken Burns");
 
+    KIPI::ImageCollection currAlbum = m_interface->currentAlbum();
+    if ( !currAlbum.isValid() )
+    {
+        kError( 51000 ) << "Current image collection is not valid. This should not happen at this point!" << endl;
+        return;
+    }
+
+    m_urlList = currAlbum.images();
     if ( m_urlList.isEmpty() )
     {
         KMessageBox::sorry(kapp->activeWindow(), i18n("There are no images to show."));
-- 
1.6.0.4


--------------080207020601040000010901--


More information about the Kde-imaging mailing list