Opened 6 years ago

Last modified 5 years ago

#5922 new Bug

transmission-gtk: Creates incomplete-dir even if incomplete-dir-enabled is set to false

Reported by: morph Owned by: jordan
Priority: Normal Milestone: None Set
Component: GTK+ Client Version: 2.84
Severity: Normal Keywords:
Cc:

Description

Hello, this bug was originally reported at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590933

even if

    "incomplete-dir-enabled": false, 

the

    "incomplete-dir": "/home/morph/Downloads/testmorph", 

is created.

This is similar to the bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=554903 which has an upstream counter-part in https://trac.transmissionbt.com/ticket/2728 so likely the resolution will be similar

Change History (5)

comment:1 Changed 6 years ago by x190

gtk/main.c: Line 504:

static void
on_startup (GApplication * application, gpointer user_data)
{
  GError * error;
  const char * str;
  GtkWindow * win;
  GtkUIManager * ui_manager;
  tr_session * session;
  struct cbdata * cbdata = user_data;

  signal (SIGINT, signal_handler);
  signal (SIGTERM, signal_handler);

  sighandler_cbdata = cbdata;

  /* ensure the directories are created */
  if ((str = gtr_pref_string_get (TR_KEY_download_dir)))
    g_mkdir_with_parents (str, 0777);
  if ((str = gtr_pref_string_get (TR_KEY_incomplete_dir)))
    g_mkdir_with_parents (str, 0777);


You could add a check for "&& TR_KEY_incomplete_dir_enabled", but what do you do if you get a 'on_pref_changed' callback enabling the incomplete directory and the directory doesn't exist? Add the required code, I guess... :-)

Question: How do we get away with re-assigning 'const char * str;' here?

comment:2 Changed 6 years ago by mike.dld

Appeared in r8026 (#1773) and r9346, and was caused by the fact that opening preferences dialog resulted in GTK warnings/errors (that's my understanding).

Related to #2728 (r9889) (already mentioned).

Answer: because str is not constant itself, while it points to constant data.

Last edited 6 years ago by mike.dld (previous) (diff)

comment:3 Changed 6 years ago by mike.dld

Tried commenting out the code and changing paths in settings.json to non-existent ones. GTK+ client shows "(None)" in preferences for both directories (watch, incomplete, download) and files (completion script). Qt client just shows all of them normally, but it didn't have such code in the first place.

comment:4 Changed 6 years ago by mike.dld

  • Component changed from Transmission to GTK+ Client
  • Owner set to jordan

comment:5 Changed 5 years ago by mike.dld

Related to #2084.

Note: See TracTickets for help on using tickets.