Remove legacy rename compatibility

This commit is contained in:
2026-09-12 16:03:38 +02:00
parent 7c06b6ccba
commit b4ddfbe0a7
3 changed files with 1 additions and 40 deletions

View File

@@ -88,7 +88,6 @@ Each bounded iteration must:
GTK/X11/package build, 2026-09-12).
- [ ] Verify tray activation/menu behavior and graceful tray unavailability.
- [x] Make the global shortcut and second-instance show request toggle the popup reliably without a delayed focus result reopening it (28 X11-feature tests and Docker GTK/X11/package build, 2026-09-12); live GUI acceptance remains pending.
- [x] Preserve history and configuration across the `clipbhoard` to `cliphoard` rename by importing legacy entries and reading legacy configuration when needed (real local migration restored 89 entries; 28 tests and Docker GTK/X11/package build, 2026-09-12).
- [x] Use a standard theme icon for the live tray service so development runs do not depend on the custom icon being installed (Docker GTK/X11/package build, 2026-09-12); live tray acceptance remains pending.
- [x] Make `--diagnostics` inspect the running installation without triggering a
show request, and report the log directory plus instance state (20 tests and

View File

@@ -36,14 +36,6 @@ impl Config {
}
pub fn load_or_default() -> Result<Self> {
let path = Self::path();
let legacy_path = dirs::config_dir()
.unwrap_or_else(|| PathBuf::from("."))
.join("clipbhoard/config.toml");
let path = if !path.exists() && legacy_path.exists() {
legacy_path
} else {
path
};
match fs::symlink_metadata(&path) {
Ok(metadata) if metadata.file_type().is_symlink() => {
anyhow::bail!(

View File

@@ -20,22 +20,7 @@ impl Database {
let path = dirs::data_local_dir()
.unwrap_or_else(|| PathBuf::from("."))
.join("cliphoard/cliphoard.db");
let legacy_path = dirs::data_local_dir()
.unwrap_or_else(|| PathBuf::from("."))
.join("clipbhoard/clipbhoard.db");
let database = Self::open(&path)?;
if legacy_path.exists() && legacy_path != path {
let legacy = Self::open(&legacy_path).with_context(|| {
format!(
"failed to open legacy database for migration {}",
legacy_path.display()
)
})?;
for entry in legacy.load_entries()? {
database.import_entry(&entry)?;
}
}
Ok(database)
Self::open(path)
}
pub fn open(path: impl AsRef<Path>) -> Result<Self> {
@@ -74,21 +59,6 @@ impl Database {
&self.path
}
fn import_entry(&self, entry: &Entry) -> Result<()> {
self.connection.execute(
"INSERT OR IGNORE INTO entries(id, content, content_hash, created_at, last_used_at, pinned) VALUES (?1, ?2, ?3, ?4, ?5, ?6)",
params![
entry.id,
&entry.content,
&entry.content_hash,
entry.created_at,
entry.last_used_at,
entry.pinned as i64
],
)?;
Ok(())
}
pub fn load_entries(&self) -> Result<Vec<Entry>> {
let mut statement = self.connection.prepare("SELECT id, content, content_hash, created_at, last_used_at, pinned FROM entries ORDER BY pinned DESC, last_used_at DESC, id DESC")?;
let entries = statement