Allow custom parameters that start with "-X", where X is a numeric value.

This commit is contained in:
LoRd_MuldeR 2015-09-22 20:32:53 +02:00
parent 498ba2690d
commit 86a6fe27f9
3 changed files with 9 additions and 5 deletions

View File

@ -4,6 +4,10 @@ Simple x264/x265 Launcher version history
Version 2.60 [unreleased]
* Much improved validation of custom parameters
* Massive code clean-up
* Some minor fixes and improvements
* Updated x264 to revision 2597
* Updated x265 to version 1.7+470
Version 2.51 [2015-04-26]
* Fixed regression: Config files were stored in a wrong directory

View File

@ -26,7 +26,7 @@
#define VER_X264_MAJOR 2
#define VER_X264_MINOR 6
#define VER_X264_PATCH 0
#define VER_X264_BUILD 965
#define VER_X264_BUILD 966
#define VER_X264_PORTABLE_EDITION (0)

View File

@ -150,14 +150,14 @@ protected:
{
if(m_notifier)
{
m_notifier->setText(tr("Invalid parameter: %1").arg(*iter));
m_notifier->setText(tr("Forbidden parameter: %1").arg(*iter));
}
return true;
}
}
if(iter->startsWith("-", Qt::CaseInsensitive) || iter->startsWith("--", Qt::CaseInsensitive))
if(iter->startsWith("--", Qt::CaseInsensitive))
{
for(int i = 1; i < iter->length(); i++)
for(int i = 2; i < iter->length(); i++)
{
if((!iter->at(i).isLetter()) && (iter->at(i) != '-'))
{
@ -194,7 +194,7 @@ protected:
if
(
((!doubleMinus) && iter->startsWith("--", Qt::CaseInsensitive)) ||
(doubleMinus && iter->startsWith("-", Qt::CaseInsensitive) && (!iter->startsWith("--", Qt::CaseInsensitive)) && (iter->length() > 2)) ||
(doubleMinus && iter->startsWith("-", Qt::CaseInsensitive) && (!iter->startsWith("--", Qt::CaseInsensitive)) && (iter->length() > 2) && (!iter->at(1).isDigit())) ||
(doubleMinus && iter->startsWith("--", Qt::CaseInsensitive) && (iter->length() < 4))
)
{