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

Aaron Lewis the.warl0ck.1989 at gmail.com
Mon Mar 11 00:26:06 CET 2013


Hi,

On Mon, Mar 11, 2013 at 5:17 AM, Peter de Ridder <peter at xfce.org> wrote:
> 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);

Thanks for the heads up, althrough with Arch and gcc 4.6 I didn't run into this

>
>>
>>   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.

Right, I found the function thunar_file_get_file

Thanks for the help!

>
>>
>> Version: 1.6.2
>
> Regards,
> Peter
> _______________________________________________
> Thunar-dev mailing list
> Thunar-dev at xfce.org
> https://mail.xfce.org/mailman/listinfo/thunar-dev



-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E


More information about the Thunar-dev mailing list