Mercurial > hg > svcore
comparison base/TempDirectory.cpp @ 460:93fb1ebff76b
* Add persistent cache file support to FileSource (e.g. for RDF
descriptions)
* Query RDF plugin data in a background thread on startup
author | Chris Cannam |
---|---|
date | Fri, 17 Oct 2008 13:32:55 +0000 |
parents | 1d656dcda8ef |
children | e340b2fb9471 |
comparison
equal
deleted
inserted
replaced
459:6441b31b37ac | 460:93fb1ebff76b |
---|---|
51 { | 51 { |
52 cleanupDirectory(""); | 52 cleanupDirectory(""); |
53 } | 53 } |
54 | 54 |
55 QString | 55 QString |
56 TempDirectory::getPath() | 56 TempDirectory::getContainingPath() |
57 { | 57 { |
58 QMutexLocker locker(&m_mutex); | 58 QMutexLocker locker(&m_mutex); |
59 | 59 |
60 if (m_tmpdir != "") return m_tmpdir; | |
61 | |
62 QSettings settings; | 60 QSettings settings; |
63 settings.beginGroup("TempDirectory"); | 61 settings.beginGroup("TempDirectory"); |
64 QString svDirParent = settings.value("create-in", "$HOME").toString(); | 62 QString svDirParent = settings.value("create-in", "$HOME").toString(); |
65 settings.endGroup(); | 63 settings.endGroup(); |
66 | 64 |
78 .arg(svDirParent).arg(svDirBase)); | 76 .arg(svDirParent).arg(svDirBase)); |
79 } | 77 } |
80 | 78 |
81 cleanupAbandonedDirectories(svDir); | 79 cleanupAbandonedDirectories(svDir); |
82 | 80 |
83 return createTempDirectoryIn(svDir); | 81 return svDir; |
82 } | |
83 | |
84 QString | |
85 TempDirectory::getPath() | |
86 { | |
87 if (m_tmpdir != "") return m_tmpdir; | |
88 | |
89 return createTempDirectoryIn(getContainingPath()); | |
84 } | 90 } |
85 | 91 |
86 QString | 92 QString |
87 TempDirectory::createTempDirectoryIn(QString dir) | 93 TempDirectory::createTempDirectoryIn(QString dir) |
88 { | 94 { |