forked from qt-creator/qt-creator
Utils: Create re-usable Callable for copying and asking for overwrite
FileUtils::copyRecursively has the option to override the copy operation, and this is e.g. used for asking the user if files already exist, and to track what is actually copied. Make that functionality available for re-use. Change-Id: I16b7eddd32509b06866a1070e45ab58629f9a9be Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -162,6 +162,22 @@ private:
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT FileUtils {
|
||||
public:
|
||||
#ifdef QT_GUI_LIB
|
||||
class QTCREATOR_UTILS_EXPORT CopyAskingForOverwrite
|
||||
{
|
||||
public:
|
||||
CopyAskingForOverwrite(QWidget *dialogParent);
|
||||
bool operator()(const QFileInfo &src, const QFileInfo &dest, QString *error);
|
||||
QStringList files() const;
|
||||
|
||||
private:
|
||||
QWidget *m_parent;
|
||||
QStringList m_files;
|
||||
bool m_overwriteAll = false;
|
||||
bool m_skipAll = false;
|
||||
};
|
||||
#endif // QT_GUI_LIB
|
||||
|
||||
static bool removeRecursively(const FilePath &filePath, QString *error = nullptr);
|
||||
static bool copyRecursively(
|
||||
const FilePath &srcFilePath, const FilePath &tgtFilePath, QString *error = nullptr,
|
||||
|
||||
Reference in New Issue
Block a user