Commit 45c9cf7a authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

add/unify i/o error handling

lots of use of Utils::FileSaver and Utils::FileReader

Task-number: QTCREATORBUG-1619
parent fae7dc95
...@@ -489,10 +489,9 @@ bool PluginSpecPrivate::read(const QString &fileName) ...@@ -489,10 +489,9 @@ bool PluginSpecPrivate::read(const QString &fileName)
errorString = ""; errorString = "";
dependencies.clear(); dependencies.clear();
QFile file(fileName); QFile file(fileName);
if (!file.exists())
return reportError(tr("File does not exist: %1").arg(file.fileName()));
if (!file.open(QIODevice::ReadOnly)) if (!file.open(QIODevice::ReadOnly))
return reportError(tr("Could not open file for read: %1").arg(file.fileName())); return reportError(tr("Could not open file %1 for read: %2")
.arg(QDir::toNativeSeparators(file.fileName()), file.errorString()));
QFileInfo fileInfo(file); QFileInfo fileInfo(file);
location = fileInfo.absolutePath(); location = fileInfo.absolutePath();
filePath = fileInfo.absoluteFilePath(); filePath = fileInfo.absoluteFilePath();
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "sshkeyexchange_p.h" #include "sshkeyexchange_p.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/fileutils.h>
#include <botan/exceptn.h> #include <botan/exceptn.h>
#include <botan/init.h> #include <botan/init.h>
...@@ -410,18 +411,12 @@ void SshConnectionPrivate::handleServiceAcceptPacket() ...@@ -410,18 +411,12 @@ void SshConnectionPrivate::handleServiceAcceptPacket()
m_sendFacility.sendUserAuthByPwdRequestPacket(m_connParams.userName.toUtf8(), m_sendFacility.sendUserAuthByPwdRequestPacket(m_connParams.userName.toUtf8(),
SshCapabilities::SshConnectionService, m_connParams.password.toUtf8()); SshCapabilities::SshConnectionService, m_connParams.password.toUtf8());
} else { } else {
QFile privKeyFile(m_connParams.privateKeyFile); Utils::FileReader reader;
bool couldOpen = privKeyFile.open(QIODevice::ReadOnly); if (!reader.fetch(m_connParams.privateKeyFile))
QByteArray contents;
if (couldOpen)
contents = privKeyFile.readAll();
if (!couldOpen || privKeyFile.error() != QFile::NoError) {
throw SshClientException(SshKeyFileError, throw SshClientException(SshKeyFileError,
tr("Could not read private key file: %1") tr("Private key error: %1").arg(reader.errorString()));
.arg(privKeyFile.errorString()));
}
m_sendFacility.createAuthenticationKey(contents); m_sendFacility.createAuthenticationKey(reader.data());
m_sendFacility.sendUserAuthByKeyRequestPacket(m_connParams.userName.toUtf8(), m_sendFacility.sendUserAuthByKeyRequestPacket(m_connParams.userName.toUtf8(),
SshCapabilities::SshConnectionService); SshCapabilities::SshConnectionService);
} }
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/fileutils.h>
#include <QtCore/QFile> #include <QtCore/QFile>
#include <QtCore/QXmlStreamAttributes> #include <QtCore/QXmlStreamAttributes>
#include <QtCore/QXmlStreamWriter> #include <QtCore/QXmlStreamWriter>
...@@ -134,37 +136,37 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items) ...@@ -134,37 +136,37 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
{ {
const UniqueIDManager *idmanager = UniqueIDManager::instance(); const UniqueIDManager *idmanager = UniqueIDManager::instance();
QFile file(m_filename); Utils::FileSaver saver(m_filename, QIODevice::Text);
if (!file.open(QIODevice::WriteOnly|QIODevice::Text)) if (!saver.hasError()) {
return false; const Context ctx;
QXmlStreamWriter w(saver.file());
const Context ctx; w.setAutoFormatting(true);
QXmlStreamWriter w(&file); w.setAutoFormattingIndent(1); // Historical, used to be QDom.
w.setAutoFormatting(true); w.writeStartDocument();
w.setAutoFormattingIndent(1); // Historical, used to be QDom. w.writeDTD(QLatin1String("<!DOCTYPE KeyboardMappingScheme>"));
w.writeStartDocument(); w.writeComment(QString::fromAscii(" Written by Qt Creator %1, %2. ").
w.writeDTD(QLatin1String("<!DOCTYPE KeyboardMappingScheme>")); arg(QLatin1String(Core::Constants::IDE_VERSION_LONG),
w.writeComment(QString::fromAscii(" Written by Qt Creator %1, %2. "). QDateTime::currentDateTime().toString(Qt::ISODate)));
arg(QLatin1String(Core::Constants::IDE_VERSION_LONG), w.writeStartElement(ctx.mappingElement);
QDateTime::currentDateTime().toString(Qt::ISODate))); foreach (const ShortcutItem *item, items) {
w.writeStartElement(ctx.mappingElement); const QString id = idmanager->stringForUniqueIdentifier(item->m_cmd->id());
foreach (const ShortcutItem *item, items) { if (item->m_key.isEmpty()) {
const QString id = idmanager->stringForUniqueIdentifier(item->m_cmd->id()); w.writeEmptyElement(ctx.shortCutElement);
if (item->m_key.isEmpty()) { w.writeAttribute(ctx.idAttribute, id);
w.writeEmptyElement(ctx.shortCutElement); } else {
w.writeAttribute(ctx.idAttribute, id); w.writeStartElement(ctx.shortCutElement);
} else { w.writeAttribute(ctx.idAttribute, id);
w.writeStartElement(ctx.shortCutElement); w.writeEmptyElement(ctx.keyElement);
w.writeAttribute(ctx.idAttribute, id); w.writeAttribute(ctx.valueAttribute, item->m_key.toString());
w.writeEmptyElement(ctx.keyElement); w.writeEndElement(); // Shortcut
w.writeAttribute(ctx.valueAttribute, item->m_key.toString()); }
w.writeEndElement(); // Shortcut
} }
w.writeEndElement();
w.writeEndDocument();
saver.setResult(&w);
} }
w.writeEndElement(); return saver.finalize();
w.writeEndDocument();
file.close();
return true;
} }
} // namespace Internal } // namespace Internal
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <utils/filewizarddialog.h> #include <utils/filewizarddialog.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/stringutils.h> #include <utils/stringutils.h>
#include <utils/fileutils.h>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QFile> #include <QtCore/QFile>
...@@ -179,23 +180,15 @@ bool GeneratedFile::write(QString *errorMessage) const ...@@ -179,23 +180,15 @@ bool GeneratedFile::write(QString *errorMessage) const
return false; return false;
} }
} }
// Write out
QFile file(m_d->path);
// Write out
QIODevice::OpenMode flags = QIODevice::WriteOnly|QIODevice::Truncate; QIODevice::OpenMode flags = QIODevice::WriteOnly|QIODevice::Truncate;
if (!isBinary()) if (!isBinary())
flags |= QIODevice::Text; flags |= QIODevice::Text;
if (!file.open(flags)) { Utils::FileSaver saver(m_d->path, flags);
*errorMessage = BaseFileWizard::tr("Unable to open %1 for writing: %2").arg(m_d->path, file.errorString()); saver.write(m_d->contents);
return false; return saver.finalize(errorMessage);
}
if (file.write(m_d->contents) == -1) {
*errorMessage = BaseFileWizard::tr("Error while writing to %1: %2").arg(m_d->path, file.errorString());
return false;
}
file.close();
return true;
} }
GeneratedFile::Attributes GeneratedFile::attributes() const GeneratedFile::Attributes GeneratedFile::attributes() const
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/stringutils.h> #include <utils/stringutils.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/fileutils.h>
#include <QtCore/QXmlStreamReader> #include <QtCore/QXmlStreamReader>
#include <QtCore/QXmlStreamWriter> #include <QtCore/QXmlStreamWriter>
...@@ -432,21 +433,15 @@ ExternalTool * ExternalTool::createFromXml(const QByteArray &xml, QString *error ...@@ -432,21 +433,15 @@ ExternalTool * ExternalTool::createFromXml(const QByteArray &xml, QString *error
ExternalTool * ExternalTool::createFromFile(const QString &fileName, QString *errorMessage, const QString &locale) ExternalTool * ExternalTool::createFromFile(const QString &fileName, QString *errorMessage, const QString &locale)
{ {
QFileInfo info(fileName); QString absFileName = QFileInfo(fileName).absoluteFilePath();
QFile file(info.absoluteFilePath()); Utils::FileReader reader;
if (!file.open(QIODevice::ReadOnly)) { if (!reader.fetch(absFileName, errorMessage))
if (errorMessage)
*errorMessage = tr("Could not open tool specification %1 for reading: %2").
arg(fileName, file.errorString());
return 0; return 0;
} ExternalTool *tool = ExternalTool::createFromXml(reader.data(), errorMessage, locale);
const QByteArray &bytes = file.readAll();
file.close();
ExternalTool *tool = ExternalTool::createFromXml(bytes, errorMessage, locale);
if (!tool) { if (!tool) {
return 0; return 0;
} }
tool->m_fileName = file.fileName(); tool->m_fileName = absFileName;
return tool; return tool;
} }
...@@ -467,43 +462,40 @@ bool ExternalTool::save(QString *errorMessage) const ...@@ -467,43 +462,40 @@ bool ExternalTool::save(QString *errorMessage) const
{ {
if (m_fileName.isEmpty()) if (m_fileName.isEmpty())
return false; return false;
QFile file(m_fileName); Utils::FileSaver saver(m_fileName);
if (!file.open(QIODevice::WriteOnly)) { if (!saver.hasError()) {
if (errorMessage) QXmlStreamWriter out(saver.file());
*errorMessage = tr("Could not write tool specification %1: %2"). out.setAutoFormatting(true);
arg(m_fileName, file.errorString()); out.writeStartDocument(QLatin1String("1.0"));
return false; out.writeComment(QString::fromLatin1("Written on %1 by Qt Creator %2")
.arg(QDateTime::currentDateTime().toString(), QLatin1String(Constants::IDE_VERSION_LONG)));
out.writeStartElement(QLatin1String(kExternalTool));
out.writeAttribute(QLatin1String(kId), m_id);
out.writeTextElement(QLatin1String(kDescription), m_description);
out.writeTextElement(QLatin1String(kDisplayName), m_displayName);
out.writeTextElement(QLatin1String(kCategory), m_displayCategory);
if (m_order != -1)
out.writeTextElement(QLatin1String(kOrder), QString::number(m_order));
out.writeStartElement(QLatin1String(kExecutable));
out.writeAttribute(QLatin1String(kOutput), stringForOutputHandling(m_outputHandling));
out.writeAttribute(QLatin1String(kError), stringForOutputHandling(m_errorHandling));
out.writeAttribute(QLatin1String(kModifiesDocument), m_modifiesCurrentDocument ? QLatin1String(kYes) : QLatin1String(kNo));
foreach (const QString &executable, m_executables)
out.writeTextElement(QLatin1String(kPath), executable);
if (!m_arguments.isEmpty())
out.writeTextElement(QLatin1String(kArguments), m_arguments);
if (!m_input.isEmpty())
out.writeTextElement(QLatin1String(kInput), m_input);
if (!m_workingDirectory.isEmpty())
out.writeTextElement(QLatin1String(kWorkingDirectory), m_workingDirectory);
out.writeEndElement();
out.writeEndDocument();
saver.setResult(&out);
} }
QXmlStreamWriter out(&file); return saver.finalize(errorMessage);
out.setAutoFormatting(true);
out.writeStartDocument(QLatin1String("1.0"));
out.writeComment(QString::fromLatin1("Written on %1 by Qt Creator %2")
.arg(QDateTime::currentDateTime().toString(), QLatin1String(Constants::IDE_VERSION_LONG)));
out.writeStartElement(QLatin1String(kExternalTool));
out.writeAttribute(QLatin1String(kId), m_id);
out.writeTextElement(QLatin1String(kDescription), m_description);
out.writeTextElement(QLatin1String(kDisplayName), m_displayName);
out.writeTextElement(QLatin1String(kCategory), m_displayCategory);
if (m_order != -1)
out.writeTextElement(QLatin1String(kOrder), QString::number(m_order));
out.writeStartElement(QLatin1String(kExecutable));
out.writeAttribute(QLatin1String(kOutput), stringForOutputHandling(m_outputHandling));
out.writeAttribute(QLatin1String(kError), stringForOutputHandling(m_errorHandling));
out.writeAttribute(QLatin1String(kModifiesDocument), m_modifiesCurrentDocument ? QLatin1String(kYes) : QLatin1String(kNo));
foreach (const QString &executable, m_executables)
out.writeTextElement(QLatin1String(kPath), executable);
if (!m_arguments.isEmpty())
out.writeTextElement(QLatin1String(kArguments), m_arguments);
if (!m_input.isEmpty())
out.writeTextElement(QLatin1String(kInput), m_input);
if (!m_workingDirectory.isEmpty())
out.writeTextElement(QLatin1String(kWorkingDirectory), m_workingDirectory);
out.writeEndElement();
out.writeEndDocument();
file.close();
return true;
} }
bool ExternalTool::operator==(const ExternalTool &other) const bool ExternalTool::operator==(const ExternalTool &other) const
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h> #include <coreplugin/messagemanager.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/fileutils.h>
#include <texteditor/basetexteditor.h> #include <texteditor/basetexteditor.h>
#include <QtCore/QtPlugin> #include <QtCore/QtPlugin>
...@@ -277,23 +278,6 @@ static inline QString tempFilePattern(const QString &prefix, const QString &exte ...@@ -277,23 +278,6 @@ static inline QString tempFilePattern(const QString &prefix, const QString &exte
return pattern; return pattern;
} }
typedef QSharedPointer<QTemporaryFile> TemporaryFilePtr;
// Write an a temporary file.
TemporaryFilePtr writeTemporaryFile(const QString &namePattern,
const QString &contents,
QString *errorMessage)
{
TemporaryFilePtr tempFile(new QTemporaryFile(namePattern));
if (!tempFile->open()) {
*errorMessage = QString::fromLatin1("Unable to open temporary file %1").arg(tempFile->errorString());
return TemporaryFilePtr();
}
tempFile->write(contents.toUtf8());
tempFile->close();
return tempFile;
}
void CodepasterPlugin::finishFetch(const QString &titleDescription, void CodepasterPlugin::finishFetch(const QString &titleDescription,
const QString &content, const QString &content,
bool error) bool error)
...@@ -313,23 +297,21 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription, ...@@ -313,23 +297,21 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription,
// for the user and also to be able to tell a patch or diff in the VCS plugins // for the user and also to be able to tell a patch or diff in the VCS plugins
// by looking at the file name of FileManager::currentFile() without expensive checking. // by looking at the file name of FileManager::currentFile() without expensive checking.
// Default to "txt". // Default to "txt".
QByteArray byteContent = content.toUtf8();
QString suffix; QString suffix;
if (const Core::MimeType mimeType = Core::ICore::instance()->mimeDatabase()->findByData(content.toUtf8())) if (const Core::MimeType mimeType = Core::ICore::instance()->mimeDatabase()->findByData(byteContent))
suffix = mimeType.preferredSuffix(); suffix = mimeType.preferredSuffix();
if (suffix.isEmpty()) if (suffix.isEmpty())
suffix = QLatin1String("txt"); suffix = QLatin1String("txt");
const QString filePrefix = filePrefixFromTitle(titleDescription); const QString filePrefix = filePrefixFromTitle(titleDescription);
QString errorMessage; Utils::TempFileSaver saver(tempFilePattern(filePrefix, suffix));
TemporaryFilePtr tempFile = writeTemporaryFile(tempFilePattern(filePrefix, suffix), content, &errorMessage); saver.setAutoRemove(false);
if (tempFile.isNull()) { saver.write(byteContent);
messageManager->printToOutputPane(errorMessage); if (!saver.finalize()) {
messageManager->printToOutputPane(saver.errorString());
return; return;
} }
// Keep the file and store in list of files to be removed. const QString fileName = saver.fileName();
tempFile->setAutoRemove(false);
const QString fileName = tempFile->fileName();
// Discard to temporary file to make sure it is closed and no changes are triggered.
tempFile = TemporaryFilePtr();
m_fetchedSnippets.push_back(fileName); m_fetchedSnippets.push_back(fileName);
// Open editor with title. // Open editor with title.
Core::IEditor* editor = EditorManager::instance()->openEditor(fileName, QString(), EditorManager::ModeSwitch); Core::IEditor* editor = EditorManager::instance()->openEditor(fileName, QString(), EditorManager::ModeSwitch);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <coreplugin/messageoutputwindow.h> #include <coreplugin/messageoutputwindow.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/fileutils.h>
#include <QtCore/QXmlStreamReader> #include <QtCore/QXmlStreamReader>
#include <QtCore/QXmlStreamAttribute> #include <QtCore/QXmlStreamAttribute>
...@@ -195,27 +196,29 @@ void FileShareProtocol::paste(const QString &text, ...@@ -195,27 +196,29 @@ void FileShareProtocol::paste(const QString &text,
const QString &description) const QString &description)
{ {
// Write out temp XML file // Write out temp XML file
QTemporaryFile tempFile(m_settings->path + QLatin1Char('/') + QLatin1String(tempPatternC)); Utils::TempFileSaver saver(m_settings->path + QLatin1Char('/') + QLatin1String(tempPatternC));
tempFile.setAutoRemove(false); saver.setAutoRemove(false);
if (!tempFile.open()) { if (!saver.hasError()) {
const QString msg = tr("Unable to open a file for writing in %1: %2").arg(m_settings->path, tempFile.errorString()); // Flat text sections embedded into pasterElement
Core::ICore::instance()->messageManager()->printToOutputPanePopup(msg); QXmlStreamWriter writer(saver.file());
writer.writeStartDocument();
writer.writeStartElement(QLatin1String(pasterElementC));
writer.writeTextElement(QLatin1String(userElementC), username);
writer.writeTextElement(QLatin1String(descriptionElementC), description);
writer.writeTextElement(QLatin1String(textElementC), text);
writer.writeEndElement();
writer.writeEndDocument();
saver.setResult(&writer);
}
if (!saver.finalize()) {
Core::ICore::instance()->messageManager()->printToOutputPanePopup(saver.errorString());
return; return;
} }
// Flat text sections embedded into pasterElement
QXmlStreamWriter writer(&tempFile);
writer.writeStartDocument();
writer.writeStartElement(QLatin1String(pasterElementC));
writer.writeTextElement(QLatin1String(userElementC), username);
writer.writeTextElement(QLatin1String(descriptionElementC), description);
writer.writeTextElement(QLatin1String(textElementC), text);
writer.writeEndElement();
writer.writeEndDocument();
tempFile.close();
const QString msg = tr("Pasted: %1").arg(tempFile.fileName()); const QString msg = tr("Pasted: %1").arg(saver.fileName());
Core::ICore::instance()->messageManager()->printToOutputPanePopup(msg); Core::ICore::instance()->messageManager()->printToOutputPanePopup(msg);
} }
} // namespace CodePaster } // namespace CodePaster
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <utils/fileutils.h>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QFile> #include <QtCore/QFile>
...@@ -301,25 +303,18 @@ void CppFileSettingsWidget::setSettings(const CppFileSettings &s) ...@@ -301,25 +303,18 @@ void CppFileSettingsWidget::setSettings(const CppFileSettings &s)
void CppFileSettingsWidget::slotEdit() void CppFileSettingsWidget::slotEdit()
{ {
QString path = licenseTemplatePath(); QString path = licenseTemplatePath();
// Edit existing file with C++ if (path.isEmpty()) {
if (!path.isEmpty()) { // Pick a file name and write new template, edit with C++
Core::EditorManager::instance()->openEditor(path, QLatin1String(CppEditor::Constants::CPPEDITOR_ID), path = QFileDialog::getSaveFileName(this, tr("Choose Location for New License Template File"));
Core::EditorManager::ModeSwitch); if (path.isEmpty())
return; return;
} Utils::FileSaver saver(path, QIODevice::Text);
// Pick a file name and write new template, edit with C++ saver.write(tr(licenseTemplateTemplate).toUtf8());
path = QFileDialog::getSaveFileName(this, tr("Choose Location for New License Template File")); if (!saver.finalize(this))
if (path.isEmpty()) return;
return; setLicenseTemplatePath(path);
QFile file(path);
if (!file.open(QIODevice::WriteOnly|QIODevice::Text|QIODevice::Truncate)) {
QMessageBox::warning(this, tr("Template write error"),
tr("Cannot write to %1: %2").arg(path, file.errorString()));
return;
} }
file.write(tr(licenseTemplateTemplate).toUtf8()); // Edit (now) existing file with C++
file.close();
setLicenseTemplatePath(path);
Core::EditorManager::instance()->openEditor(path, QLatin1String(CppEditor::Constants::CPPEDITOR_ID), Core::EditorManager::instance()->openEditor(path, QLatin1String(CppEditor::Constants::CPPEDITOR_ID),
Core::EditorManager::ModeSwitch); Core::EditorManager::ModeSwitch);
} }
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <find/searchresultwindow.h> #include <find/searchresultwindow.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <utils/filesearch.h> #include <utils/filesearch.h>
#include <utils/fileutils.h>
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h> #include <coreplugin/progressmanager/futureprogress.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
...@@ -76,11 +77,11 @@ static QString getSource(const QString &fileName, ...@@ -76,11 +77,11 @@ static QString getSource(const QString &fileName,
if (workingCopy.contains(fileName)) { if (workingCopy.contains(fileName)) {
return workingCopy.source(fileName); return workingCopy.source(fileName);
} else { } else {
QFile file(fileName); Utils::FileReader reader;
if (! file.open(QFile::ReadOnly)) if (!reader.fetch(fileName)) // ### FIXME error reporting
return QString(); return QString();
return QTextStream(&file).readAll(); // ### FIXME return QString::fromLocal8Bit(reader.data()); // ### FIXME encoding
} }
} }
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/vcsmanager.h> #include <coreplugin/vcsmanager.h>
#include <utils/stringutils.h> #include <utils/stringutils.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QDebug> #include <QtCore/QDebug>
...@@ -68,7 +69,6 @@ ...@@ -68,7 +69,6 @@
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtCore/QTextCodec> #include <QtCore/QTextCodec>
#include <QtCore/QtPlugin> #include <QtCore/QtPlugin>
#include <QtCore/QTemporaryFile>
#include <QtGui/QAction> #include <QtGui/QAction>
#include <QtGui/QMainWindow> #include <QtGui/QMainWindow>
#include <QtGui/QMenu> #include <QtGui/QMenu>
...@@ -805,19 +805,17 @@ void CVSPlugin::startCommit(const QString &workingDir, const QStringList &files) ...@@ -805,19 +805,17 @@ void CVSPlugin::startCommit(const QString &workingDir, const QStringList &files)
m_commitRepository = workingDir; m_commitRepository = workingDir;
// Create a new submit change file containing the submit template // Create a new submit change file containing the submit template
QTemporaryFile changeTmpFile;