From 3e31a770b5aa882c4fccdea65c7f8504beab032a Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Wed, 18 Aug 2010 15:38:05 +0200
Subject: [PATCH] CodePaster: Do not show popup about modified files on
 Windows.

QTemporaryFile destructor causes a file changed signal due to it
holding on to it.

Reviewed-by: dt
Task-number: QTCREATORBUG-2083
---
 src/plugins/cpaster/cpasterplugin.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp
index 47cbf0091bb..e3a17c01d98 100644
--- a/src/plugins/cpaster/cpasterplugin.cpp
+++ b/src/plugins/cpaster/cpasterplugin.cpp
@@ -351,6 +351,8 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription,
     // Keep the file and store in list of files to be removed.
     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);
     // Open editor with title.
     Core::IEditor* editor = EditorManager::instance()->openEditor(fileName);
-- 
GitLab