comparison base/StorageAdviser.cpp @ 411:52303ec15cd2

* Permit holding Shift while dragging an instant or other edited thing, to override the initial drag resistance (for #1928943 sticky time instants) * better handling of updates during progressive decode load * ready() signal from model (used by vect)
author Chris Cannam
date Mon, 19 May 2008 17:23:11 +0000
parents 7cc6b7b0d819
children e37e44681720
comparison
equal deleted inserted replaced
410:9c7ebf2cd956 411:52303ec15cd2
26 26
27 long StorageAdviser::m_discPlanned = 0; 27 long StorageAdviser::m_discPlanned = 0;
28 long StorageAdviser::m_memoryPlanned = 0; 28 long StorageAdviser::m_memoryPlanned = 0;
29 29
30 StorageAdviser::Recommendation 30 StorageAdviser::Recommendation
31 StorageAdviser::m_baseRecommendation = StorageAdviser::NoRecommendation;
32
33 StorageAdviser::Recommendation
31 StorageAdviser::recommend(Criteria criteria, 34 StorageAdviser::recommend(Criteria criteria,
32 int minimumSize, 35 int minimumSize,
33 int maximumSize) 36 int maximumSize)
34 { 37 {
35 #ifdef DEBUG_STORAGE_ADVISER 38 #ifdef DEBUG_STORAGE_ADVISER
36 std::cerr << "StorageAdviser::recommend: Criteria " << criteria 39 std::cerr << "StorageAdviser::recommend: Criteria " << criteria
37 << ", minimumSize " << minimumSize 40 << ", minimumSize " << minimumSize
38 << ", maximumSize " << maximumSize << std::endl; 41 << ", maximumSize " << maximumSize << std::endl;
39 #endif 42 #endif
43
44 if (m_baseRecommendation != NoRecommendation) {
45 return m_baseRecommendation; // for now
46 }
40 47
41 QString path = TempDirectory::getInstance()->getPath(); 48 QString path = TempDirectory::getInstance()->getPath();
42 int discFree = GetDiscSpaceMBAvailable(path.toLocal8Bit()); 49 int discFree = GetDiscSpaceMBAvailable(path.toLocal8Bit());
43 int memoryFree, memoryTotal; 50 int memoryFree, memoryTotal;
44 GetRealMemoryMBAvailable(memoryFree, memoryTotal); 51 GetRealMemoryMBAvailable(memoryFree, memoryTotal);
192 } 199 }
193 // std::cerr << "storage planned down: memory: " << m_memoryPlanned << ", disc " 200 // std::cerr << "storage planned down: memory: " << m_memoryPlanned << ", disc "
194 // << m_discPlanned << std::endl; 201 // << m_discPlanned << std::endl;
195 } 202 }
196 203
204 void
205 StorageAdviser::setFixedRecommendation(Recommendation recommendation)
206 {
207 m_baseRecommendation = recommendation;
208 }
209