Commit 31b86eaa780a719ee890947a3b0392c11163a356

Authored by perry.werneck@gmail.com
1 parent 410180f4

Ajustes para facilitar a depuracao de plugins

Showing 1 changed file with 27 additions and 4 deletions   Show diff stats
src/pw3270/plugin.c
... ... @@ -127,14 +127,37 @@
127 127  
128 128 LIB3270_EXPORT void pw3270_init_plugins(GtkWidget *widget)
129 129 {
130   -#if defined(DEBUG)
131   - load("." G_DIR_SEPARATOR_S "plugins", widget);
132   -#else
  130 +#if ! defined(DEBUG)
  131 +
133 132 gchar *path = pw3270_build_filename(widget,"plugins",NULL);
134 133 load(path, widget);
135 134 g_free(path);
136   -#endif
  135 +
  136 +#elif defined( win32 )
  137 +
  138 + gchar * appdir = g_win32_get_package_installation_directory_of_module(NULL);
  139 + gchar * path = pw3270_build_filename(widget,"plugins",NULL);
  140 + load(path, widget);
  141 + g_free(path);
  142 + g_free(appdir);
  143 +
  144 +#else
  145 +
  146 + gchar * dir = g_get_current_dir();
  147 + gchar * path = g_build_filename(dir,".bin","Debug","plugins",NULL);
  148 +
  149 + if(!g_file_test(path,G_FILE_TEST_IS_DIR))
  150 + {
  151 + g_free(path);
  152 + path = pw3270_build_filename(widget,"plugins",NULL);
  153 + }
  154 +
  155 + load(path,widget);
  156 +
  157 + g_free(path);
  158 + g_free(dir);
137 159  
  160 +#endif
138 161 }
139 162  
140 163 LIB3270_EXPORT void pw3270_deinit_plugins(GtkWidget *widget)
... ...