Opened 7 years ago

Last modified 6 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:


Hello, this bug was originally reported at

even if

    "incomplete-dir-enabled": false, 


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

is created.

This is similar to the bug which has an upstream counter-part in so likely the resolution will be similar

Change History (5)

comment:1 Changed 7 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 7 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 7 years ago by mike.dld (previous) (diff)

comment:3 Changed 7 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 7 years ago by mike.dld

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

comment:5 Changed 6 years ago by mike.dld

Related to #2084.

Note: See TracTickets for help on using tickets.