mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:36:00 +01:00
Merge two ifs
This commit is contained in:
parent
155e538d26
commit
d80c654b8b
2 changed files with 8 additions and 12 deletions
|
@ -463,14 +463,11 @@ plain_remove_bookmark(zathura_database_t* db, const char* file, const char* id)
|
||||||
}
|
}
|
||||||
|
|
||||||
char* name = prepare_filename(file);
|
char* name = prepare_filename(file);
|
||||||
if (g_key_file_has_group(priv->bookmarks, name) == TRUE) {
|
if (g_key_file_has_group(priv->bookmarks, name) == TRUE && g_key_file_remove_key(priv->bookmarks, name, id, NULL) == TRUE) {
|
||||||
if (g_key_file_remove_key(priv->bookmarks, name, id, NULL) == TRUE) {
|
zathura_db_write_key_file_to_file(priv->bookmark_path, priv->bookmarks);
|
||||||
|
g_free(name);
|
||||||
|
|
||||||
zathura_db_write_key_file_to_file(priv->bookmark_path, priv->bookmarks);
|
return true;
|
||||||
g_free(name);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
g_free(name);
|
g_free(name);
|
||||||
|
|
||||||
|
|
|
@ -155,11 +155,10 @@ check_column_type(sqlite3* session, const char* table, const char* col, const ch
|
||||||
*res = false;
|
*res = false;
|
||||||
|
|
||||||
while (sqlite3_step(stmt) == SQLITE_ROW) {
|
while (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||||
if (strcmp((const char*) sqlite3_column_text(stmt, 1), col) == 0) {
|
if (strcmp((const char*) sqlite3_column_text(stmt, 1), col) == 0 &&
|
||||||
if (strcmp((const char*) sqlite3_column_text(stmt, 2), type) == 0) {
|
strcmp((const char*) sqlite3_column_text(stmt, 2), type) == 0) {
|
||||||
*res = true;
|
*res = true;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue