Skip to content

Commit 5a6adf5

Browse files
committed
Ensure ICore::cacheResourcePath exists and is writable
Otherwise the plugin will crash Qt Creator because it cannot create the llamacpp conversations database. Fixes #1
1 parent 2feab1e commit 5a6adf5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

llamastorage.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ Storage &Storage::instance()
7878

7979
Storage::Storage()
8080
{
81+
const Utils::FilePath cacheResourceDir = Core::ICore::cacheResourcePath(".");
82+
cacheResourceDir.ensureWritableDir();
83+
8184
const QString databasePath = Core::ICore::cacheResourcePath("llamacpp.db").path();
8285
qCDebug(llamaStorage) << "Storage path:" << databasePath;
8386
db = QSqlDatabase::addDatabase("QSQLITE");

0 commit comments

Comments
 (0)