mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
yomitan init on UI
This commit is contained in:
1 parent
3b5afbc34e
commit
ff64c035e6
8 files changed
+245
-46
No files matched your search
@@ -46,19 +46,6 @@ impl Database {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn is_yomitan_dbfile_init(&self) -> Result<bool> {
|
||||
let yomitan_db_path = self.dir.join(YOMITAN_DBFILE);
|
||||
|
||||
if yomitan_db_path.exists() {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
let conn = Connection::open(yomitan_db_path)?;
|
||||
let mut stmt = conn.prepare("SELECT 1 FROM dictionaries")?;
|
||||
|
||||
Ok(stmt.exists([])?)
|
||||
}
|
||||
|
||||
pub fn yomitan(&self) -> Result<yomitan::YomitanDatabase> {
|
||||
self.ensure_yomitan_attached()?;
|
||||
Ok(yomitan::YomitanDatabase::new(self.clone()))
|
||||
|
||||
Reference in new issue
Block a user