From kde-bugs-dist Sun Oct 17 12:17:09 2004 From: Joern Ahrens Date: Sun, 17 Oct 2004 12:17:09 +0000 To: kde-bugs-dist Subject: [Bug 91484] Album view not updated after images are modified in the Message-Id: <20041017121709.32635.qmail () ktown ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-bugs-dist&m=109801545129834 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. http://bugs.kde.org/show_bug.cgi?id=91484 kde jokele de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED ------- Additional Comments From kde jokele de 2004-10-17 14:17 ------- 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);