Skip to content

Commit

Permalink
Merge pull request #4 from jo-tools/feature/win32-shellpath
Browse files Browse the repository at this point in the history
WIN32: use FolderItem ShellPath
  • Loading branch information
marcobambini authored Nov 9, 2024
2 parents 9eeda50 + 42b314a commit 552e334
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
21 changes: 7 additions & 14 deletions sources/CubeSQLPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1810,21 +1810,14 @@ REALstring CheckFixEscapedStringPath (REALstring s) {
}

REALstring REALbasicPathFromFolderItem (REALfolderItem value) {
REALstring path = NULL;
DEBUG_WRITE("REALbasicPathFromFolderItem");

double v = REALGetRBVersion();
if (v <= 2012.021) { // 2012R2.1 is the latest Real Studio edition
#if WIN32
if (REALGetPropValueString((REALobject)value, "AbsolutePath", &path) == false) return NULL;
#else
if (REALGetPropValueString((REALobject)value, "ShellPath", &path) == false) return NULL;
path = CheckFixEscapedStringPath(path);
#endif
} else {
// NativePath property is supported only on Xojo and it is the recommended way to get path from FolderItem
if (REALGetPropValueString((REALobject)value, "NativePath", &path) == false) return NULL;
}
REALstring path = NULL;

#if WIN32
if (REALGetPropValueString((REALobject)value, "ShellPath", &path) == false) return NULL;
#else
if (REALGetPropValueString((REALobject)value, "NativePath", &path) == false) return NULL;
#endif

REALLockString(path);
return path;
Expand Down
2 changes: 1 addition & 1 deletion sources/CubeSQLPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#define PING_FREQUENCY 300 // on the server it is specified as 300
#define DEBUG_WRITE(...) if (debugFile != NULL) debug_write(__VA_ARGS__)
#define PLUGIN_VERSION "3.2.1"
#define PLUGIN_VERSION "3.2.2"
#define SSL_NOVERSION "N/A"
#define MAX_TYPES_COUNT 512

Expand Down

0 comments on commit 552e334

Please sign in to comment.