Add new comment to Minor inconvenience when saving projects

The advantage of my proposal is that it always makes the extension visible in the "filename" field; it doesn't hide the extension the first time it's saved.

It's also easier to understand and occupies only one continuous block of code.

I've realized that it's not necessary to include the ".qtt" format in the conditional statement. Since it's a template, Qtractor will never suggest it as an extension in an open file, so there's no risk of duplicating the extension when saving a second time.

It would look like this:

		// Always avoid to store session on extracted directories...
		sFilename = sessionArchivePath(sFilename);
		// Try to rename as if a backup is about...
		sFilename = sessionBackupPath(sFilename);


		// NEW>> We ensure that filename adds the default extension if it is missing
		// and that it does not duplicate if it exists
		if (! (sFilename.endsWith(".qtr") ||
			sFilename.endsWith(".qts") ||
			sFilename.endsWith(".qtz")) ) {
			sFilename = sFilename + "." + sExt;
		}


	#if 1//QT_VERSION < QT_VERSION_CHECK(4, 4, 0)
		sFilename = QFileDialog::getSaveFileName(pParentWidget,
			sTitle, sFilename, sFilter, nullptr, options);
	#else

But this is just my opinion; both options solve the problem.

Thanks :).

The content of this field is kept private and will not be shown publicly.

Markdown

  • Parses markdown and converts it to HTML.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <img src alt height width> <strike> <pre> <p> <br>
  • Lines and paragraphs break automatically.

Filtered HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <b> <i> <pre> <img src alt height width> <strike>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
File attachments
Unlimited number of files can be uploaded to this field.
2 MB limit.
Allowed types: jpg jpeg gif png txt doc docx xls xlsx pdf ppt pps odt ods odp zip gz bz2 xz patch diff wav ogg flac ogv mp4 qtz.