KIO
fileundomanager.cpp
Go to the documentation of this file.
44 static const char* const s_undoStateToString[] = { "MAKINGDIRS", "MOVINGFILES", "STATINGFILE", "REMOVINGDIRS", "REMOVINGLINKS" };
129 CommandRecorder::CommandRecorder(FileUndoManager::CommandType op, const KUrl::List &src, const KUrl &dst, KIO::Job *job)
161 void CommandRecorder::slotCopyingDone(KIO::Job *job, const KUrl &from, const KUrl &to, time_t mtime, bool directory, bool renamed)
186 void CommandRecorder::slotCopyingLinkDone(KIO::Job *, const KUrl &from, const QString &target, const KUrl &to)
247 void FileUndoManager::recordJob(CommandType op, const KUrl::List &src, const KUrl &dst, KIO::Job *job)
348 if (d->m_current.m_type == FileUndoManager::Mkdir || d->m_current.m_type == FileUndoManager::Put) {
770 bool FileUndoManager::UiInterface::copiedFileWasModified(const KUrl& src, const KUrl& dest, const KDateTime& srcTime, const KDateTime& destTime)
779 "Are you sure you want to delete %4?", dest.pathOrUrl(), src.pathOrUrl(), timeStr, dest.pathOrUrl()),
792 return uiDelegate.askDeleteConfirmation(files, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::ForceConfirmation);
virtual void setWindow(QWidget *window)
Associate this job with a window given by window.
Definition: jobuidelegate.cpp:58
void pushCommand(const UndoCommand &cmd)
Definition: fileundomanager.cpp:626
KGuiItem cancel()
Definition: copyjob.h:73
void setUiInterface(UiInterface *ui)
Set a new UiInterface implementation.
Definition: fileundomanager.cpp:732
QString i18n(const char *text)
bool kill(KillVerbosity verbosity=Quietly)
FileUndoManager: makes it possible to undo kio jobs.
Definition: fileundomanager.h:44
When set, automatically overwrite the destination if it exists already.
Definition: jobclasses.h:67
#define kapp
Definition: jobuidelegate.h:109
QString directory(const DirectoryOptions &options=IgnoreTrailingSlash) const
void stepMakingDirectories()
Definition: fileundomanager.cpp:484
QList< KUrl > m_dirsToUpdate
Definition: fileundomanager_p.h:151
virtual ~UiInterface()
Definition: fileundomanager.cpp:760
void emitResult()
Definition: fileundomanager_p.h:97
Definition: fileundomanager_p.h:97
quint64 m_nextCommandIndex
Definition: fileundomanager_p.h:155
bool initializeFromKDesky()
Definition: fileundomanager.cpp:707
virtual bool copiedFileWasModified(const KUrl &src, const KUrl &dest, const KDateTime &srcTime, const KDateTime &destTime)
Called when dest was modified since it was copied from src.
Definition: fileundomanager.cpp:770
#define K_GLOBAL_STATIC(TYPE, NAME)
virtual void virtual_hook(int id, void *data)
Definition: fileundomanager.cpp:815
void undoTextChanged(const QString &text)
Emitted when the value of undoText() changes.
SimpleJob * mkdir(const KUrl &url, int permissions=-1)
Creates a single directory.
Definition: job.cpp:697
void jobRecordingFinished(CommandType op)
Emitted when a job that has been recorded by FileUndoManager::recordJob() or FileUndoManager::recordC...
void stepMovingFiles()
Definition: fileundomanager.cpp:499
StatJob * stat(const KUrl &url, JobFlags flags=DefaultFlags)
Find all details for one file or directory.
Definition: job.cpp:924
SimpleJob * file_delete(const KUrl &src, JobFlags flags=DefaultFlags)
Delete a single file.
Definition: job.cpp:2503
Definition: fileundomanager.h:135
A KIO job that retrieves information about a file or directory.
Definition: jobclasses.h:440
Definition: fileundomanager_p.h:55
FileCopyJob * file_move(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
Move a single file.
Definition: job.cpp:2495
QDataStream & operator<<(QDataStream &s, const AuthInfo &a)
Definition: authinfo.cpp:209
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QStack< KUrl > m_dirCleanupStack
Definition: fileundomanager_p.h:149
bool askDeleteConfirmation(const KUrl::List &urls, DeletionType deletionType, ConfirmationType confirmationType)
Ask for confirmation before deleting/trashing urls.
Definition: jobuidelegate.cpp:108
static void emitFilesAdded(const QString &directory)
Definition: kdirnotify.cpp:47
virtual void showErrorMessage()
QString i18nc(const char *ctxt, const char *text)
void setPath(const QString &path)
Definition: copyjob.h:73
QStack< KUrl > m_fileCleanupStack
Definition: fileundomanager_p.h:150
void setTime_t(qint64 seconds)
FileUndoManagerPrivate(FileUndoManager *qq)
Definition: fileundomanager.cpp:218
void jobRecordingStarted(CommandType op)
Emitted when a job recording has been started by FileUndoManager::recordJob() or FileUndoManager::rec...
bool showProgressInfo() const
Definition: fileundomanager.cpp:810
void description(KJob *job, const QString &title, const QPair< QString, QString > &field1=qMakePair(QString(), QString()), const QPair< QString, QString > &field2=qMakePair(QString(), QString()))
void addCommand(const UndoCommand &cmd)
called by UndoCommandRecorder
Definition: fileundomanager.cpp:272
void undoJobFinished()
Emitted when an undo job finishes. Used for unit testing.
FileUndoManager::UiInterface * m_uiInterface
Definition: fileundomanager_p.h:152
virtual bool confirmDeletion(const KUrl::List &files)
Called when we are about to remove those files.
Definition: fileundomanager.cpp:787
CommandRecorder(FileUndoManager::CommandType op, const KUrl::List &src, const KUrl &dst, KIO::Job *job)
Definition: fileundomanager.cpp:129
long long numberValue(uint field, long long defaultValue=0) const
Definition: udsentry.cpp:78
SimpleJob * rename(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
Rename a file or directory.
Definition: job.cpp:731
QString protocol() const
Definition: fileundomanager_p.h:36
void addDirToUpdate(const KUrl &url)
Definition: fileundomanager.cpp:454
QString pathOrUrl() const
void undo()
Undoes the last command Remember to call uiInterface()->setParentWidget(parentWidget) first...
Definition: fileundomanager.cpp:325
void setParentWidget(QWidget *parentWidget)
Sets the parent widget to use for message boxes.
Definition: fileundomanager.cpp:800
Definition: fileundomanager_p.h:97
QString path(AdjustPathOption trailing=LeaveTrailingSlash) const
UiInterface * uiInterface() const
Definition: fileundomanager.cpp:738
Definition: copyjob.h:73
Definition: fileundomanager.h:135
SimpleJob * symlink(const QString &target, const KUrl &dest, JobFlags flags=DefaultFlags)
Create or move a symlink.
Definition: job.cpp:738
Definition: fileundomanager.h:135
QWidget * parentWidget() const
Definition: fileundomanager.cpp:795
QString formatDateTime(const QDateTime &dateTime, DateFormat format=ShortDate, bool includeSecs=false) const
static ClipboardUpdater * create(Job *job, Mode mode)
Returns an instance of clipboard updater if QApplication::type() does not return a tty...
Definition: clipboardupdater.cpp:162
KLocale * locale()
void stepRemovingDirectories()
Definition: fileundomanager.cpp:587
friend class FileUndoManagerPrivate
Definition: fileundomanager.h:213
void stepRemovingLinks()
Definition: fileundomanager.cpp:564
Definition: fileundomanager_p.h:97
KDateTime toLocalZone() const
QString dir(const QString &fileClass)
Returns the most recently used directory accociated with this file-class.
Definition: krecentdirs.cpp:68
quint64 newCommandSerialNumber()
These two functions are useful when wrapping FileUndoManager and adding custom commands.
Definition: fileundomanager.cpp:309
Definition: fileundomanager.h:135
void broadcastPush(const UndoCommand &cmd)
Definition: fileundomanager.cpp:662
Definition: fileundomanager_p.h:97
void setShowProgressInfo(bool b)
Sets whether to show progress info when running the KIO jobs for undoing.
Definition: fileundomanager.cpp:805
quint64 currentCommandSerialNumber() const
Definition: fileundomanager.cpp:314
virtual void jobError(KIO::Job *job)
Called when an undo job errors; default implementation displays a message box.
Definition: fileundomanager.cpp:765
Definition: fileundomanager.h:135
Definition: fileundomanager_p.h:46
KGuiItem cont()
Definition: fileundomanager.h:135
virtual void registerJob(KJob *job)
static const char * undoStateToString(UndoState state)
Definition: fileundomanager.cpp:43
CopyMode operationMode() const
Returns the mode of the operation (copy, move, or link), depending on whether KIO::copy(), KIO::move() or KIO::link() was called.
Definition: copyjob.cpp:2140
Interface for the gui handling of FileUndoManager.
Definition: fileundomanager.h:63
static int warningContinueCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
QString prettyUrl(AdjustPathOption trailing=LeaveTrailingSlash) const
void recordCopyJob(KIO::CopyJob *copyJob)
Record this CopyJob while it's happening and add a command for it so that the user can undo it...
Definition: fileundomanager.cpp:254
void broadcastUnlock()
Definition: fileundomanager.cpp:696
Definition: fileundomanager_p.h:46
CopyJob is used to move, copy or symlink files and directories.
Definition: copyjob.h:65
void recordJob(CommandType op, const KUrl::List &src, const KUrl &dst, KIO::Job *job)
Record this job while it's happening and add a command for it so that the user can undo it...
Definition: fileundomanager.cpp:247
UndoCommand::Stack m_commands
Definition: fileundomanager_p.h:143
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.