Skip to content

Commit d1dfe64

Browse files
authored
Merge pull request #3116 from pljones/patch/2850-remove-cleanuplegacyfadersettings
#2850 Remove --cleanuplegacyfadersettings command line option
2 parents a9b5475 + 0f89d2d commit d1dfe64

File tree

3 files changed

+2
-70
lines changed

3 files changed

+2
-70
lines changed

src/main.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -582,20 +582,6 @@ int main ( int argc, char** argv )
582582
continue;
583583
}
584584

585-
// Clean up legacy fader settings --------------------------------------
586-
// Undocumented temporary command line argument: Clean up fader settings
587-
// corrupted by bug #2680. Only needs to be used once (per file).
588-
if ( GetFlagArgument ( argv,
589-
i,
590-
"--cleanuplegacyfadersettings", // no short form
591-
"--cleanuplegacyfadersettings" ) )
592-
{
593-
qInfo() << "- will clean up legacy fader settings on load";
594-
CommandLineOptions << "--cleanuplegacyfadersettings";
595-
ClientOnlyOptions << "--cleanuplegacyfadersettings";
596-
continue;
597-
}
598-
599585
// Unknown option ------------------------------------------------------
600586
qCritical() << qUtf8Printable ( QString ( "%1: Unknown option '%2' -- use '--help' for help" ).arg ( argv[0] ).arg ( argv[i] ) );
601587

src/settings.cpp

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ void CClientSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
232232
int iValue;
233233
bool bValue;
234234

235-
bCleanUpLegacyFaderSettings = CommandLineOptions.contains ( "--cleanuplegacyfadersettings" );
236-
237235
// IP addresses
238236
for ( iIdx = 0; iIdx < MAX_NUM_SERVER_ADDR_ITEMS; iIdx++ )
239237
{
@@ -559,53 +557,6 @@ void CClientSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
559557
ReadFaderSettingsFromXML ( IniXMLDocument );
560558
}
561559

562-
QString CClientSettings::CleanUpLegacyFaderSetting ( QString strFaderTag, int iIdx )
563-
{
564-
bool ok;
565-
int iIdy;
566-
bool bDup;
567-
568-
if ( !bCleanUpLegacyFaderSettings || strFaderTag.isEmpty() )
569-
{
570-
return strFaderTag;
571-
}
572-
573-
QStringList slChanFaderTag = strFaderTag.split ( ":" );
574-
if ( slChanFaderTag.size() != 2 )
575-
{
576-
return strFaderTag;
577-
}
578-
579-
const int iChan = slChanFaderTag[0].toInt ( &ok );
580-
if ( ok && iChan >= 0 && iChan <= MAX_NUM_CHANNELS )
581-
{
582-
// *assumption*: legacy tag that needs cleaning up
583-
strFaderTag = slChanFaderTag[1];
584-
}
585-
586-
// duplicate detection
587-
// this assumes the first entry into the vector is the newest one and skips any later ones.
588-
// the alternative is to use iIdy for the vector entry, so overwriting the duplicate.
589-
// (in both cases, this currently leaves holes in the vector.)
590-
bDup = false;
591-
for ( iIdy = 0; iIdy < iIdx; iIdy++ )
592-
{
593-
if ( strFaderTag == vecStoredFaderTags[iIdy] )
594-
{
595-
// duplicate entry
596-
bDup = true;
597-
break;
598-
}
599-
}
600-
if ( bDup )
601-
{
602-
// so skip all settings for this iIdx (use iIdx here even if using iIdy and not doing continue below)
603-
return QString();
604-
}
605-
606-
return strFaderTag;
607-
}
608-
609560
void CClientSettings::ReadFaderSettingsFromXML ( const QDomDocument& IniXMLDocument )
610561
{
611562
int iIdx;
@@ -615,9 +566,8 @@ void CClientSettings::ReadFaderSettingsFromXML ( const QDomDocument& IniXMLDocum
615566
for ( iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ )
616567
{
617568
// stored fader tags
618-
QString strFaderTag = CleanUpLegacyFaderSetting (
619-
FromBase64ToString ( GetIniSetting ( IniXMLDocument, "client", QString ( "storedfadertag%1_base64" ).arg ( iIdx ), "" ) ),
620-
iIdx );
569+
QString strFaderTag =
570+
FromBase64ToString ( GetIniSetting ( IniXMLDocument, "client", QString ( "storedfadertag%1_base64" ).arg ( iIdx ), "" ) );
621571

622572
if ( strFaderTag.isEmpty() )
623573
{

src/settings.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ class CClientSettings : public CSettings
165165
int iCustomDirectoryIndex; // index of selected custom directory
166166
bool bEnableFeedbackDetection;
167167
bool bEnableAudioAlerts;
168-
bool bCleanUpLegacyFaderSettings;
169168

170169
// window position/state settings
171170
QByteArray vecWindowPosSettings;
@@ -180,9 +179,6 @@ class CClientSettings : public CSettings
180179
virtual void WriteSettingsToXML ( QDomDocument& IniXMLDocument ) override;
181180
virtual void ReadSettingsFromXML ( const QDomDocument& IniXMLDocument, const QList<QString>& CommandLineOptions ) override;
182181

183-
// Code for #2680 clean up
184-
QString CleanUpLegacyFaderSetting ( QString strFaderTag, int iIdx );
185-
186182
void ReadFaderSettingsFromXML ( const QDomDocument& IniXMLDocument );
187183
void WriteFaderSettingsToXML ( QDomDocument& IniXMLDocument );
188184

0 commit comments

Comments
 (0)