# HG changeset patch # User Chris Cannam # Date 1146158959 0 # Node ID e076e676439b26a55bee515a5a755e348a9809e3 # Parent ea730e3f9acefd5a0d589aaf131becd0744938c0 * Add file open/save operations to main toolbar * Allow opening any sort of file from toolbar file open function * First cut at on-disc cacheing for decoded mp3/ogg files * Permit un-snapped selection by holding Shift diff -r ea730e3f9ace -r e076e676439b base/System.h --- a/base/System.h Thu Apr 27 11:49:34 2006 +0000 +++ b/base/System.h Thu Apr 27 17:29:19 2006 +0000 @@ -45,7 +45,7 @@ #define MLOCK(a,b) ::mlock((a),(b)) #define MUNLOCK(a,b) (::munlock((a),(b)) ? (::perror("munlock failed"), 0) : 0) -#define MUNLOCK_SAMPLEBLOCK(a) do { const float &b = *(a).begin(); MUNLOCK(&b, (a).capacity() * sizeof(float)); } while(0); +#define MUNLOCK_SAMPLEBLOCK(a) do { if (!(a).empty()) { const float &b = *(a).begin(); MUNLOCK(&b, (a).capacity() * sizeof(float)); } } while(0); #define DLOPEN(a,b) dlopen((a).toStdString().c_str(),(b)) #define DLSYM(a,b) dlsym((a),(b)) diff -r ea730e3f9ace -r e076e676439b base/TempDirectory.cpp --- a/base/TempDirectory.cpp Thu Apr 27 11:49:34 2006 +0000 +++ b/base/TempDirectory.cpp Thu Apr 27 17:29:19 2006 +0000 @@ -70,7 +70,8 @@ if (m_tmpdir != "") return m_tmpdir; - QDir systemTempDir = QDir::temp(); +//!!! QDir tempDirBase = QDir::temp(); + QDir tempDirBase = QDir::home(); // Generate a temporary directory. Qt4.1 doesn't seem to be able // to do this for us, and mkdtemp is not standard. This method is @@ -98,8 +99,8 @@ QString candidate = QString("sv_%1").arg(suffix); - if (QDir::temp().mkpath(candidate)) { - m_tmpdir = systemTempDir.filePath(candidate); + if (tempDirBase.mkpath(candidate)) { + m_tmpdir = tempDirBase.filePath(candidate); break; } @@ -108,7 +109,7 @@ if (m_tmpdir == "") { throw DirectoryCreationFailed(QString("temporary subdirectory in %1") - .arg(systemTempDir.canonicalPath())); + .arg(tempDirBase.canonicalPath())); } return m_tmpdir;