Commit ff357817 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

Remove dupplicate action to Rebuild thumbs.

Refresh current album action now rebuild thumbs and scan for new items in current album.
BUGS: 262720
FIXED-IN: 4.3.0
parent 2ac8d27b
......@@ -46,6 +46,7 @@
#include "itemviewtooltip.h"
#include "tooltipfiller.h"
#include "thumbsgenerator.h"
#include "newitemsfinder.h"
namespace Digikam
{
......@@ -178,8 +179,8 @@ AlbumSelectionTreeView::AlbumSelectionTreeView(QWidget* const parent, AlbumModel
setAlbumModel(model);
d->albumModificationHelper = albumModificationHelper;
d->toolTip = new AlbumViewToolTip(this);
d->findDuplAction = new QAction(SmallIcon("tools-wizard"), i18n("Find Duplicates..."), this);
d->rebuildThumbsAction = new QAction(SmallIcon("view-process-all"), i18n("Rebuild Thumbnails..."), this);
d->findDuplAction = new QAction(SmallIcon("tools-wizard"), i18n("Find Duplicates..."), this);
d->rebuildThumbsAction = new QAction(SmallIcon("view-refresh"), i18n("Refresh"), this);
connect(d->findDuplAction, SIGNAL(triggered()),
this, SLOT(slotFindDuplicates()));
......@@ -223,6 +224,15 @@ void AlbumSelectionTreeView::slotRebuildThumbs()
ThumbsGenerator* const tool = new ThumbsGenerator(true, album->id());
tool->start();
// if physical album, schedule a collection scan of current album's path
if (album && album->type() == Album::PHYSICAL)
{
NewItemsFinder* const tool = new NewItemsFinder(NewItemsFinder::ScheduleCollectionScan,
QStringList() << static_cast<PAlbum*>(album)->folderPath());
tool->start();
}
}
bool AlbumSelectionTreeView::viewportEvent(QEvent* event)
......
......@@ -8,7 +8,7 @@
*
* Copyright (C) 2002-2005 by Renchi Raju <renchi dot raju at gmail dot com>
* Copyright (C) 2006 by Tom Albers <tomalbers at kde dot nl>
* Copyright (C) 2002-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2002-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2009-2012 by Andi Clemens <andi dot clemens at gmail dot com>
* Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
* Copyright (C) 2014 by Mohamed Anwer <mohammed dot ahmed dot anwer at gmail dot com>
......@@ -143,7 +143,6 @@
#include "maintenancedlg.h"
#include "maintenancemngr.h"
#include "newitemsfinder.h"
#include "thumbsgenerator.h"
#include "kipipluginloader.h"
#include "imagepluginloader.h"
#include "tagsmanager.h"
......@@ -771,13 +770,6 @@ void DigikamApp::setupActions()
// -----------------------------------------------------------------
d->rebuildAlbumThumbsAction = new KAction(KIcon("view-process-all"), i18n("Rebuild Thumbnails In Current Album"), this);
d->rebuildAlbumThumbsAction->setWhatsThis(i18n("Rebuilds all thumbnails for the current selected album"));
connect(d->rebuildAlbumThumbsAction, SIGNAL(triggered()), this, SLOT(slotRebuildAlbumThumbnails()));
actionCollection()->addAction("album_rebuild_thumbs", d->rebuildAlbumThumbsAction);
// -----------------------------------------------------------------
d->writeAlbumMetadataAction = new KAction(KIcon("document-edit"), i18n("Write Metadata to Images"), this);
d->writeAlbumMetadataAction->setWhatsThis(i18n("Updates metadata of images in the current "
"album with the contents of digiKam database "
......@@ -2535,20 +2527,6 @@ void DigikamApp::slotMaintenanceDone()
}
}
void DigikamApp::slotRebuildAlbumThumbnails()
{
QList<Album*> albumList = AlbumManager::instance()->currentAlbums();
int id = 0;
if(!albumList.isEmpty())
{
id = albumList.first()->id();
}
ThumbsGenerator* tool = new ThumbsGenerator(true, id);
tool->start();
}
void DigikamApp::slotRecurseAlbums(bool checked)
{
d->view->setRecurseAlbums(checked);
......
......@@ -8,7 +8,7 @@
*
* Copyright (C) 2002-2005 by Renchi Raju <renchi dot raju at gmail dot com>
* Copyright (C) 2006 by Tom Albers <tomalbers at kde dot nl>
* Copyright (C) 2002-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2002-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2009-2011 by Andi Clemens <andi dot clemens at gmail dot com>
* Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
*
......@@ -196,7 +196,6 @@ private Q_SLOTS:
void slotMaintenance();
void slotMaintenanceDone();
void slotRebuildAlbumThumbnails();
void slotDatabaseMigration();
void slotZoomSliderChanged(int);
......
......@@ -109,7 +109,6 @@ public:
openInFileManagerAction(0),
openInTerminalAction(0),
refreshAlbumAction(0),
rebuildAlbumThumbsAction(0),
writeAlbumMetadataAction(0),
readAlbumMetadataAction(0),
browseTagsAction(0),
......@@ -225,7 +224,6 @@ public:
KAction* openInFileManagerAction;
KAction* openInTerminalAction;
KAction* refreshAlbumAction;
KAction* rebuildAlbumThumbsAction;
KAction* writeAlbumMetadataAction;
KAction* readAlbumMetadataAction;
......
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<gui version="213" name="digikam" >
<gui version="214" name="digikam" >
<MenuBar>
......@@ -16,7 +16,6 @@
<Separator/>
<Action name="album_back" />
<Action name="album_forward" />
<Action name="album_refresh" />
<Separator/>
<Action name="app_exit" />
</Menu>
......@@ -30,7 +29,7 @@
<Action name="album_remove" />
<Action name="album_delete" />
<Separator/>
<Action name="album_rebuild_thumbs" />
<Action name="album_refresh" />
<Action name="album_write_metadata" />
<Action name="album_read_metadata" />
</Menu>
......
......@@ -7,7 +7,7 @@
* Description : implementation of album view interface.
*
* Copyright (C) 2002-2005 by Renchi Raju <renchi dot raju at gmail dot com>
* Copyright (C) 2002-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2002-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2009-2011 by Johannes Wienke <languitar at semipol dot de>
* Copyright (C) 2010-2011 by Andi Clemens <andi dot clemens at gmail dot com>
* Copyright (C) 2011-2013 by Michael G. Hansen <mike at mghansen dot de>
......@@ -61,6 +61,7 @@
#include "mapwidgetview.h"
#include "mediaplayerview.h"
#include "metadatasettings.h"
#include "newitemsfinder.h"
#include "globals.h"
#include "metadatahub.h"
#include "fileactionmngr.h"
......@@ -80,6 +81,7 @@
#include "versionmanagersettings.h"
#include "tableview.h"
#include "tagsmanager.h"
#include "thumbsgenerator.h"
#include "albumlabelstreeview.h"
#ifdef USE_PRESENTATION_MODE
......@@ -1134,6 +1136,7 @@ void DigikamView::slotAlbumSelected(QList<Album*> albums)
}
Album* album = albums.first();
if (album->type() == Album::PHYSICAL)
{
emit signalAlbumSelected(true);
......@@ -1277,12 +1280,24 @@ void DigikamView::slotAlbumRefresh()
LoadingCacheInterface::cleanThumbnailCache();
Album* const album = d->iconView->currentAlbum();
ThumbsGenerator* const tool = new ThumbsGenerator(true, album->id());
tool->start();
// if physical album, schedule a collection scan of current album's path
if (album && album->type() == Album::PHYSICAL)
{
ScanController::instance()->scheduleCollectionScan(static_cast<PAlbum*>(album)->folderPath());
NewItemsFinder* const tool = new NewItemsFinder(NewItemsFinder::ScheduleCollectionScan,
QStringList() << static_cast<PAlbum*>(album)->folderPath());
connect(tool, SIGNAL(signalComplete()),
this, SLOT(slotAlbumRefreshComplete()));
tool->start();
}
}
void DigikamView::slotAlbumRefreshComplete()
{
// force reload. Should normally not be necessary, but we may have bugs
qlonglong currentId = currentInfo().id();
d->iconView->imageAlbumModel()->refresh();
......@@ -1298,14 +1313,15 @@ void DigikamView::slotImageSelected()
// delay to slotDispatchImageSelected
d->needDispatchSelection = true;
d->selectionTimer->start();
switch (viewMode())
{
case StackedView::TableViewMode:
emit signalSelectionChanged(d->tableView->numberOfSelectedItems());
break;
case StackedView::TableViewMode:
emit signalSelectionChanged(d->tableView->numberOfSelectedItems());
break;
default:
emit signalSelectionChanged(d->iconView->numberOfSelectedIndexes());
default:
emit signalSelectionChanged(d->iconView->numberOfSelectedIndexes());
}
}
......
......@@ -7,7 +7,7 @@
* Description : implementation of album view interface.
*
* Copyright (C) 2002-2005 by Renchi Raju <renchi dot raju at gmail dot com>
* Copyright (C) 2002-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2002-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2009-2011 by Johannes Wienke <languitar at semipol dot de>
* Copyright (C) 2010-2011 by Andi Clemens <andi dot clemens at gmail dot com>
*
......@@ -88,18 +88,19 @@ public:
KUrl::List allUrls() const;
KUrl::List selectedUrls() const;
KUrl currentUrl() const;
KUrl currentUrl() const;
bool hasCurrentItem() const;
ImageInfo currentInfo() const;
ImageInfo currentInfo() const;
QList<ImageInfo> selectedInfoList(const bool currentFirst = false) const;
ImageInfoList allInfo() const;
ImageInfoList allInfo() const;
double zoomMin() const;
double zoomMax() const;
double zoomMin() const;
double zoomMax() const;
void toggleTag(int tagID);
QList<SidebarWidget*> leftSidebarWidgets() const;
StackedView::StackedViewMode viewMode() const;
StackedView::StackedViewMode viewMode() const;
Q_SIGNALS:
......@@ -261,6 +262,8 @@ private Q_SLOTS:
void slotPopupFiltersView();
void slotSetupMetadataFilters(int);
void slotAlbumRefreshComplete();
private:
......
......@@ -6,7 +6,7 @@
* Date : 2012-01-20
* Description : new items finder.
*
* Copyright (C) 2012-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2012-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2012 by Andi Clemens <andi dot clemens at gmail dot com>
*
* This program is free software; you can redistribute it
......@@ -82,8 +82,9 @@ NewItemsFinder::NewItemsFinder(const FinderMode mode, const QStringList& folders
this, SLOT(slotPartialScanDone(QString)));
// If we are scanning for newly imported files, we need to have the folders for scanning...
if(mode == ScheduleCollectionScan && foldersToScan.isEmpty()) {
kWarning() << "NewItemsFinder called without any folders. This is a bug.";
if(mode == ScheduleCollectionScan && foldersToScan.isEmpty())
{
kWarning() << "NewItemsFinder called without any folders. Wrong call.";
}
d->foldersToScan = foldersToScan;
......
......@@ -6,7 +6,7 @@
* Date : 2012-01-20
* Description : new items finder.
*
* Copyright (C) 2012-2013 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2012-2014 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -43,14 +43,15 @@ public:
enum FinderMode
{
CompleteCollectionScan, // Scan whole collection imediatly.
ScanDeferredFiles, // Defer whole collection scan.
ScheduleCollectionScan // Scan imediatly folders list passed in contructor.
CompleteCollectionScan, /** Scan whole collection imediatly. */
ScanDeferredFiles, /** Defer whole collection scan. */
ScheduleCollectionScan /** Scan imediatly folders list passed in contructor. */
};
public:
explicit NewItemsFinder(const FinderMode mode = CompleteCollectionScan, const QStringList& foldersToScan = QStringList(),
explicit NewItemsFinder(const FinderMode mode = CompleteCollectionScan,
const QStringList& foldersToScan = QStringList(),
ProgressItem* const parent = 0);
~NewItemsFinder();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment