[Thunar-dev] What's wrong with this code? ThuanrFile is incomplete type?

Peter de Ridder peter at xfce.org
Sun Mar 10 22:17:23 CET 2013


Hi,

On Sun, Mar 10, 2013 at 8:35 AM, Aaron Lewis <the.warl0ck.1989 at gmail.com> wrote:
> Hi,
>
> I'm modifying a patch to make the code cleaner,
>
> The original one is attached
>
> static gboolean thunar_window_open_term(ThunarWindow *window) {
>
>   char *argv[6] = {
>     "exo-open",
>     "--launch",
>     "TerminalEmulator",
>     "--working-directory",
>     g_file_get_path(window->current_directory->gfile)
>   };

Not all compiler support initializing an array with a dynamic value:
char *argv[6] = {
  "exo-open",
  "--launch",
  "TerminalEmulator",
  "--working-directory"
};
argv[5] = g_file_get_path(window->current_directory->gfile);

>
>   return g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL,
> NULL, NULL, NULL);
> }
>
> But window->current_directory->gfile won't deference (the GFile part),
> any ideas?
>
> thunar-window.c:402:46: error: dereferencing pointer to incomplete type

Assuming thunar-window.c:402:46: is window->current_directory->gfile.
This either means the compiler doesn't know the structure of struct
window or struct window->current_direcotry.
This could be cause of a missing header file or the struct member
should be accessed directly but can be retrieved with an get function.

>
> Version: 1.6.2

Regards,
Peter


More information about the Thunar-dev mailing list