will switch to KonqUndoManager anyway. The difficulty is we would
need one UndoManager for DolphinMainWindow which we won't do/have with
KonqUndoManager so I avoid wasting my time cleaning up this bit, so
progress information might be a bit wrong in regards to the amount of
total steps...
svn path=/trunk/playground/utils/dolphin/; revision=608947
int macroCount = 1;
calcStepsCount(macroCount, progressCount);
int macroCount = 1;
calcStepsCount(macroCount, progressCount);
- m_progressIndicator = new ProgressIndicator(0, i18n("Executing undo operation..."),
- i18n("Executed undo operation."),
- progressCount);
for (int i = 0; i < macroCount; ++i) {
const DolphinCommand command = m_history[m_historyIndex];
for (int i = 0; i < macroCount; ++i) {
const DolphinCommand command = m_history[m_historyIndex];
+
+ /*
+ * KDE4, ### TODO Only here to avoid possible crash
+ */
+ ProgressIndicator progressIndicator(command.mainWindow(), i18n("Executing undo operation..."),
+ i18n("Executed undo operation."),
+ progressCount);
--m_historyIndex;
if (m_historyIndex < 0) {
emit undoAvailable(false);
--m_historyIndex;
if (m_historyIndex < 0) {
emit undoAvailable(false);
KIO::NetAccess::move(*it, newDestUrl);
++it;
KIO::NetAccess::move(*it, newDestUrl);
++it;
- m_progressIndicator->execOperation();
+ progressIndicator.execOperation();
KIO::NetAccess::synchronousRun(job, command.mainWindow() );
}
KIO::NetAccess::synchronousRun(job, command.mainWindow() );
}
- m_progressIndicator->execOperation();
+ progressIndicator.execOperation();
-
- delete m_progressIndicator;
- m_progressIndicator = 0;
}
void UndoManager::redo()
}
void UndoManager::redo()
int macroCount = 1;
calcStepsCount(macroCount, progressCount);
int macroCount = 1;
calcStepsCount(macroCount, progressCount);
-#warning "TOUGH"
- m_progressIndicator = new ProgressIndicator(0, i18n("Executing redo operation..."),
- i18n("Executed redo operation."),
- progressCount);
for (int i = 0; i < macroCount; ++i) {
const DolphinCommand command = m_history[m_historyIndex];
for (int i = 0; i < macroCount; ++i) {
const DolphinCommand command = m_history[m_historyIndex];
+#warning "TOUGH"
+ ProgressIndicator progressIndicator(0, i18n("Executing redo operation..."),
+ i18n("Executed redo operation."),
+ progressCount);
if (m_historyIndex >= maxHistoryIndex) {
emit redoAvailable(false);
emit redoTextChanged(i18n("Redo"));
if (m_historyIndex >= maxHistoryIndex) {
emit redoAvailable(false);
emit redoTextChanged(i18n("Redo"));
KIO::NetAccess::synchronousRun(moveToTrashJob, command.mainWindow() );
++it;
KIO::NetAccess::synchronousRun(moveToTrashJob, command.mainWindow() );
++it;
- m_progressIndicator->execOperation();
+ progressIndicator.execOperation();
}
case DolphinCommand::CreateFile: {
}
case DolphinCommand::CreateFile: {
- m_progressIndicator->execOperation();
+ progressIndicator.execOperation();
KUrl::List::Iterator it = sourceUrls.begin();
assert(sourceUrls.count() == 1);
KIO::CopyJob* copyJob = KIO::copyAs(*it, command.destination(), false);
KUrl::List::Iterator it = sourceUrls.begin();
assert(sourceUrls.count() == 1);
KIO::CopyJob* copyJob = KIO::copyAs(*it, command.destination(), false);
- m_progressIndicator->execOperation();
+ progressIndicator.execOperation();
- delete m_progressIndicator;
- m_progressIndicator = 0;
}
UndoManager::UndoManager() :
m_recordMacro(false),
m_historyIndex(-1),
}
UndoManager::UndoManager() :
m_recordMacro(false),
m_historyIndex(-1),
- m_macroCounter(0),
- m_progressIndicator(0)
{
}
UndoManager::~UndoManager()
{
{
}
UndoManager::~UndoManager()
{
- delete m_progressIndicator;
- m_progressIndicator = 0;
}
QString UndoManager::commandText(const DolphinCommand& command) const
}
QString UndoManager::commandText(const DolphinCommand& command) const
void UndoManager::updateProgress()
{
void UndoManager::updateProgress()
{
- m_progressIndicator->execOperation();
+ /*
+ * ### XXX, TODO, KDE4 make this work when switchting to KonqUndoManager
+ */
+ //m_progressIndicator->execOperation();
}
void UndoManager::calcStepsCount(int& macroCount, int& progressCount)
}
void UndoManager::calcStepsCount(int& macroCount, int& progressCount)
#include <kurl.h>
#include <kio/jobclasses.h>
#include <kurl.h>
#include <kio/jobclasses.h>
-class ProgressIndicator;
class DolphinMainWindow;
/**
class DolphinMainWindow;
/**
int m_historyIndex;
int m_macroCounter;
Q3ValueList<DolphinCommand> m_history;
int m_historyIndex;
int m_macroCounter;
Q3ValueList<DolphinCommand> m_history;
- ProgressIndicator* m_progressIndicator;
/**
* Dependent from the current history index \a m_historyIndex
/**
* Dependent from the current history index \a m_historyIndex