Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » [BUG & Patch] TheIDE under POSIX dosen't open directories containing spaces.
[BUG & Patch] TheIDE under POSIX dosen't open directories containing spaces. [message #39939] |
Mon, 13 May 2013 20:34  |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I think I found next bug in the Ultimate++ library. What's wrong this time? I think option "Open file directory" does not work on POSIX like operating system when directory path contains space character for instance: "/home/tom/My Documents/".
How to reproduce?
1. File -> Edit file -> open file in directory containing space/s for example "/home/tom/Programs/The best program/main.cpp".
2. File -> Open file directory [Result: Can't open directory]
How to fix?
We need to modify ShellOpenFolder function (ide/Common - ComDlg.cpp - line 163)
void ShellOpenFolder(const String& dir)
{
#if defined(PLATFORM_WIN32)
LaunchWebBrowser(dir);
#elif __APPLE__
IGNORE_RESULT(
system("open " + dir + " &")
);
#else
String tempDir = dir;
tempDir.Replace(" ", "\\ ");
IGNORE_RESULT(
system("xdg-open " + tempDir + " &")
);
#endif
}
All we need is to convert space to following character sequence: "\\ ". It means something like this: "/home/tom/Programs/The\ best\ program/main.cpp". Maybe the solution with tempDir isn't clean, but we need to copy dir varaible, because it is constant.
P.S.
1. Probably on mac we need also change this behaviour (We need to make tests).
2. I have tested this solution on Kubuntu 13.04 (GNU/Linux).
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Tue, 14 May 2013 11:53] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue May 13 14:24:43 CEST 2025
Total time taken to generate the page: 0.01096 seconds
|