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 » FileSel in Windows: a small problem
FileSel in Windows: a small problem [message #49709] Tue, 10 April 2018 12:34 Go to next message
pvictor is currently offline  pvictor
Messages: 47
Registered: December 2015
Member
Hello.
I noticed a small issue in FileSel under Windows:
when I click "Network" on the left side, then any local disk, it opens, but I cannot enter into any subdirectory.
If after clicking "Network" I enter into any network folder, all works OK.
It happens in TheIde as well.
I've found a small change in source code, that solves this problem:

CtrlLib/FileSel.cpp before:
bool FileSel::OpenItem() {
	if(list.IsCursor()) {
	#ifdef PLATFORM_WIN32
		if(netnode.GetCount()) {
			SelectNet();
			return true;
		}
	#endif
		const FileList::File& m = list.Get(list.GetCursor());
	#ifdef PLATFORM_WIN32
		if(IsNull(dir) && m.name == t_("Network")) {
			netnode = NetNode::EnumRoot();
			netnode.Append(NetNode::EnumRemembered());
			LoadNet();
			return true;
		}
	#endif
		if(m.isdir) {
			SetDir(AppendFileName(~dir, m.name));
			return true;
		}
	}
	if(mode != SELECTDIR)
		Finish();
	return false;
}


CtrlLib/FileSel.cpp after:
bool FileSel::OpenItem() {
	if(list.IsCursor()) {
		const FileList::File& m = list.Get(list.GetCursor());
	#ifdef PLATFORM_WIN32
		if(IsNull(dir) && m.name == t_("Network")) {
			netnode = NetNode::EnumRoot();
			netnode.Append(NetNode::EnumRemembered());
			LoadNet();
			return true;
		}
	#endif
		if(m.isdir) {
			SetDir(AppendFileName(~dir, m.name));
			return true;
		}

// just moved from above
	#ifdef PLATFORM_WIN32
		if(netnode.GetCount()) {
			SelectNet();
			return true;
		}
	#endif

	}
	if(mode != SELECTDIR)
		Finish();
	return false;
}


Most likely, this swapping the code isn't the best solution, but it helps.

Victor
Re: FileSel in Windows: a small problem [message #49757 is a reply to message #49709] Mon, 23 April 2018 11:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13463
Registered: November 2005
Ultimate Member
Thank you, fixed.
Re: FileSel in Windows: a small problem [message #49759 is a reply to message #49757] Mon, 23 April 2018 18:45 Go to previous message
Novo is currently offline  Novo
Messages: 1270
Registered: December 2006
Senior Contributor
There is a small problem with Linux.
FileSel::GoToPlace() should look like below.

void FileSel::GoToPlace()
{
	if(places.IsCursor()) {
#ifdef PLATFORM_WIN32
		netnode.Clear();
#endif
		dir <<= places.GetKey();
		Load();
	}
}


Regards,
Novo
Previous Topic: Different GetHomeDirectory() in PLATFORM_POSIX and PLATFORM_WIN32
Next Topic: FileList/FileSel: Load() function ignores the last modification time of entries
Goto Forum:
  


Current Time: Sat Dec 04 12:47:13 CET 2021

Total time taken to generate the page: 0.01384 seconds