From 5e22e4efbae47541b5fb712de149ad4653500f83 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 25 Jan 2007 21:06:59 +0000 Subject: [PATCH] David's patches come in faster than light: removed code duplication, as a proper default implementation is now available in KonqUndoManager::UiInterface::copiedFileWasModified(). svn path=/trunk/playground/utils/dolphin/; revision=627164 --- src/dolphinmainwindow.cpp | 22 +--------------------- src/dolphinmainwindow.h | 5 +---- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 203a85b38..300d99d92 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1281,6 +1281,7 @@ void DolphinMainWindow::connectViewSignals(int viewIndex) } DolphinMainWindow::UndoUiInterface::UndoUiInterface(DolphinMainWindow* mainWin) : + KonqUndoManager::UiInterface(mainWin), m_mainWin(mainWin) { assert(m_mainWin != 0); @@ -1296,25 +1297,4 @@ void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job) statusBar->setMessage(job->errorString(), DolphinStatusBar::Error); } -bool DolphinMainWindow::UndoUiInterface::copiedFileWasModified(const KUrl& src, - const KUrl& dest, - time_t /*srcTime*/, - time_t destTime) -{ - // The following code has been taken from libkonq/konq_undo.cc - // Copyright (C) 2000 Simon Hausmann - // Copyright (C) 2006 David Faure - const QDateTime destDt = QDateTime::fromTime_t(destTime); - const QString timeStr = KGlobal::locale()->formatDateTime(destDt, true /* short */); - return KMessageBox::warningContinueCancel( - m_mainWin, - i18n( "The file %1 was copied from %2, but since then it has apparently been modified at %3.\n" - "Undoing the copy will delete the file, and all modifications will be lost.\n" - "Are you sure you want to delete %4?", dest.pathOrUrl(), src.pathOrUrl(), timeStr, dest.pathOrUrl()), - i18n( "Undo File Copy Confirmation" ), - KStandardGuiItem::cont(), - QString(), - KMessageBox::Notify | KMessageBox::Dangerous ) == KMessageBox::Continue; -} - #include "dolphinmainwindow.moc" diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index ac10a37b4..6052ec5ba 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -379,10 +379,7 @@ private: UndoUiInterface(DolphinMainWindow* mainWin); virtual ~UndoUiInterface(); virtual void jobError(KIO::Job* job); - virtual bool copiedFileWasModified(const KUrl& src, - const KUrl& dest, - time_t srcTime, - time_t destTime); + private: DolphinMainWindow* m_mainWin; }; -- 2.47.3