static QString databaseName(const MPDConnectionDetails &details) { QString fileName=(!details.isLocal() ? details.hostname+'_'+QString::number(details.port) : details.hostname)+LibraryDb::constFileExt; fileName.replace('/', '_'); fileName.replace('~', '_'); return Utils::dataDir(constDirName, true)+fileName; }
static QString cacheFileName(const MPDConnectionDetails &details, bool withPort=true) { QString fileName=(withPort && !details.isLocal() ? details.hostname+'_'+QString::number(details.port) : details.hostname) +MusicLibraryModel::constLibraryCompressedExt; fileName.replace('/', '_'); fileName.replace('~', '_'); return Utils::cacheDir(MusicLibraryModel::constLibraryCache)+fileName; }