Skip to content

Commit

Permalink
Scanning for more paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
PerryWerneck committed Dec 8, 2023
1 parent fa3b423 commit 61064ce
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
36 changes: 34 additions & 2 deletions src/objects/application/application.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,41 @@ static void pw3270Application_init(pw3270Application *app) {
g_settings_bind(app->settings, "ui-style", app, "ui-style", G_SETTINGS_BIND_DEFAULT);
}

// Load plugins from registry
/*
{
lib3270_autoptr(char) plugin_path = lib3270_build_data_filename("plugins",NULL);
pw3270_load_plugins_from_path(app, plugin_path);
HKEY hKey;
DWORD cbData = 4096;
g_autofree gchar *path = g_malloc0(cbData);
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,G_STRINGIFY(PRODUCT_NAME)"\\plugin",0,KEY_READ,&hKey) == ERROR_SUCCESS) {
DWORD dwRet = RegQueryValueEx(hKey,"path",NULL,NULL,(LPBYTE) path, &cbData);
if(dwRet != ERROR_SUCCESS && *path) {
pw3270_load_plugins_from_path(app, path);
}
CloseHandle(hKey);
}
}
*/

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

// Load plugin from default paths.
{
const char *paths[] = {
"plugins",
G_STRINGIFY(PRODUCT_NAME) "-plugins",
"lib/plugins",
"lib/" G_STRINGIFY(PRODUCT_NAME) "-plugins",
};
size_t ix;

for(ix = 0; ix < G_N_ELEMENTS(paths);ix++) {
lib3270_autoptr(char) path = lib3270_build_data_filename("plugins",NULL);
if(g_file_test(path,G_FILE_TEST_IS_DIR)) {
pw3270_load_plugins_from_path(app, path);
break;
}
}

}

#elif defined(__APPLE__)
Expand Down
4 changes: 4 additions & 0 deletions src/objects/application/plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ void pw3270_load_plugins_from_path(pw3270Application *app, const char *path) {

}

} else {

g_warning("Can't load plugins from %s: %s",path,"Invalid path");

}

}
2 changes: 1 addition & 1 deletion win/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cd $(dirname $(dirname $(readlink -f ${0})))
# Install pre-reqs
#
echo "Installing pre-reqs..."
pacman -U --noconfirm *.pkg.tar.zst || die "pacman failure"
pacman -U --noconfirm *.pkg.tar.zst || die "pre-reqs failure"

#
# Build
Expand Down

0 comments on commit 61064ce

Please sign in to comment.