Index: utilities/cameragui/filtercombo.cpp
===================================================================
--- utilities/cameragui/filtercombo.cpp	(revision 0)
+++ utilities/cameragui/filtercombo.cpp	(revision 0)
@@ -0,0 +1,253 @@
+/* ============================================================
+ *
+ * This file is a part of digiKam project
+ * http://www.digikam.org
+ *
+ * Date        : 2010-12-16
+ * Description : Filter combobox
+ *
+ * Copyright (C) 2010 by Petri Damstén <petri.damsten@iki.fi>
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+// Qt includes
+
+#include <QStringList>
+
+// KDE includes
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kconfiggroup.h>
+
+// Local includes
+
+#include "filtercombo.h"
+#include "cameraiconitem.h"
+#include "gpiteminfo.h"
+
+namespace Digikam
+{
+
+class Filter
+{
+public:
+    Filter()
+        : onlyNew(false)
+    {
+    }
+
+    QString toString()
+    {
+        return QString("%1|%2|%3|%4").arg(name).arg(onlyNew ? "true" : "false")
+                .arg(fileFilter.join(";")).arg(pathFilter.join(";"));
+    }
+
+    void fromString(const QString& filter)
+    {
+        QStringList s = filter.split('|');
+        name = s.value(0);
+        onlyNew = (s.value(1) == "true");
+        if (!s.value(2).isEmpty())
+        {
+            fileFilter = s.value(2).split(';');
+        }
+        if (!s.value(3).isEmpty())
+        {
+            pathFilter = s.value(3).split(';');
+        }
+    }
+
+    QString name;
+    bool onlyNew;
+    QStringList fileFilter;
+    QStringList pathFilter;
+};
+
+class FilterComboBoxPriv
+{
+public:
+    FilterComboBoxPriv()
+    {
+        KSharedConfig::Ptr config = KGlobal::config();
+        KConfigGroup group = config->group("Import Filters");
+        for (int i = 0; true; ++i)
+        {
+            QString filter = group.readEntry(QString("Filter%1").arg(i), QString());
+            if (filter.isEmpty())
+            {
+                break;
+            }
+            Filter* f = new Filter;
+            f->fromString(filter);
+            filters.append(f);
+        }
+        if (filters.count() == 0)
+        {
+            defaultFilters();
+        }
+        currentFilter = group.readEntry("CurrentFilter", 0);
+    }
+
+    ~FilterComboBoxPriv()
+    {
+        qDeleteAll(filters);
+    }
+
+    void defaultFilters()
+    {
+        Filter* f;
+        f = new Filter;
+        f->name = i18n("All Files");
+        filters.append(f);
+
+        f = new Filter;
+        f->name = i18n("Only New Files");
+        f->onlyNew = true;
+        filters.append(f);
+
+        f = new Filter;
+        f->name = i18n("Raw Files");
+        // TODO
+        f->fileFilter << "*.nef";
+        filters.append(f);
+
+        f = new Filter;
+        f->name = i18n("Non Raw Files");
+        // TODO
+        f->fileFilter << "*.jpg";
+        filters.append(f);
+
+        f = new Filter;
+        f->name = i18n("Video Files");
+        // TODO
+        f->fileFilter << "*.avi";
+        filters.append(f);
+
+        // DEBUG ----------------------------------
+        f = new Filter;
+        f->name = i18n("New from Card 1");
+        f->pathFilter << "/store_00010001/*";
+        f->onlyNew = true;
+        filters.append(f);
+        // DEBUG ----------------------------------
+    }
+
+    int currentFilter;
+    QList<Filter*> filters;
+};
+
+FilterComboBox::FilterComboBox(QWidget* const parent)
+    : KComboBox(parent), d(new FilterComboBoxPriv)
+{
+    foreach (Filter* f, d->filters)
+    {
+        addItem(f->name);
+    }
+    addItem(i18n("Configure..."));
+    setCurrentIndex(d->currentFilter);
+    connect(this, SIGNAL(activated(int)), this, SLOT(indexChanged(int)));
+}
+
+FilterComboBox::~FilterComboBox()
+{
+}
+
+void FilterComboBox::indexChanged(int index)
+{
+    if (index != d->currentFilter)
+    {
+        if (index < d->filters.count())
+        {
+            d->currentFilter = index;
+            emit filterChanged();
+        } else {
+            setCurrentIndex(d->currentFilter);
+            // TODO configure
+        }
+    }
+}
+
+void FilterComboBox::saveSettings()
+{
+    KSharedConfig::Ptr config = KGlobal::config();
+    KConfigGroup group = config->group("Import Filters");
+
+    for (int i = 0; i < d->filters.count(); ++i)
+    {
+        group.writeEntry(QString("Filter%1").arg(i), d->filters[i]->toString());
+    }
+    group.writeEntry("CurrentFilter", d->currentFilter);
+}
+
+bool FilterComboBox::matchesCurrentFilter(const GPItemInfo& item) const
+{
+    kDebug() << item.downloaded << item.folder << item.name;
+
+    Filter* currentFilter = d->filters.value(d->currentFilter);
+    if (!currentFilter)
+    {
+        return true;
+    }
+
+    if (currentFilter->onlyNew)
+    {
+        if (item.downloaded == GPItemInfo::DownloadedYes)
+        {
+            return false;
+        }
+    }
+    if (!currentFilter->fileFilter.isEmpty())
+    {
+        bool match = false;
+        foreach (const QString& filter, currentFilter->fileFilter)
+        {
+            QRegExp rx(filter.toLower());
+            rx.setPatternSyntax(QRegExp::Wildcard);
+            match = rx.exactMatch(item.name.toLower());
+            if (match)
+            {
+                break;
+            }
+        }
+        if (!match)
+        {
+            return false;
+        }
+    }
+    if (!currentFilter->pathFilter.isEmpty())
+    {
+        bool match = false;
+        foreach (const QString& filter, currentFilter->pathFilter)
+        {
+            QRegExp rx(filter.toLower());
+            rx.setPatternSyntax(QRegExp::Wildcard);
+            match = rx.exactMatch(item.folder.toLower());
+            if (match)
+            {
+                break;
+            }
+        }
+        if (!match)
+        {
+            return false;
+        }
+    }
+    return true;
+}
+
+}  // namespace Digikam
+
+#include "filtercombo.moc"
Index: utilities/cameragui/umscamera.cpp
===================================================================
--- utilities/cameragui/umscamera.cpp	(revision 1207125)
+++ utilities/cameragui/umscamera.cpp	(working copy)
@@ -207,7 +207,7 @@
 
             if (dt.isNull()) // fall back to file system info
             {
-                ImageScanner::creationDateFromFilesystem(*fi);
+                dt = ImageScanner::creationDateFromFilesystem(*fi);
             }
 
             info.name             = fi->fileName();
Index: utilities/cameragui/cameraui.cpp
===================================================================
--- utilities/cameragui/cameraui.cpp	(revision 1207125)
+++ utilities/cameragui/cameraui.cpp	(working copy)
@@ -665,6 +665,12 @@
 
     //------------------------------------------------------------------------------
 
+    d->filterComboBox = new FilterComboBox(statusBar());
+    statusBar()->addWidget(d->filterComboBox, 1);
+    connect(d->filterComboBox, SIGNAL(filterChanged()), this, SLOT(slotFilterChanged()));
+
+    //------------------------------------------------------------------------------
+
     d->zoomBar = new DZoomBar(statusBar());
     d->zoomBar->setZoomPlusAction(d->increaseThumbsAction);
     d->zoomBar->setZoomMinusAction(d->decreaseThumbsAction);
@@ -793,6 +799,7 @@
 
     d->rightSideBar->saveState();
     d->splitter->saveState(group);
+    d->filterComboBox->saveSettings();
     config->sync();
 }
 
@@ -1223,7 +1230,7 @@
         return;
     }
 
-    CHUpdateItemMap _map = map;
+    d->map = map;
 
     int curr = d->statusProgressBar->progressTotalSteps();
     d->statusProgressBar->setProgressTotalSteps(curr + map.count());
@@ -1233,7 +1240,7 @@
     GPItemInfo item;
     QList<QVariant> itemsList;
 
-    it = lastPhotoFirst ? _map.end() : _map.begin();
+    it = lastPhotoFirst ? d->map.end() : d->map.begin();
 
     do
     {
@@ -1243,15 +1250,18 @@
         }
 
         item = *it;
-        d->view->addItem(item);
-        itemsList.append(QStringList() << item.folder << item.name);
+        if (d->filterComboBox->matchesCurrentFilter(item))
+        {
+            d->view->addItem(item);
+            itemsList.append(QStringList() << item.folder << item.name);
+        }
 
         if (!lastPhotoFirst)
         {
             it++;
         }
     }
-    while ((lastPhotoFirst ? it != _map.begin() : it != _map.end()));
+    while ((lastPhotoFirst ? it != d->map.begin() : it != d->map.end()));
 
     d->controller->getThumbnails(itemsList);
 }
@@ -1260,26 +1270,19 @@
 {
     saveSettings();
 
-    QMultiMap<QDateTime, GPItemInfo> map;
+    slotFilterChanged();
+}
+
+void CameraUI::slotFilterChanged()
+{
     CameraIconItem* item = dynamic_cast<CameraIconItem*>(d->view->firstItem());
-    QFileInfo info;
 
     while (item)
     {
-        info.setFile(item->itemInfo()->name);
-        map.insertMulti(item->itemInfo()->mtime, *item->itemInfo());
-        item = dynamic_cast<CameraIconItem*>(item->nextItem());
-    }
-
-    item = dynamic_cast<CameraIconItem*>(d->view->firstItem());
-
-    while (item)
-    {
         d->view->removeItem(item->itemInfo()->folder,item->itemInfo()->name);
         item = dynamic_cast<CameraIconItem*>(item->nextItem());
     }
-
-    slotRefreshIconView(map);
+    d->historyUpdater->addItems(d->controller->cameraMD5ID(), d->map);
 }
 
 void CameraUI::slotThumbnail(const QString& folder, const QString& file,
Index: utilities/cameragui/CMakeLists.txt
===================================================================
--- utilities/cameragui/CMakeLists.txt	(revision 1207125)
+++ utilities/cameragui/CMakeLists.txt	(working copy)
@@ -19,6 +19,7 @@
         ${CMAKE_CURRENT_SOURCE_DIR}/gpiteminfo.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/renamecustomizer.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/umscamera.cpp
+        ${CMAKE_CURRENT_SOURCE_DIR}/filtercombo.cpp
 )
 
 KDE4_ADD_LIBRARY(cameragui STATIC ${libcameragui_SRCS})
Index: utilities/cameragui/cameraui_p.h
===================================================================
--- utilities/cameragui/cameraui_p.h	(revision 1207125)
+++ utilities/cameragui/cameraui_p.h	(working copy)
@@ -50,6 +50,7 @@
 
 #include "cameracontroller.h"
 #include "cameraiconview.h"
+#include "filtercombo.h"
 #include "dlogoaction.h"
 #include "dzoombar.h"
 #include "freespacewidget.h"
@@ -144,7 +145,8 @@
         statusNavigateBar(0),
         albumLibraryFreeSpace(0),
         cameraFreeSpace(0),
-        historyView(0)
+        historyView(0),
+        filterComboBox(0)
     {
     }
 
@@ -247,6 +249,9 @@
     FreeSpaceWidget*              cameraFreeSpace;
 
     DHistoryView*                 historyView;
+    FilterComboBox*               filterComboBox;
+
+    CHUpdateItemMap               map;
 };
 
 }  // namespace Digikam
Index: utilities/cameragui/filtercombo.h
===================================================================
--- utilities/cameragui/filtercombo.h	(revision 0)
+++ utilities/cameragui/filtercombo.h	(revision 0)
@@ -0,0 +1,63 @@
+/* ============================================================
+ *
+ * This file is a part of digiKam project
+ * http://www.digikam.org
+ *
+ * Date        : 2010-12-16
+ * Description : Filter combobox
+ *
+ * Copyright (C) 2010 by Petri Damstén <petri.damsten@iki.fi>
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef FILTERCOMBOBOX_H
+#define FILTERCOMBOBOX_H
+
+// KDE includes
+
+#include <KComboBox>
+
+class QCloseEvent;
+
+namespace Digikam
+{
+
+class GPItemInfo;
+class FilterComboBoxPriv;
+
+class FilterComboBox : public KComboBox
+{
+    Q_OBJECT
+
+public:
+
+    FilterComboBox(QWidget* const parent);
+    ~FilterComboBox();
+
+    bool matchesCurrentFilter(const GPItemInfo& item) const;
+    void saveSettings();
+
+Q_SIGNALS:
+    void filterChanged();
+
+protected Q_SLOTS:
+    void indexChanged(int index);
+
+private:
+    FilterComboBoxPriv* const d;
+};
+
+}  // namespace Digikam
+
+#endif /* FILTERCOMBOBOX_H */
Index: utilities/cameragui/cameraui.h
===================================================================
--- utilities/cameragui/cameraui.h	(revision 1207125)
+++ utilities/cameragui/cameraui.h	(working copy)
@@ -191,6 +191,7 @@
     void slotExifFromData(const QByteArray& exifData);
 
     void slotlastPhotoFirst();
+    void slotFilterChanged();
 
     void slotFirstItem();
     void slotPrevItem();
