There are a few more items in the Command Line class that are dependent on Qt. One of these is the file name member, which contains the path name if a file was specified on the command line. The member along with it access function was changed to a standard string.
The Main Window class also contains a file name member that holds either the path of the file specified on the command line (obtained from the command line instance) or the last file that was loaded. This member was also changed to a standard string. The program path is also passed to many of the the functions within this class. These were modified to take a standard string.
The version function in the Command Line class was modified to return a standard string. This function first converted the C-style release string to a QString, then the first digit if found using a QRegExp with the index of function. A std::regex class is new to the C++11 STL, though unfortunately, this class is not implemented in GCC 4.8. There are a number of possible solutions to accomplish the same thing, but a simple C-like loop to look for the first digit was selected because the release string is a C-style string. Once the first digit is found, a standard string is created from the point of this digit character and returned. This function was made static since it doesn't use any members.
The copyright statement function in the Command Line class contained a translate call for the "Copyright" word. This function is called from the Tester class (no translation needed) and from the About box in the Main Window (translation needed). The function was modified to take the copyright string as an argument with a default of the untranslated copyright word. The About box passes the translated word. With this change, the translate macros could be removed from this class.
A problem was corrected in the Command Line constructor where the file name on the command line wasn't stored in the file name member, so the file name on the command line was ignored. This problem occurred when the argument list was changed to standard list of standard strings.
The constructor of the Main Window was modified to better handle the error when the command line file doesn't exist or the last used program no longer exists. When the command line file doesn't exist, an error is output to the standard error stream. When the last used program no longer exists, a warning box is displayed.
[branch stl commit c998b1ffaa]
Friday, October 17, 2014
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)