Commit 493bc626 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add HistorySwitchFolderCommand

parent 55a807f7
Pipeline #86964 passed with stage
in 23 minutes and 50 seconds
......@@ -18,9 +18,9 @@ HistorySwitchFolderManager::~HistorySwitchFolderManager()
{
}
void HistorySwitchFolderManager::addHistory()
void HistorySwitchFolderManager::addHistory(const Akonadi::Collection &currentCol, const Akonadi::Collection &col)
{
// TODO mUndoStack->push(new QUndoCommand(this));
mUndoStack->push(new HistorySwitchFolderCommand(currentCol, col));
}
void HistorySwitchFolderManager::clear()
......@@ -28,7 +28,16 @@ void HistorySwitchFolderManager::clear()
mUndoStack->clear();
}
void HistorySwitchFolderManager::addCollection(const Akonadi::Collection &col)
HistorySwitchFolderCommand::HistorySwitchFolderCommand(const Akonadi::Collection &currentCol, const Akonadi::Collection &col)
: mCurrentCollection(currentCol)
, mNewCollection(col)
{
}
void HistorySwitchFolderCommand::undo()
{
}
void HistorySwitchFolderCommand::redo()
{
// TODO
}
......@@ -5,12 +5,24 @@
*/
#pragma once
#include <Akonadi/Collection>
#include <QObject>
#include <QUndoStack>
class QUndoStack;
namespace Akonadi
class HistorySwitchFolderCommand : public QUndoCommand
{
class Collection;
}
public:
explicit HistorySwitchFolderCommand(const Akonadi::Collection &currentCol, const Akonadi::Collection &col);
void undo() override;
void redo() override;
private:
const Akonadi::Collection mCurrentCollection;
const Akonadi::Collection mNewCollection;
};
class HistorySwitchFolderManager : public QObject
{
Q_OBJECT
......@@ -19,9 +31,8 @@ public:
~HistorySwitchFolderManager() override;
// Add static method
void clear();
void addHistory();
void addHistory(const Akonadi::Collection &currentCol, const Akonadi::Collection &col);
void addCollection(const Akonadi::Collection &col);
Q_SIGNALS:
void switchToFolder(const Akonadi::Collection &col);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment