Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2850 Remove --cleanuplegacyfadersettings command line option #3116

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,20 +582,6 @@ int main ( int argc, char** argv )
continue;
}

// Clean up legacy fader settings --------------------------------------
// Undocumented temporary command line argument: Clean up fader settings
// corrupted by bug #2680. Only needs to be used once (per file).
if ( GetFlagArgument ( argv,
i,
"--cleanuplegacyfadersettings", // no short form
"--cleanuplegacyfadersettings" ) )
{
qInfo() << "- will clean up legacy fader settings on load";
CommandLineOptions << "--cleanuplegacyfadersettings";
ClientOnlyOptions << "--cleanuplegacyfadersettings";
continue;
}

// Unknown option ------------------------------------------------------
qCritical() << qUtf8Printable ( QString ( "%1: Unknown option '%2' -- use '--help' for help" ).arg ( argv[0] ).arg ( argv[i] ) );

Expand Down
54 changes: 2 additions & 52 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ void CClientSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
int iValue;
bool bValue;

bCleanUpLegacyFaderSettings = CommandLineOptions.contains ( "--cleanuplegacyfadersettings" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is passing ComandLineOptions still needed?

Otherwiese we don't fully undo https://github.com/jamulussoftware/jamulus/pull/2839/files

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used in ReadSettingsFromXML in CSettings generally - it should be issuing an unused variable warning... Hm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? I don't find it in this function anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/settings.cpp:36:    ReadSettingsFromXML ( IniXMLDocument, CommandLineOptions );


// IP addresses
for ( iIdx = 0; iIdx < MAX_NUM_SERVER_ADDR_ITEMS; iIdx++ )
{
Expand Down Expand Up @@ -559,53 +557,6 @@ void CClientSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
ReadFaderSettingsFromXML ( IniXMLDocument );
}

QString CClientSettings::CleanUpLegacyFaderSetting ( QString strFaderTag, int iIdx )
{
bool ok;
int iIdy;
bool bDup;

if ( !bCleanUpLegacyFaderSettings || strFaderTag.isEmpty() )
{
return strFaderTag;
}

QStringList slChanFaderTag = strFaderTag.split ( ":" );
if ( slChanFaderTag.size() != 2 )
{
return strFaderTag;
}

const int iChan = slChanFaderTag[0].toInt ( &ok );
if ( ok && iChan >= 0 && iChan <= MAX_NUM_CHANNELS )
{
// *assumption*: legacy tag that needs cleaning up
strFaderTag = slChanFaderTag[1];
}

// duplicate detection
// this assumes the first entry into the vector is the newest one and skips any later ones.
// the alternative is to use iIdy for the vector entry, so overwriting the duplicate.
// (in both cases, this currently leaves holes in the vector.)
bDup = false;
for ( iIdy = 0; iIdy < iIdx; iIdy++ )
{
if ( strFaderTag == vecStoredFaderTags[iIdy] )
{
// duplicate entry
bDup = true;
break;
}
}
if ( bDup )
{
// so skip all settings for this iIdx (use iIdx here even if using iIdy and not doing continue below)
return QString();
}

return strFaderTag;
}

void CClientSettings::ReadFaderSettingsFromXML ( const QDomDocument& IniXMLDocument )
{
int iIdx;
Expand All @@ -615,9 +566,8 @@ void CClientSettings::ReadFaderSettingsFromXML ( const QDomDocument& IniXMLDocum
for ( iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ )
{
// stored fader tags
QString strFaderTag = CleanUpLegacyFaderSetting (
FromBase64ToString ( GetIniSetting ( IniXMLDocument, "client", QString ( "storedfadertag%1_base64" ).arg ( iIdx ), "" ) ),
iIdx );
QString strFaderTag =
FromBase64ToString ( GetIniSetting ( IniXMLDocument, "client", QString ( "storedfadertag%1_base64" ).arg ( iIdx ), "" ) );

if ( strFaderTag.isEmpty() )
{
Expand Down
4 changes: 0 additions & 4 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ class CClientSettings : public CSettings
int iCustomDirectoryIndex; // index of selected custom directory
bool bEnableFeedbackDetection;
bool bEnableAudioAlerts;
bool bCleanUpLegacyFaderSettings;

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

// Code for #2680 clean up
QString CleanUpLegacyFaderSetting ( QString strFaderTag, int iIdx );

void ReadFaderSettingsFromXML ( const QDomDocument& IniXMLDocument );
void WriteFaderSettingsToXML ( QDomDocument& IniXMLDocument );

Expand Down