Skip to content

Commit

Permalink
Remove 14 years-old unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelienpierre committed Feb 15, 2025
1 parent 9cfd60d commit ace284c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 81 deletions.
1 change: 1 addition & 0 deletions src/dtgtk/thumbnail.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ static void _image_get_infos(dt_thumbnail_t *thumb)
}

// colorlabels
// TODO: colors should be grapped from image cache, like ratings
thumb->colorlabels = 0;
DT_DEBUG_SQLITE3_CLEAR_BINDINGS(darktable.view_manager->statements.get_color);
DT_DEBUG_SQLITE3_RESET(darktable.view_manager->statements.get_color);
Expand Down
76 changes: 0 additions & 76 deletions src/views/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,82 +841,6 @@ char* dt_view_extend_modes_str(const char * name, const gboolean is_hdr, const g
return upcase;
}

/**
* \brief Set the selection bit to a given value for the specified image
* \param[in] imgid The image id
* \param[in] value The boolean value for the bit
*/
void dt_view_set_selection(int imgid, int value)
{
/* clear and reset statement */
DT_DEBUG_SQLITE3_CLEAR_BINDINGS(darktable.view_manager->statements.is_selected);
DT_DEBUG_SQLITE3_RESET(darktable.view_manager->statements.is_selected);

/* setup statement and iterate over rows */
DT_DEBUG_SQLITE3_BIND_INT(darktable.view_manager->statements.is_selected, 1, imgid);

if(sqlite3_step(darktable.view_manager->statements.is_selected) == SQLITE_ROW)
{
if(!value)
{
/* Value is set and should be unset; get rid of it */

/* clear and reset statement */
DT_DEBUG_SQLITE3_CLEAR_BINDINGS(darktable.view_manager->statements.delete_from_selected);
DT_DEBUG_SQLITE3_RESET(darktable.view_manager->statements.delete_from_selected);

/* setup statement and execute */
DT_DEBUG_SQLITE3_BIND_INT(darktable.view_manager->statements.delete_from_selected, 1, imgid);
sqlite3_step(darktable.view_manager->statements.delete_from_selected);
}
}
else if(value)
{
/* Select bit is unset and should be set; add it */

/* clear and reset statement */
DT_DEBUG_SQLITE3_CLEAR_BINDINGS(darktable.view_manager->statements.make_selected);
DT_DEBUG_SQLITE3_RESET(darktable.view_manager->statements.make_selected);

/* setup statement and execute */
DT_DEBUG_SQLITE3_BIND_INT(darktable.view_manager->statements.make_selected, 1, imgid);
sqlite3_step(darktable.view_manager->statements.make_selected);
}
}

/**
* \brief Toggle the selection bit in the database for the specified image
* \param[in] imgid The image id
*/
void dt_view_toggle_selection(int imgid)
{
/* clear and reset statement */
DT_DEBUG_SQLITE3_CLEAR_BINDINGS(darktable.view_manager->statements.is_selected);
DT_DEBUG_SQLITE3_RESET(darktable.view_manager->statements.is_selected);

/* setup statement and iterate over rows */
DT_DEBUG_SQLITE3_BIND_INT(darktable.view_manager->statements.is_selected, 1, imgid);
if(sqlite3_step(darktable.view_manager->statements.is_selected) == SQLITE_ROW)
{
/* clear and reset statement */
DT_DEBUG_SQLITE3_CLEAR_BINDINGS(darktable.view_manager->statements.delete_from_selected);
DT_DEBUG_SQLITE3_RESET(darktable.view_manager->statements.delete_from_selected);

/* setup statement and execute */
DT_DEBUG_SQLITE3_BIND_INT(darktable.view_manager->statements.delete_from_selected, 1, imgid);
sqlite3_step(darktable.view_manager->statements.delete_from_selected);
}
else
{
/* clear and reset statement */
DT_DEBUG_SQLITE3_CLEAR_BINDINGS(darktable.view_manager->statements.make_selected);
DT_DEBUG_SQLITE3_RESET(darktable.view_manager->statements.make_selected);

/* setup statement and execute */
DT_DEBUG_SQLITE3_BIND_INT(darktable.view_manager->statements.make_selected, 1, imgid);
sqlite3_step(darktable.view_manager->statements.make_selected);
}
}

/**
* \brief Reset filter
Expand Down
5 changes: 0 additions & 5 deletions src/views/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ dt_view_surface_value_t dt_view_image_get_surface(int imgid, int width, int heig
const gboolean quality);


/** Set the selection bit to a given value for the specified image */
void dt_view_set_selection(int imgid, int value);
/** toggle selection of given image. */
void dt_view_toggle_selection(int imgid);

/**
* holds all relevant data needed to manage the view
* modules.
Expand Down

0 comments on commit ace284c

Please sign in to comment.