diff options
| author | Tannin <Tannin@Miranda> | 2013-02-17 09:26:29 +0100 |
|---|---|---|
| committer | Tannin <Tannin@Miranda> | 2013-02-17 09:26:29 +0100 |
| commit | 6516a6b7c19713de28db7142612f1c095e541317 (patch) | |
| tree | 06829bf7f82e1251a9e3db27185b7df90833bbc8 /src/report.cpp | |
| parent | 5d1154c24e2475ed2b7ac248de27ab7b501a1e5e (diff) | |
- moved shared and uibase libraries to namespaces
- bugfix: the "fix mods" function was accessing the save game data incorrectly, causing a crash
Diffstat (limited to 'src/report.cpp')
| -rw-r--r-- | src/report.cpp | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/src/report.cpp b/src/report.cpp index 6b379a1f..ca7e1dc9 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -17,33 +17,37 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. */ -#include "report.h"
-#include "utility.h"
-#include <QMessageBox>
-#include <QApplication>
-#include <Windows.h>
-
-void reportError(QString message)
-{
- if (QApplication::topLevelWidgets().count() != 0) {
- QMessageBox messageBox(QMessageBox::Warning, QObject::tr("Error"), message, QMessageBox::Ok);
- messageBox.exec();
- } else {
- ::MessageBoxW(NULL, ToWString(message).c_str(), ToWString(QObject::tr("Error")).c_str(), MB_ICONERROR | MB_OK);
- }
-}
-
-
-std::tstring toTString(const QString& source)
-{
-#ifdef UNICODE
- wchar_t* temp = new wchar_t[source.size() + 1];
- source.toWCharArray(temp);
- temp[source.size()] = '\0';
- std::tstring result(temp);
- delete[] temp;
- return result;
-#else // UNICODE
- return source.toAscii();
-#endif // UNICODE
-}
+#include "report.h" +#include "utility.h" +#include <QMessageBox> +#include <QApplication> +#include <Windows.h> + + +using namespace MOBase; + + +void reportError(QString message) +{ + if (QApplication::topLevelWidgets().count() != 0) { + QMessageBox messageBox(QMessageBox::Warning, QObject::tr("Error"), message, QMessageBox::Ok); + messageBox.exec(); + } else { + ::MessageBoxW(NULL, ToWString(message).c_str(), ToWString(QObject::tr("Error")).c_str(), MB_ICONERROR | MB_OK); + } +} + + +std::tstring toTString(const QString& source) +{ +#ifdef UNICODE + wchar_t* temp = new wchar_t[source.size() + 1]; + source.toWCharArray(temp); + temp[source.size()] = '\0'; + std::tstring result(temp); + delete[] temp; + return result; +#else // UNICODE + return source.toAscii(); +#endif // UNICODE +} |
