Commit 64ae43c6 authored by Daniel Teske's avatar Daniel Teske

Qt4Project: Ignore autosave files

Don't show them in the project tree and don't tell the codemodel that it
needs to update itself. Not the cleanest code.

Task-number: QTCREATORBUG-9957
Change-Id: I37fc1e2d401f59365ffbbb53617eeb7b86eb6456
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 08409a46
...@@ -1531,6 +1531,11 @@ static QString autoSaveName(const QString &fileName) ...@@ -1531,6 +1531,11 @@ static QString autoSaveName(const QString &fileName)
return fileName + QLatin1String(".autosave"); return fileName + QLatin1String(".autosave");
} }
bool EditorManager::isAutoSaveFile(const QString &fileName)
{
return fileName.endsWith(QLatin1String(".autosave"));
}
IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QString &fileName, IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QString &fileName,
const Id &editorId, OpenEditorFlags flags, bool *newEditor) const Id &editorId, OpenEditorFlags flags, bool *newEditor)
{ {
......
...@@ -173,6 +173,7 @@ public: ...@@ -173,6 +173,7 @@ public:
bool autoSaveEnabled() const; bool autoSaveEnabled() const;
void setAutoSaveInterval(int interval); void setAutoSaveInterval(int interval);
int autoSaveInterval() const; int autoSaveInterval() const;
static bool isAutoSaveFile(const QString &fileName);
QTextCodec *defaultTextCodec() const; QTextCodec *defaultTextCodec() const;
......
...@@ -557,7 +557,7 @@ QSet<Utils::FileName> Qt4PriFileNode::recursiveEnumerate(const QString &folder) ...@@ -557,7 +557,7 @@ QSet<Utils::FileName> Qt4PriFileNode::recursiveEnumerate(const QString &folder)
foreach (const QFileInfo &file, dir.entryInfoList()) { foreach (const QFileInfo &file, dir.entryInfoList()) {
if (file.isDir() && !file.isSymLink()) if (file.isDir() && !file.isSymLink())
result += recursiveEnumerate(file.absoluteFilePath()); result += recursiveEnumerate(file.absoluteFilePath());
else else if (!Core::EditorManager::isAutoSaveFile(file.fileName()))
result += Utils::FileName(file); result += Utils::FileName(file);
} }
} else if (fi.exists()) { } else if (fi.exists()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment