Initialize cache directory
| 56 | |
| 57 | // Initialize cache directory |
| 58 | void CacheDisk::InitPath(std::string cache_path) { |
| 59 | QString qpath; |
| 60 | |
| 61 | if (!cache_path.empty()) { |
| 62 | // Init QDir with cache directory |
| 63 | qpath = QString(cache_path.c_str()); |
| 64 | |
| 65 | } else { |
| 66 | // Init QDir with user's temp directory |
| 67 | qpath = QDir::tempPath() + QString("/preview-cache/"); |
| 68 | } |
| 69 | |
| 70 | // Init QDir with cache directory |
| 71 | path = QDir(qpath); |
| 72 | |
| 73 | // Check if cache directory exists |
| 74 | if (!path.exists()) |
| 75 | // Create |
| 76 | path.mkpath(qpath); |
| 77 | } |
| 78 | |
| 79 | // Default destructor |
| 80 | CacheDisk::~CacheDisk() |
nothing calls this directly
no outgoing calls
no test coverage detected