Commit 13bd0dad authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Archive now can't work as config dialog is a separate process now.

parent 0a424812
......@@ -49,17 +49,6 @@ ArchiveMailManager::~ArchiveMailManager()
qDeleteAll(mListArchiveInfo);
}
void ArchiveMailManager::slotArchiveNow(ArchiveMailInfo *info)
{
if (!info) {
return;
}
ArchiveMailInfo *stockInfo = new ArchiveMailInfo(*info);
mListArchiveInfo.append(stockInfo);
ScheduledArchiveTask *task = new ScheduledArchiveTask(this, stockInfo, Akonadi::Collection(stockInfo->saveCollectionId()), true /*immediat*/);
mArchiveMailKernel->jobScheduler()->registerTask(task);
}
void ArchiveMailManager::load()
{
qDeleteAll(mListArchiveInfo);
......@@ -209,6 +198,7 @@ void ArchiveMailManager::archiveFolder(const QString &path, Akonadi::Collection:
ArchiveMailInfo *info = new ArchiveMailInfo;
info->setSaveCollectionId(collectionId);
info->setUrl(QUrl::fromLocalFile(path));
slotArchiveNow(info);
delete info;
mListArchiveInfo.append(info);
ScheduledArchiveTask *task = new ScheduledArchiveTask(this, info, Akonadi::Collection(info->saveCollectionId()), true /*immediat*/);
mArchiveMailKernel->jobScheduler()->registerTask(task);
}
......@@ -53,7 +53,6 @@ public:
public Q_SLOTS:
void load();
void slotArchiveNow(ArchiveMailInfo *info);
Q_SIGNALS:
void needUpdateConfigDialogBox();
......
......@@ -118,8 +118,6 @@ void ArchiveMailWidget::slotCustomContextMenuRequested(const QPoint &)
if (!listItems.isEmpty()) {
if (listItems.count() == 1) {
menu.addAction(i18n("Open Containing Folder..."), this, &ArchiveMailWidget::slotOpenFolder);
menu.addSeparator();
menu.addAction(i18n("Archive now"), this, &ArchiveMailWidget::slotArchiveNow);
}
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete"), this, &ArchiveMailWidget::slotRemoveItem);
......@@ -311,23 +309,6 @@ void ArchiveMailWidget::slotOpenFolder()
}
}
void ArchiveMailWidget::slotArchiveNow()
{
const QList<QTreeWidgetItem *> listItems = mWidget.treeWidget->selectedItems();
if (listItems.count() == 1) {
QTreeWidgetItem *item = listItems.first();
if (!item) {
return;
}
ArchiveMailItem *archiveItem = static_cast<ArchiveMailItem *>(item);
ArchiveMailInfo *archiveItemInfo = archiveItem->info();
save();
if (archiveItemInfo) {
Q_EMIT archiveNow(archiveItemInfo);
}
}
}
void ArchiveMailWidget::slotItemChanged(QTreeWidgetItem *item, int col)
{
if (item) {
......
......@@ -61,8 +61,6 @@ public:
QSize restoreDialogSize() const override;
void saveDialogSize(const QSize &size) override;
Q_SIGNALS:
void archiveNow(ArchiveMailInfo *info);
private:
void createOrUpdateItem(ArchiveMailInfo *info, ArchiveMailItem *item = nullptr);
......@@ -75,7 +73,6 @@ private:
void updateButtons();
void slotOpenFolder();
void slotCustomContextMenuRequested(const QPoint &);
void slotArchiveNow();
void slotItemChanged(QTreeWidgetItem *item, int);
bool mChanged = false;
......
Supports Markdown
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