Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » FileSel&FileList, Path » FEATURE REQUEST: Navigation by desktop shortcuts
FEATURE REQUEST: Navigation by desktop shortcuts [message #52623] Thu, 31 October 2019 07:32 Go to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
Hi,

It would be fine if FileSel could navigate to other (network) folders by desktop shortcuts, as Windows explorer does, instead of just opening *.lnk files as plain files.

Best regards,
Victor
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52648 is a reply to message #52623] Mon, 04 November 2019 15:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
Implemented in trunk.
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52651 is a reply to message #52648] Tue, 05 November 2019 11:18 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
Hi,

It doesn't work either (the latest build 13677).
On the desktop there are a few .lnk files, like
Shared.lnk - pointing to \\Server\Shared
and so on.
If I choose File/Edit file/Desktop in TheIDE, I don't see these links as directories.
Only when I choose Type: All files, I see them as files. And after clicking they are opened as empty files.

Best regards,
Victor
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52652 is a reply to message #52651] Thu, 07 November 2019 10:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
Works on my machine...

That said, there were some smaller issues to fix. Can you please retry with trunk?

Then, if it still does not work, can you help me to fix it?

For starter, I would need a full path of non-working .lnk file in Desktop so that I can prepare some initial small test....

Mirek
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52653 is a reply to message #52652] Thu, 07 November 2019 11:55 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
Hello, Mirek.

I researched the problem and found that there are different .lnk files on my desktop.
I attached three of them.
The file СТМ32.lnk points to local directory and it works OK.
Other two files point to network and don't work (they are opened as empty files).
All the .lnk files are shown as files, not as folders (it would be better).

Best regards,
Victor

[Updated on: Thu, 07 November 2019 12:00]

Report message to a moderator

Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52655 is a reply to message #52653] Thu, 07 November 2019 14:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
pvictor wrote on Thu, 07 November 2019 11:55
Hello, Mirek.

I researched the problem and found that there are different .lnk files on my desktop.
I attached three of them.
The file СТМ32.lnk points to local directory and it works OK.
Other two files point to network and don't work (they are opened as empty files).
All the .lnk files are shown as files, not as folders (it would be better).

Best regards,
Victor


Well, sending .lnk files does not really help Smile

Can you test this for me:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

GUI_APP_MAIN
{
	String path = "C:/Users/cxl/Desktop/Files.lnk";
	
	DDUMP(path);
	DDUMP(FileExists(path));
	String t = GetSymLinkPath(path);
	DDUMP(t);
	DDUMP(DirectoryExists(t));
}


Please replace path with other dirs that do now work too and send me the .log file.

As for showing .lnk as files, well, not all .lnk lead to dirs. Unfortunately detecting that .lnk points to dir is potentially time consuming so it has to be done 'later'. BTW it looks like windows shell also shows .lnk of dirs between files, probably for the same reason...

[Updated on: Thu, 07 November 2019 14:35]

Report message to a moderator

Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52656 is a reply to message #52655] Thu, 07 November 2019 15:14 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
mirek wrote on Thu, 07 November 2019 16:33

Can you test this for me:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

GUI_APP_MAIN
{
	String path = "C:/Users/cxl/Desktop/Files.lnk";
	
	DDUMP(path);
	DDUMP(FileExists(path));
	String t = GetSymLinkPath(path);
	DDUMP(t);
	DDUMP(DirectoryExists(t));
}




I'll test it tomorrow. I'm now far from my Windows computer.

Victor
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52658 is a reply to message #52656] Fri, 08 November 2019 05:14 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
Hello, Mirek.

Here's the log:
path = C:/Documents and Settings/pva/Desktop/СТМ32.lnk
FileExists(path) = true
t = D:\_STM32
DirectoryExists(t) = true

path = C:/Documents and Settings/pva/Desktop/Files.lnk
FileExists(path) = true
t = \\1336data\Файлообменник
DirectoryExists(t) = false

path = C:/Documents and Settings/pva/Desktop/Файлообменник.lnk
FileExists(path) = true
t = \\1336data\Файлообменник
DirectoryExists(t) = false

Victor
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52659 is a reply to message #52658] Fri, 08 November 2019 07:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
pvictor wrote on Fri, 08 November 2019 05:14
Hello, Mirek.

Here's the log:
path = C:/Documents and Settings/pva/Desktop/СТМ32.lnk
FileExists(path) = true
t = D:\_STM32
DirectoryExists(t) = true

path = C:/Documents and Settings/pva/Desktop/Files.lnk
FileExists(path) = true
t = \\1336data\Файлообменник
DirectoryExists(t) = false

path = C:/Documents and Settings/pva/Desktop/Файлообменник.lnk
FileExists(path) = true
t = \\1336data\Файлообменник
DirectoryExists(t) = false

Victor


Assuming that "\\1336data\Файлообменник" is a correct path to network share, one possible explanation is that the problem is somewhat caused by those azbuka characters. Would it be possible to create some link to network without azbuka just to test?

Mirek
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52661 is a reply to message #52659] Fri, 08 November 2019 08:48 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
mirek wrote on Fri, 08 November 2019 09:54
Assuming that "\\1336data\Файлообменник" is a correct path to network share, one possible explanation is that the problem is somewhat caused by those azbuka characters. Would it be possible to create some link to network without azbuka just to test?
Mirek

Here's another link without national characters:
path = C:/Documents and Settings/pva/Desktop/Constructor.lnk
FileExists(path) = true
t = \\1336data\Constructor
DirectoryExists(t) = false
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52662 is a reply to message #52661] Fri, 08 November 2019 09:35 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
Mirek, I looked at it in debugger.
File: Path.cpp
bool FindFile::Search(const char *name) {
	pattern = GetFileName(name);
	path = NormalizePath(GetFileDirectory(name));
	Close();
	handle = FindFirstFileW(ToSystemCharsetW(name), data);
	if(handle == INVALID_HANDLE_VALUE)
		return false;   <-- returns here
	if(!PatternMatch(pattern, GetName()))
		return Next();
	return true;
}

name contains "\\\\1336data\\Constructor"

Victor

[Updated on: Fri, 08 November 2019 09:38]

Report message to a moderator

Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52663 is a reply to message #52662] Fri, 08 November 2019 10:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
pvictor wrote on Fri, 08 November 2019 09:35
Mirek, I looked at it in debugger.
File: Path.cpp
bool FindFile::Search(const char *name) {
	pattern = GetFileName(name);
	path = NormalizePath(GetFileDirectory(name));
	Close();
	handle = FindFirstFileW(ToSystemCharsetW(name), data);
	if(handle == INVALID_HANDLE_VALUE)
		return false;   <-- returns here
	if(!PatternMatch(pattern, GetName()))
		return Next();
	return true;
}

name contains "\\\\1336data\\Constructor"

Victor


So no azbuka?

Well, if FindFirstFileW does not work there, hard to say how to fix this... This means that at that point Win32 just does not see that path.

Mirek
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52664 is a reply to message #52663] Fri, 08 November 2019 10:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
Maybe we can try something like

FindFile ff("\\\\1336data\\Constructor\\*.*");
while(ff) {
DDUMP(ff.GetPath());
ff.Next();
}
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52665 is a reply to message #52664] Fri, 08 November 2019 10:32 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
mirek wrote on Fri, 08 November 2019 12:15
Maybe we can try something like

FindFile ff("\\\\1336data\\Constructor\\*.*");
while(ff) {
DDUMP(ff.GetPath());
ff.Next();
}

ff.GetPath() = \\1336data\Constructor\.
ff.GetPath() = \\1336data\Constructor\..
ff.GetPath() = \\1336data\Constructor\constructor

It's correct.
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52666 is a reply to message #52665] Fri, 08 November 2019 10:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
pvictor wrote on Fri, 08 November 2019 10:32
mirek wrote on Fri, 08 November 2019 12:15
Maybe we can try something like

FindFile ff("\\\\1336data\\Constructor\\*.*");
while(ff) {
DDUMP(ff.GetPath());
ff.Next();
}

ff.GetPath() = \\1336data\Constructor\.
ff.GetPath() = \\1336data\Constructor\..
ff.GetPath() = \\1336data\Constructor\constructor

It's correct.


OK, thats interesting. I guess it should not hurt anything if we change DirectoryExists to this method - commited in trunk.

Can you please check with trunk how FileSel behaves now?

Mirek
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52667 is a reply to message #52666] Fri, 08 November 2019 12:09 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
mirek wrote on Fri, 08 November 2019 12:51

OK, thats interesting. I guess it should not hurt anything if we change DirectoryExists to this method - commited in trunk.

Can you please check with trunk how FileSel behaves now?

Mirek

It works OK.
Only one thing: when opening files with file mask, it shouldn't show shortcuts, pointing to local files that don't match the mask.

Thank you,
Victor
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52669 is a reply to message #52667] Fri, 08 November 2019 14:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
pvictor wrote on Fri, 08 November 2019 12:09
mirek wrote on Fri, 08 November 2019 12:51

OK, thats interesting. I guess it should not hurt anything if we change DirectoryExists to this method - commited in trunk.

Can you please check with trunk how FileSel behaves now?

Mirek

It works OK.
Only one thing: when opening files with file mask, it shouldn't show shortcuts, pointing to local files that don't match the mask.

Thank you,
Victor


That would require resolving .lnk on directory load. I am afraid that would lead to unresponsive GUI in cases when .lnk leads to network share...
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52671 is a reply to message #52669] Fri, 08 November 2019 15:35 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
mirek wrote on Fri, 08 November 2019 16:23

That would require resolving .lnk on directory load. I am afraid that would lead to unresponsive GUI in cases when .lnk leads to network share...


The everage user has dozens shortcuts on the desktop. The majority of them point to installed programs and other local files. And only a few of them lead to network drives. I would not want to force users to look for the right label among many wrong ones.

Best regards.
Victor

Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52672 is a reply to message #52671] Fri, 08 November 2019 16:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
pvictor wrote on Fri, 08 November 2019 15:35
mirek wrote on Fri, 08 November 2019 16:23

That would require resolving .lnk on directory load. I am afraid that would lead to unresponsive GUI in cases when .lnk leads to network share...


The everage user has dozens shortcuts on the desktop. The majority of them point to installed programs and other local files. And only a few of them lead to network drives. I would not want to force users to look for the right label among many wrong ones.

Best regards.
Victor



Well, but those 'few' can freeze directory loads for minutes...
Re: FEATURE REQUEST: Navigation by desktop shortcuts [message #52674 is a reply to message #52672] Fri, 08 November 2019 18:32 Go to previous messageGo to previous message
pvictor is currently offline  pvictor
Messages: 30
Registered: December 2015
Location: Russia
Member
mirek wrote on Fri, 08 November 2019 18:52

Well, but those 'few' can freeze directory loads for minutes...

BTW, links to files and directories have different icons, i.e. they are resolved already.
Previous Topic: Application hangs on renaming directories accidentally
Goto Forum:
  


Current Time: Thu Jul 09 12:33:49 CEST 2020

Total time taken to generate the page: 0.01547 seconds