Summary: | Album view not updated after images are modified in the image viewer | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Michał Kosmulski <michal> |
Component: | Albums-IconView | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Slackware | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Michał Kosmulski
2004-10-16 23:50:58 UTC
Additional note: this doesn't happen always - at this time I am unable to always reproduce it. Perhaps it was using some particular mix of keyboard shortcuts and choosing menu items with the mouse that triggered this behavior. CVS commit by jahrens: When the image viewer saved the modified file just before it was closed, the job result could never arrive the result function of the viewer. So signalFileModified was never emitted, and digikam not informed about the modification. CCMAIL: 91484-done@bugs.kde.org M +20 -1 digikam/syncjob.cpp 1.6 M +4 -0 digikam/syncjob.h 1.5 M +13 -20 utilities/imageeditor/imagewindow.cpp 1.43 M +0 -1 utilities/imageeditor/imagewindow.h 1.21 --- kdeextragear-3/digikam/digikam/syncjob.cpp #1.5:1.6 @@ -65,4 +65,10 @@ bool SyncJob::trash(const KURL::List& ur } +bool SyncJob::copy(const KURL &src, const KURL &dest) +{ + SyncJob sj; + return sj.copyPriv(src, dest); +} + QPixmap SyncJob::getTagThumbnail(const QString &name, int size) { @@ -107,4 +113,17 @@ bool SyncJob::trashPriv(const KURL::List } +bool SyncJob::copyPriv(const KURL &src, const KURL &dest) +{ + success_ = true; + + KIO::FileCopyJob* job = KIO::file_move(src, dest, -1, + true, false, false); + connect( job, SIGNAL(result( KIO::Job* )), + SLOT(slotResult( KIO::Job*)) ); + + enter_loop(); + return success_; +} + void qt_enter_modal( QWidget *widget ); void qt_leave_modal( QWidget *widget ); @@ -175,5 +194,5 @@ void SyncJob::slotLoadThumbnailFailed() } -void SyncJob::slotGotThumbnailFromIcon(const KURL& url, const QPixmap& pix, +void SyncJob::slotGotThumbnailFromIcon(const KURL&, const QPixmap& pix, const KFileMetaInfo*) { --- kdeextragear-3/digikam/digikam/syncjob.h #1.4:1.5 @@ -59,4 +59,6 @@ public: static bool trash(const KURL::List& urls); + static bool copy(const KURL &src, const KURL &dest); + /* Load the image or icon for the tag thumbnail */ static QPixmap getTagThumbnail(const QString &name, int size); @@ -73,4 +75,6 @@ private: bool trashPriv(const KURL::List& urls); + bool copyPriv(const KURL &src, const KURL &dest); + QPixmap getTagThumbnailPriv(const QString &name, int size); --- kdeextragear-3/digikam/utilities/imageeditor/imagewindow.cpp #1.42:1.43 @@ -716,22 +716,14 @@ void ImageWindow::slotSave() KExifUtils::writeOrientation(tmpFile, KExifData::NORMAL); - KIO::FileCopyJob* job = KIO::file_move(KURL(tmpFile), m_urlCurrent, - -1, true, false, false); - - connect(job, SIGNAL(result(KIO::Job *) ), - this, SLOT(slotSaveResult(KIO::Job *))); -} - -void ImageWindow::slotSaveResult(KIO::Job *job) -{ - if (job->error()) + if(!SyncJob::copy(KURL(tmpFile), m_urlCurrent)) { - job->showErrorDialog(this); - return; + QString errMsg(SyncJob::lastErrorMsg()); + KMessageBox::error(this, errMsg, errMsg); } - + else + { emit signalFileModified(m_urlCurrent); - QTimer::singleShot(0, this, SLOT(slotLoadCurrent())); + } } @@ -744,5 +736,6 @@ void ImageWindow::slotSaveAs() QStringList mimetypes; mimetypes << "image/jpeg" << "image/png" << "image/tiff" << "image/gif" - << "image/x-tga" << "image/x-bmp" << "image/x-xpm" << "image/x-portable-anymap"; + << "image/x-tga" << "image/x-bmp" << "image/x-xpm" + << "image/x-portable-anymap"; KFileDialog *imageFileSaveDialog = new KFileDialog(m_urlCurrent.directory(), --- kdeextragear-3/digikam/utilities/imageeditor/imagewindow.h #1.20:1.21 @@ -122,5 +122,4 @@ private slots: void slotSave(); - void slotSaveResult(KIO::Job *job); void slotSaveAs(); void slotSaveAsResult(KIO::Job *job); |