SVN commit 500159 by cgilles:
digikam from trunk : image properties side bar BUGFIX : and the last one ! : there are dupplicate signals/slots connection between : - AlbumIconView and comments & tags editor - AlbumIconView and DigikamView ... about events if an album item have been changes/deleted or if current album is cleared. All events controls must be drived by DigikamView since we using image properties side bar instead a dialog. I have removed obsolete methods witch _CLOSE_ the comments & tags editor ! CCMAIL: [hidden email] M +7 -43 imagedescedittab.cpp M +1 -5 imagedescedittab.h M +1 -1 imagepropertiessidebardb.cpp --- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.cpp #500158:500159 @@ -61,7 +61,6 @@ // Local includes. -#include "albumiconview.h" #include "albumiconitem.h" #include "albummanager.h" #include "albumdb.h" @@ -70,8 +69,9 @@ #include "tagcreatedlg.h" #include "syncjob.h" #include "navigatebarwidget.h" -#include "imagedescedittab.h" +#include "imageinfo.h" #include "ratingwidget.h" +#include "imagedescedittab.h" namespace Digikam { @@ -118,7 +118,6 @@ commentsEdit = 0; tagsSearchEdit = 0; dateTimeEdit = 0; - view = 0; currItem = 0; tagsView = 0; ratingWidget = 0; @@ -137,8 +136,6 @@ KDateTimeEdit *dateTimeEdit; - AlbumIconView *view; - AlbumIconItem *currItem; TAlbumListView *tagsView; @@ -360,14 +357,14 @@ void ImageDescEditTab::applyChanges() { + if (!d->modified) + return; + if (!d->currItem) return; ImageInfo* info = d->currItem->imageInfo(); - if (!d->modified) - return; - info->setCaption(d->commentsEdit->text()); info->setDateTime(d->dateTimeEdit->dateTime()); info->setRating(d->ratingWidget->rating()); @@ -405,40 +402,23 @@ d->modified = false; } -void ImageDescEditTab::setItem(AlbumIconView *view, AlbumIconItem* currItem, int itemType) +void ImageDescEditTab::setItem(AlbumIconItem* currItem, int itemType) { applyChanges(); - if (d->view) - { - disconnect(d->view, SIGNAL(signalItemDeleted(AlbumIconItem*)), - this, SLOT(slotItemDeleted(AlbumIconItem*))); - - disconnect(d->view, SIGNAL(signalCleared()), - this, SLOT(slotCleared())); - } - - if (!currItem || !view) + if (!currItem) { d->navigateBar->setFileName(); d->commentsEdit->clear(); - d->view = 0; d->currItem = 0; setEnabled(false); return; } setEnabled(true); - d->view = view; d->currItem = currItem; d->modified = false; - connect(d->view, SIGNAL(signalItemDeleted(AlbumIconItem*)), - this, SLOT(slotItemDeleted(AlbumIconItem*))); - - connect(d->view, SIGNAL(signalCleared()), - this, SLOT(slotCleared())); - ImageInfo* info = currItem->imageInfo(); KURL fileURL; fileURL.setPath(info->filePath()); @@ -721,22 +701,6 @@ return pix; } -void ImageDescEditTab::slotItemDeleted(AlbumIconItem* iconItem) -{ - if (d->currItem != iconItem) - return; - - // uh oh. our current item got deleted. close - d->currItem = 0; - close(); -} - -void ImageDescEditTab::slotCleared() -{ - // if the iconview has been cleared, bail out and close - close(); -} - void ImageDescEditTab::slotRecentTags() { QPopupMenu menu(this); --- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.h #500158:500159 @@ -37,7 +37,6 @@ namespace Digikam { -class AlbumIconView; class AlbumIconItem; class Album; class TAlbum; @@ -69,7 +68,7 @@ ImageDescEditTab(QWidget *parent, bool navBar=true); ~ImageDescEditTab(); - void setItem(AlbumIconView *view=0, AlbumIconItem* currItem=0, int itemType=0); + void setItem(AlbumIconItem* currItem=0, int itemType=0); void populateTags(); signals: @@ -105,9 +104,6 @@ void slotAlbumIconChanged(Album* a); void slotAlbumRenamed(Album* a); - void slotItemDeleted(AlbumIconItem* iconItem); - void slotCleared(); - private: ImageDescEditTabPriv* d; --- trunk/extragear/graphics/digikam/libs/imageproperties/imagepropertiessidebardb.cpp #500158:500159 @@ -237,7 +237,7 @@ } else if (tab == d->desceditTab && !d->dirtyDesceditTab) { - d->desceditTab->setItem(d->currentView, d->currentItem, currentItemType); + d->desceditTab->setItem(d->currentItem, currentItemType); d->dirtyDesceditTab = true; } } _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |