| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2018-2018 CSSlayer <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 |
* |
| 6 |
*/ |
| 7 |
#ifndef _PINYINDICTMANAGER_RENAMEFILE_H_ |
| 8 |
#define _PINYINDICTMANAGER_RENAMEFILE_H_ |
| 9 |
|
| 10 |
#include "pipelinejob.h" |
| 11 |
#include <QFutureWatcher> |
| 12 |
#include <QMessageBox> |
| 13 |
#include <QObject> |
| 14 |
#include <QProcess> |
| 15 |
#include <QTemporaryFile> |
| 16 |
#include <QtConcurrent> |
| 17 |
|
| 18 |
namespace fcitx { |
| 19 |
|
| 20 |
class RenameFile : public PipelineJob { |
| 21 |
Q_OBJECT |
| 22 |
public: |
| 23 |
explicit RenameFile(const QString &from, const QString &to, |
| 24 |
QObject *parent = nullptr); |
| 25 |
void start() override; |
| 26 |
void abort() override; |
| 27 |
void cleanUp() override; |
| 28 |
|
| 29 |
private Q_SLOTS: |
| 30 |
void emitFinished(bool result); |
| 31 |
|
| 32 |
private: |
| 33 |
QString from_, to_; |
| 34 |
}; |
| 35 |
|
| 36 |
} // namespace fcitx |
| 37 |
|
| 38 |
#endif // _PINYINDICTMANAGER_RENAMEFILE_H_ |