-
Notifications
You must be signed in to change notification settings - Fork 227
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
Store recording directory #513
Store recording directory #513
Conversation
Please use recordingdir_base64 instead of recording_dir. I am only using _ to show that it is base 64.
Do you want to fix it before I merge it? |
I'd need to be changing
(I was thinking of first looping through the command line for an inifile setting, else using the default, then looping through the other known command line options, setting the target value if present else using the inifile value; then any other inifile settings - i.e. ones with no matching command line option - would get loaded. Cumbersome...) |
Alternative approach:
(If you wanted to stop storing the command line value in the inifile, you could do the same thing when saving...) |
81939fe
to
502d3fe
Compare
Good idea with the string list, thanks. I'll add some minor comments in your code now. |
src/main.cpp
Outdated
@@ -99,6 +100,7 @@ int main ( int argc, char** argv ) | |||
{ | |||
bIsClient = false; | |||
tsConsole << "- server mode chosen" << endl; | |||
CommandLineOptions += "--server"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we only set the strings for command line arguments which are actually used in the settings class? I actually prefer to add them all as you did but the other solution would give less code and would make clear that the string is actually used. What is your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be "greater equality" between command line and GUI - at the moment, there's a lot that the UI can do (particular the client) that can't be set on start up from the command line. I'd also like to see most if not all of what can be set from the command line available in the UI. And then the UI settings should all get loaded / saved to the inifile.
So it seemed logical to help that process by putting this in consistently, at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, agreed.
src/main.cpp
Outdated
@@ -111,6 +113,7 @@ int main ( int argc, char** argv ) | |||
{ | |||
bUseGUI = false; | |||
tsConsole << "- no GUI mode chosen" << endl; | |||
CommandLineOptions += "--nogui"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the places in Jamulus where I have used the QStringList class, I have used the operator<< instead of the +=. Does the += give a different result? If not, for consistency, we should use << here, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - I was actually surprised +=
worked. My C backgound -- <<
is very C++ ;). Yes, <<
as append seems much better! I'll fix that.
} | ||
|
||
// licence type (command line overwrites setting file) | ||
if ( pServer->GetLicenceType() == LT_NO_LICENCE ) | ||
//if ( pServer->GetLicenceType() == LT_NO_LICENCE ) | ||
// TODO: command line needs to become boolean, at least... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should the command line be a boolean value? It is actually a boolean value. Do you want the command line to not be a boolean value instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I misread it -- I thought it was only checking for presence, rather than value.
src/settings.cpp
Outdated
{ | ||
pServer->SetWelcomeMessage ( FromBase64ToString ( GetIniSetting ( IniXMLDocument, "server", "welcome" ) ) ); | ||
} | ||
|
||
// window position of the main window | ||
vecWindowPosMain = FromBase64ToByteArray ( | ||
GetIniSetting ( IniXMLDocument, "server", "winposmain_base64" ) ); | ||
|
||
// base recording directory (command line overwrites setting file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since now all settings are overwritten by the command line, maybe we should remove all the "(command line overwrites setting file)", what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could go as a comment on the call in main.cpp
- I think it needs mentioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's do that later on. I'll now merge your code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw that you already put it in main.cpp -> done.
502d3fe
to
428cc83
Compare
One problem. Once set, there's no way from the command line to say "clear the base recording dir". You can change it, but not clear it. (Same goes for some other strings.)