[Digikam-devel] [Bug 119205] digikam: d&d of image into librarypath root dir ==> images are invisible
Gilles Caulier
caulier.gilles at kdemail.net
Mon Dec 11 12:10:59 GMT 2006
------- 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=119205
caulier.gilles kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From caulier.gilles kdemail net 2006-12-11 13:10 -------
SVN commit 612433 by cgilles:
digikam from trunk : never handle root album with Drag & Drop and Copy & Paste operations.
BUG: 119205
M +19 -16 albumfolderview.cpp
M +16 -12 albumiconview.cpp
--- trunk/extragear/graphics/digikam/digikam/albumfolderview.cpp #612432:612433
@ -45,7 +45,6 @
#include "ddebug.h"
#include "digikamapp.h"
#include "album.h"
-#include "albumfolderview.h"
#include "albumpropsedit.h"
#include "album.h"
#include "albummanager.h"
@ -59,6 +58,8 @
#include "dragobjects.h"
#include "albumthumbnailloader.h"
#include "deletedialog.h"
+#include "albumfolderview.h"
+#include "albumfolderview.moc"
// X11 C Ansi includes.
@ -103,7 +104,7 @
: FolderItem(parent, album->title())
{
setDragEnabled(true);
- m_album = album;
+ m_album = album;
m_groupItem = false;
}
@ -111,7 +112,7 @
: FolderItem(parent, album->title())
{
setDragEnabled(true);
- m_album = album;
+ m_album = album;
m_groupItem = false;
}
@ -265,7 +266,7 @
if (failed)
{
DWarning() << k_funcinfo << " Failed to find parent for Album "
- << palbum->url() << endl;
+ << palbum->url() << endl;
return;
}
@ -777,7 +778,7 @
{
return false;
}
- };
+ }
}
if(itemDrop && !itemDrop->parent())
@ -812,7 +813,7 @
if(!acceptDrop(e))
return;
- QPoint vp = contentsToViewport(e->pos());
+ QPoint vp = contentsToViewport(e->pos());
AlbumFolderViewItem *itemDrop = dynamic_cast<AlbumFolderViewItem*>(itemAt(vp));
if(AlbumDrag::canDecode(e))
@ -849,7 +850,7 @
}
KIO::Job* job = DIO::move(album->kurl(), destAlbum->kurl());
connect(job, SIGNAL(result(KIO::Job*)),
- SLOT(slotDIOResult(KIO::Job*)));
+ this, SLOT(slotDIOResult(KIO::Job*)));
}
}
else if (AlbumSettings::instance()->getAlbumSortOrder()
@ -893,7 +894,7 @
// all the albumids will be the same
int albumID = albumIDs.first();
- srcAlbum = d->albumMan->findPAlbum(albumID);
+ srcAlbum = d->albumMan->findPAlbum(albumID);
if (!srcAlbum)
{
DWarning() << "Could not find source album of drag"
@ -972,14 +973,14 @
{
KIO::Job* job = DIO::move(kioURLs, destAlbum->kurl());
connect(job, SIGNAL(result(KIO::Job*)),
- SLOT(slotDIOResult(KIO::Job*)));
+ this, SLOT(slotDIOResult(KIO::Job*)));
break;
}
case 11:
{
KIO::Job* job = DIO::copy(kioURLs, destAlbum->kurl());
connect(job, SIGNAL(result(KIO::Job*)),
- SLOT(slotDIOResult(KIO::Job*)));
+ this, SLOT(slotDIOResult(KIO::Job*)));
break;
}
case 12:
@ -994,10 +995,10 @
return;
}
- if(QUriDrag::canDecode(e))
+ // -- DnD from an external source ----------------------------------------
+
+ if(QUriDrag::canDecode(e))
{
- // DnD from an external source
-
PAlbum* destAlbum = 0;
if (itemDrop)
@ -1005,6 +1006,10 @
else
destAlbum = d->albumMan->findPAlbum(0);
+ // B.K.O #119205: do not handle root album.
+ if (destAlbum->isRoot())
+ return;
+
KURL destURL(destAlbum->kurl());
KURL::List srcURLs;
@ -1147,7 +1152,7 @
{
return findParentByDate(album, failed);
}
- };
+ }
failed = true;
return 0;
@ -1312,5 +1317,3 @
}
} // namespace Digikam
-
-#include "albumfolderview.moc"
--- trunk/extragear/graphics/digikam/digikam/albumiconview.cpp #612432:612433
@ -464,7 +464,7 @
}
QPopupMenu popmenu(this);
- KAction *paste = KStdAction::paste(this, SLOT(slotPaste()), 0);
+ KAction *paste = KStdAction::paste(this, SLOT(slotPaste()), 0);
QMimeSource *data = kapp->clipboard()->data(QClipboard::Clipboard);
if(!data || !QUriDrag::canDecode(data))
@ -740,13 +740,17 @
d->currentAlbum->type() == Album::PHYSICAL)
{
PAlbum* palbum = (PAlbum*)d->currentAlbum;
+
+ // B.K.O #119205: do not handle root album.
+ if (palbum->isRoot())
+ return;
+
KURL destURL(palbum->kurl());
KURL::List srcURLs;
KURLDrag::decode(data, srcURLs);
KIO::Job* job = DIO::copy(srcURLs, destURL);
-
connect(job, SIGNAL(result(KIO::Job*)),
this, SLOT(slotDIOResult(KIO::Job*)));
}
@ -848,7 +852,7 @
KIO::Job* job = DIO::del(urlList, useTrash);
connect(job, SIGNAL(result(KIO::Job*)),
- SLOT(slotDIOResult(KIO::Job*)));
+ this, SLOT(slotDIOResult(KIO::Job*)));
}
void AlbumIconView::slotDeleteSelectedItemsDirectly(bool useTrash)
@ -1513,16 +1517,16 @
void AlbumIconView::updateItemRectsPixmap()
{
- d->itemRect = QRect(0,0,0,0);
- d->itemRatingRect = QRect(0,0,0,0);
- d->itemDateRect = QRect(0,0,0,0);
- d->itemModDateRect = QRect(0,0,0,0);
- d->itemPixmapRect = QRect(0,0,0,0);
- d->itemNameRect = QRect(0,0,0,0);
- d->itemCommentsRect = QRect(0,0,0,0);
+ d->itemRect = QRect(0,0,0,0);
+ d->itemRatingRect = QRect(0,0,0,0);
+ d->itemDateRect = QRect(0,0,0,0);
+ d->itemModDateRect = QRect(0,0,0,0);
+ d->itemPixmapRect = QRect(0,0,0,0);
+ d->itemNameRect = QRect(0,0,0,0);
+ d->itemCommentsRect = QRect(0,0,0,0);
d->itemResolutionRect = QRect(0,0,0,0);
- d->itemSizeRect = QRect(0,0,0,0);
- d->itemTagRect = QRect(0,0,0,0);
+ d->itemSizeRect = QRect(0,0,0,0);
+ d->itemTagRect = QRect(0,0,0,0);
d->fnReg = font();
d->fnCom = font();
More information about the Digikam-devel
mailing list