Discussion:
[Thunar-dev] What's wrong with this code? ThuanrFile is incomplete type?
Aaron Lewis
2013-03-10 07:35:14 UTC
Permalink
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)
};

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

Version: 1.6.2
--
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: open_xfce4_term_here.patch
Type: application/octet-stream
Size: 4157 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/thunar-dev/attachments/20130310/8d62824d/attachment.obj>
Peter de Ridder
2013-03-10 21:17:23 UTC
Permalink
Hi,
Post by Aaron Lewis
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);
Post by Aaron Lewis
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.
Post by Aaron Lewis
Version: 1.6.2
Regards,
Peter
Aaron Lewis
2013-03-10 23:26:06 UTC
Permalink
Hi,
Post by Aaron Lewis
Hi,
Post by Aaron Lewis
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)
};
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
Post by Aaron Lewis
Post by Aaron Lewis
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!
Post by Aaron Lewis
Post by Aaron Lewis
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
Loading...