Summary: | Sometimes DigiKam fails to show newly downloaded photos (exemple found for Bug 119073: wish list rescan option) | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Tung NGUYEN <ntung> |
Component: | Import-History | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 0.8.0 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.0 | |
Attachments: |
/home/yourusername/camera/Photo 003.jpg
proposed patch |
Description
Tung NGUYEN
2005-12-29 21:59:56 UTC
Created attachment 14071 [details]
/home/yourusername/camera/Photo 003.jpg
Okido, confirmed. Looks like new folders created by the camera dialog are not picked up. Created attachment 14073 [details]
proposed patch
Tung, attached a patch for the problem:
When a directory is created, a watch is put on it to spot new files
but it can occur that the file is copied there before the watch is
completely setup. That is why as an extra safeguard run scanlib
over the folders we used when the cameragui is closed.
Could you test it for me?
Tom, I have to read some doc on how to merge a patch... :-) Promised, I will test it for you as soon as possible. Tung, if you have our unpacked tarball, go into the digikam folder and apply this patch with: patch -p0 < downloaded file If it complains it can not find the file, try -p1 If it is ok, it tells you that it is applied succesfully, after that you can do make and make install as usual. Tom, I have tested your patch on DigiKam 0.8.0 tarball, it works fine. Thank you. You can close this bug report. --- Tung. SVN commit 493646 by toma: Fix for the camergui. When a directory is created, a watch is put on it to spot new files but it can occur that the file is copied there before the watch is completely setup. That is why as an extra safeguard run scanlib over the folders we used when the cameragui is closed. BUG:119201 M +5 -0 digikam/scanlib.cpp M +7 -0 digikam/scanlib.h M +20 -2 utilities/cameragui/cameraui.cpp M +1 -0 utilities/cameragui/cameraui.h --- trunk/extragear/graphics/digikam/digikam/scanlib.cpp #493645:493646 @@ -150,6 +150,11 @@ } } +void ScanLib::findMissingItems(const QString &path) +{ + allFiles(path); +} + void ScanLib::findMissingItems() { QString albumPath = AlbumManager::instance()->getLibraryPath(); --- trunk/extragear/graphics/digikam/digikam/scanlib.h #493645:493646 @@ -71,6 +71,13 @@ */ void findMissingItems(); + + /** + * This calls allFiles with a given path. + * @param path the path to scan. + */ + void findMissingItems(const QString &path); + /** * This queries the db for items that have no date * for each item found, storeItemInDatabase is called. --- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #493645:493646 @@ -46,6 +46,7 @@ #include <kiconloader.h> #include <kpopupmenu.h> #include <khelpmenu.h> +#include <kdebug.h> #include <kcalendarsystem.h> @@ -67,6 +68,7 @@ #include "cameraiconitem.h" #include "cameracontroller.h" #include "cameraui.h" +#include "scanlib.h" CameraUI::CameraUI(QWidget* parent, const QString& title, const QString& model, const QString& port, @@ -269,12 +271,26 @@ void CameraUI::closeEvent(QCloseEvent* e) { + // When a directory is created, a watch is put on it to spot new files + // but it can occur that the file is copied there before the watch is + // completely setup. That is why as an extra safeguard run scanlib + // over the folders we used. Bug: 119201 + ScanLib sLib; + for (QStringList::iterator it = m_foldersToScan.begin(); + it != m_foldersToScan.end(); ++it) + { + kdDebug() << "Scanning " << (*it) << endl; + sLib.findMissingItems( (*it) ); + } + + //--------------------------------------------------- + if(!m_lastDestURL.isEmpty()) emit signalLastDestination(m_lastDestURL); delete m_controller; saveSettings(); - e->accept(); + e->accept(); } @@ -469,10 +485,12 @@ } u.addPath(dirName); + m_foldersToScan.append(u.path()); u.addPath(downloadName.isEmpty() ? name : downloadName); } else { + m_foldersToScan.append(u.path()); u.addPath(downloadName.isEmpty() ? name : downloadName); } m_controller->download(folder, name, u.path(), autoRotate); @@ -482,7 +500,7 @@ if (total <= 0) return; - + m_lastDestURL = url; m_progress->setProgress(0); m_progress->setTotalSteps(total); --- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.h #493645:493646 @@ -97,6 +97,7 @@ CameraController* m_controller; KURL m_lastDestURL; + QStringList m_foldersToScan; private slots: SVN commit 493648 by toma: Backport of the fix for the camergui: When a directory is created, a watch is put on it to spot new files but it can occur that the file is copied there before the watch is completely setup. That is why as an extra safeguard run scanlib over the folders we used when the cameragui is closed. CCBUG: 119201 M +5 -0 digikam/scanlib.cpp M +7 -0 digikam/scanlib.h M +20 -2 utilities/cameragui/cameraui.cpp M +1 -0 utilities/cameragui/cameraui.h --- branches/stable/extragear/graphics/digikam/digikam/scanlib.cpp #493647:493648 @@ -150,6 +150,11 @@ } } +void ScanLib::findMissingItems(const QString &path) +{ + allFiles(path); +} + void ScanLib::findMissingItems() { QString albumPath = AlbumManager::instance()->getLibraryPath(); --- branches/stable/extragear/graphics/digikam/digikam/scanlib.h #493647:493648 @@ -71,6 +71,13 @@ */ void findMissingItems(); + + /** + * This calls allFiles with a given path. + * @param path the path to scan. + */ + void findMissingItems(const QString &path); + /** * This queries the db for items that have no date * for each item found, storeItemInDatabase is called. --- branches/stable/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #493647:493648 @@ -46,6 +46,7 @@ #include <kiconloader.h> #include <kpopupmenu.h> #include <khelpmenu.h> +#include <kdebug.h> #include <kcalendarsystem.h> @@ -67,6 +68,7 @@ #include "cameraiconitem.h" #include "cameracontroller.h" #include "cameraui.h" +#include "scanlib.h" CameraUI::CameraUI(QWidget* parent, const QString& title, const QString& model, const QString& port, @@ -269,12 +271,26 @@ void CameraUI::closeEvent(QCloseEvent* e) { + // When a directory is created, a watch is put on it to spot new files + // but it can occur that the file is copied there before the watch is + // completely setup. That is why as an extra safeguard run scanlib + // over the folders we used. Bug: 119201 + ScanLib sLib; + for (QStringList::iterator it = m_foldersToScan.begin(); + it != m_foldersToScan.end(); ++it) + { + kdDebug() << "Scanning " << (*it) << endl; + sLib.findMissingItems( (*it) ); + } + + //--------------------------------------------------- + if(!m_lastDestURL.isEmpty()) emit signalLastDestination(m_lastDestURL); delete m_controller; saveSettings(); - e->accept(); + e->accept(); } @@ -469,10 +485,12 @@ } u.addPath(dirName); + m_foldersToScan.append(u.path()); u.addPath(downloadName.isEmpty() ? name : downloadName); } else { + m_foldersToScan.append(u.path()); u.addPath(downloadName.isEmpty() ? name : downloadName); } m_controller->download(folder, name, u.path(), autoRotate); @@ -482,7 +500,7 @@ if (total <= 0) return; - + m_lastDestURL = url; m_progress->setProgress(0); m_progress->setTotalSteps(total); --- branches/stable/extragear/graphics/digikam/utilities/cameragui/cameraui.h #493647:493648 @@ -97,6 +97,7 @@ CameraController* m_controller; KURL m_lastDestURL; + QStringList m_foldersToScan; private slots: |