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++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Topic++ Save as template... not working
Topic++ Save as template... not working [message #60278] Sat, 04 November 2023 23:58
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

I was just starting with Topic++. I discovered that (at least on Windows) "Save as template..." does not work. I digged into the code and it turned out that SaveFile in the end fails as the _.tpp -subdirectory does not exist yet and cannot be created automatically. I added the directory manually and then the template was written successfully.
void TopicEditor::SaveAsTemplate()
{
	TopicDlg<WithSaveTemplateLayout<TopWindow> > d("Save as template");
	d.lang <<= lastlang;
	Vector<String> ud = GetUppDirs();
	String p = GetCurrentTopicPath();
	for(int i = 0; i < ud.GetCount(); i++) {
		d.nest.Add(ud[i]);
		if(p.StartsWith(ud[i]))
			d.nest.SetIndex(i);
	}
	if(d.nest.GetIndex() < 0)
		d.nest.GoBegin();
	if(d.Execute() != IDOK || IsNull(~d.nest))
		return;
	SaveFile(AppendFileName(AppendFileName(~d.nest, "_.tpp"), d.GetName()),
	         WriteTopic((String)~title, editor.Get())); // <<<--- Around here...
}
Maybe there should be some code added for creating the necessary directory if it does not exist yet.

Best regards,

Tom
Previous Topic: Shortcuts
Next Topic: 16660: UI
Goto Forum:
  


Current Time: Sun Mar 03 13:17:05 CET 2024

Total time taken to generate the page: 0.01088 seconds