mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
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
This commit is contained in:
parent
fb0b2a777b
commit
5e22e4efba
|
@ -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 <hausmann@kde.org>
|
||||
// Copyright (C) 2006 David Faure <faure@kde.org>
|
||||
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"
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user