[Digikam-devel] [Bug 145204] small issues with the light-table
Gilles Caulier
caulier.gilles at gmail.com
Wed May 9 14:14:38 BST 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=145204
------- Additional Comments From caulier.gilles gmail com 2007-05-09 15:14 -------
SVN commit 662874 by cgilles:
digikam from trunk : BKO #145204 point (c) fixed.
CCBUGS: 145204
M +51 -31 lighttableview.cpp
M +6 -1 lighttableview.h
M +2 -0 lighttablewindow.cpp
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttableview.cpp #662873:662874
@ -47,12 +47,16 @
LightTableViewPriv()
{
syncPreview = false;
+ leftLoading = false;
+ rightLoading = false;
leftPreview = 0;
rightPreview = 0;
grid = 0;
}
bool syncPreview;
+ bool leftLoading; // To not sync right panel during left loading.
+ bool rightLoading; // To not sync left panel during right loading.
QGridLayout *grid;
@ -119,16 +123,10 @
this, SLOT(slotRightContentsMoved(int, int)));
connect(d->leftPreview, SIGNAL(signalPreviewLoaded(bool)),
- this, SIGNAL(signalLeftPreviewLoaded(bool)));
+ this, SLOT(slotLeftPreviewLoaded(bool)));
connect(d->rightPreview, SIGNAL(signalPreviewLoaded(bool)),
- this, SIGNAL(signalRightPreviewLoaded(bool)));
-
- connect(d->leftPreview, SIGNAL(signalPreviewLoaded(bool)),
- this, SLOT(slotPreviewLoaded()));
-
- connect(d->rightPreview, SIGNAL(signalPreviewLoaded(bool)),
- this, SLOT(slotPreviewLoaded()));
+ this, SLOT(slotRightPreviewLoaded(bool)));
}
LightTableView::~LightTableView()
@ -141,26 +139,6 @
d->syncPreview = sync;
}
-void LightTableView::setLeftImageInfo(ImageInfo* info)
-{
- d->leftPreview->setImageInfo(info);
-}
-
-void LightTableView::setRightImageInfo(ImageInfo* info)
-{
- d->rightPreview->setImageInfo(info);
-}
-
-ImageInfo* LightTableView::leftImageInfo() const
-{
- return d->leftPreview->getImageInfo();
-}
-
-ImageInfo* LightTableView::rightImageInfo() const
-{
- return d->rightPreview->getImageInfo();
-}
-
void LightTableView::slotDecreaseZoom()
{
if (!d->syncPreview) return;
@ -289,7 +267,7 @
void LightTableView::slotLeftContentsMoved(int x, int y)
{
- if (d->syncPreview)
+ if (d->syncPreview && !d->leftLoading)
{
d->rightPreview->blockSignals(true);
setRightZoomFactor(d->leftPreview->zoomFactor());
@ -301,7 +279,7 @
void LightTableView::slotRightContentsMoved(int x, int y)
{
- if (d->syncPreview)
+ if (d->syncPreview && !d->rightLoading)
{
d->leftPreview->blockSignals(true);
setLeftZoomFactor(d->rightPreview->zoomFactor());
@ -311,8 +289,50 @
}
}
-void LightTableView::slotPreviewLoaded()
+ImageInfo* LightTableView::leftImageInfo() const
{
+ return d->leftPreview->getImageInfo();
+}
+
+ImageInfo* LightTableView::rightImageInfo() const
+{
+ return d->rightPreview->getImageInfo();
+}
+
+void LightTableView::setLeftImageInfo(ImageInfo* info)
+{
+ d->leftLoading = true;
+ d->leftPreview->setImageInfo(info);
+}
+
+void LightTableView::setRightImageInfo(ImageInfo* info)
+{
+ d->rightLoading = true;
+ d->rightPreview->setImageInfo(info);
+}
+
+void LightTableView::slotLeftPreviewLoaded(bool success)
+{
+ emit signalLeftPreviewLoaded(success);
+
+ checkForSyncPreview();
+ d->leftLoading = false;
+ slotRightContentsMoved(d->rightPreview->contentsX(),
+ d->rightPreview->contentsY());
+}
+
+void LightTableView::slotRightPreviewLoaded(bool success)
+{
+ emit signalRightPreviewLoaded(success);
+
+ checkForSyncPreview();
+ d->rightLoading = false;
+ slotLeftContentsMoved(d->leftPreview->contentsX(),
+ d->leftPreview->contentsY());
+}
+
+void LightTableView::checkForSyncPreview()
+{
if (d->leftPreview->getImageInfo() && d->rightPreview->getImageInfo() &&
d->leftPreview->getImageSize() == d->rightPreview->getImageSize())
{
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttableview.h #662873:662874
@ -110,10 +110,15 @
void slotLeftContentsMoved(int, int);
void slotRightContentsMoved(int, int);
- void slotPreviewLoaded();
+ void slotLeftPreviewLoaded(bool);
+ void slotRightPreviewLoaded(bool);
private :
+ void checkForSyncPreview();
+
+private :
+
LightTableViewPriv* d;
};
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablewindow.cpp #662873:662874
@ -474,7 +474,9 @
{
LightTableBarItem *item = new LightTableBarItem(d->barView, *it);
if (*it == imageInfoCurrent)
+ {
d->barView->setSelected(item);
+ }
}
}
More information about the Digikam-devel
mailing list