Implement reverting of changed preset tools.

This commit is contained in:
con
2011-02-01 15:55:40 +01:00
parent b21ca68c3c
commit 8cb7e30a15
6 changed files with 225 additions and 49 deletions

View File

@@ -41,6 +41,7 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QProcess>
#include <QtCore/QSharedPointer>
#include <QtCore/QTextCodec>
namespace Core {
@@ -76,18 +77,19 @@ public:
QString workingDirectory() const;
void setFileName(const QString &fileName);
void setPresetFileName(const QString &fileName);
void setPreset(QSharedPointer<ExternalTool> preset);
QString fileName() const;
QString presetFileName() const;
// all tools that are preset (changed or unchanged) have the original value here:
QSharedPointer<ExternalTool> preset() const;
static ExternalTool *createFromXml(const QByteArray &xml, QString *errorMessage = 0, const QString &locale = QString());
static ExternalTool *createFromFile(const QString &fileName, QString *errorMessage = 0,
const QString &locale = QString(), bool isPreset = false);
const QString &locale = QString());
bool save(QString *errorMessage = 0) const;
// ignores changed state
bool operator==(const ExternalTool &other);
bool operator!=(const ExternalTool &other) { return !((*this) == other); }
// display category and order are handled specially
void setDisplayName(const QString &name);
@@ -116,8 +118,7 @@ private:
QString m_fileName;
QString m_presetFileName;
mutable bool m_isChanged;
QSharedPointer<ExternalTool> m_presetTool;
};
class ExternalToolRunner : public QObject