I've been doing a lot of cleaning and API simplifications recently. The main changes are:
* the replacement of std::string with QString in many parts of the software, all the file management strings are now converted. From my experience and feedbacks/discussions, the main rules for doing this migrations are:
- use qPrintable(str) when you want to output a QString (cout << qPrintable(myString))
- For warnings, use qWarning() << myString; // No need for endl at the end
- For transforming a QString containing a file path to char* use QFile::encodename().constData() (
e.g. std::ifstream inf(QFile::encodeName(myFile).constData());)
- Assume that the content of text files is always in UTF-8
- For translating QString use the q_() macro instead of _()
- Use QStringList instead of vector<std::string>
- Use QTextStream instead of std::stringstream and co.
- Use Qt containers as much as you can to replace STL ones. They are much easier to use, and produce clean compile error.
- Use the Qt foreach() keyword which also makes code cleaner.
* changes in the StelModule API:
- the draw() method now just take a StelCore in input. This will allow to modify/merge the Projector/Navigator classes without breaking all API.
- the StelApp class now provide a default LoadingBar instance (use StelApp::getInstance().getLoadinBar() from anywhere in the code), so no need to pass them in functions interfaces anymore.
I hope I didn't break anything, but it is possible since many part of the code were modified.
We will proceed to the release of 0.9.1 in the next days, so the whole testing bench will have to be carefully performed.
A important change to do also before API freeze is to use QKeyEvent/QMouseEvent etc natively instead of converting all to StelKey.. The problem is that this change will break the SDL-based version of Stellarium. And I know that at least Johannes is using it (thanks for the bug fixes btw!). We really have to get rid of SDL ASAP now because it is also a condition for starting with the new GUI. Johannes do we now have a solution for your screen problems with Qt?