From abba182b1ba630b41660424abf372af527b1612c Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 9 May 2015 21:44:19 +0200 Subject: dropped redundant report.h/report.cpp --- src/categories.cpp | 2 +- src/downloadmanager.cpp | 2 +- src/helper.cpp | 4 +++- src/logbuffer.cpp | 5 ++++- src/main.cpp | 10 +++++----- src/moapplication.cpp | 5 ++++- src/modlist.cpp | 2 +- src/organizer.pro | 2 -- src/organizercore.cpp | 2 +- src/pluginlist.cpp | 2 +- src/profile.cpp | 2 +- src/report.cpp | 53 ------------------------------------------------- src/report.h | 38 ----------------------------------- src/selfupdater.cpp | 2 +- src/singleinstance.cpp | 3 ++- src/spawn.cpp | 1 + 16 files changed, 26 insertions(+), 109 deletions(-) delete mode 100644 src/report.cpp delete mode 100644 src/report.h (limited to 'src') diff --git a/src/categories.cpp b/src/categories.cpp index 1d5fdefe..0b201dcf 100644 --- a/src/categories.cpp +++ b/src/categories.cpp @@ -19,7 +19,7 @@ along with Mod Organizer. If not, see . #include "categories.h" #include -#include "report.h" +#include #include #include #include diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index b5bc8148..81732f4d 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -18,7 +18,6 @@ along with Mod Organizer. If not, see . */ #include "downloadmanager.h" -#include "report.h" #include "nxmurl.h" #include "nexusinterface.h" #include "nxmaccessmanager.h" @@ -30,6 +29,7 @@ along with Mod Organizer. If not, see . #include "selectiondialog.h" #include "bbcode.h" #include +#include #include #include #include diff --git a/src/helper.cpp b/src/helper.cpp index 1f072bd9..41784fe5 100644 --- a/src/helper.cpp +++ b/src/helper.cpp @@ -18,8 +18,8 @@ along with Mod Organizer. If not, see . */ #include "helper.h" -#include "report.h" #include "utility.h" +#include #include #define WIN32_LEAN_AND_MEAN @@ -27,6 +27,8 @@ along with Mod Organizer. If not, see . #include +using MOBase::reportError; + namespace Helper { diff --git a/src/logbuffer.cpp b/src/logbuffer.cpp index fdfce6c5..b58ef1de 100644 --- a/src/logbuffer.cpp +++ b/src/logbuffer.cpp @@ -18,13 +18,16 @@ along with Mod Organizer. If not, see . */ #include "logbuffer.h" -#include "report.h" +#include #include #include #include #include #include + +using MOBase::reportError; + QScopedPointer LogBuffer::s_Instance; QMutex LogBuffer::s_Mutex; diff --git a/src/main.cpp b/src/main.cpp index 4d33b6ea..07210a23 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,7 +45,7 @@ along with Mod Organizer. If not, see . #include #include #include "mainwindow.h" -#include "report.h" +#include #include "modlist.h" #include "profile.h" #include "gameinfo.h" @@ -398,12 +398,12 @@ int main(int argc, char *argv[]) ::GetEnvironmentVariable(TEXT("PATH"), oldPath.get(), offset); } - std::tstring newPath(oldPath.get()); - newPath += TEXT(";"); + std::wstring newPath(oldPath.get()); + newPath += L";"; newPath += ToWString(QDir::toNativeSeparators(QCoreApplication::applicationDirPath())).c_str(); - newPath += TEXT("\\dlls"); + newPath += L"\\dlls"; - ::SetEnvironmentVariable(TEXT("PATH"), newPath.c_str()); + ::SetEnvironmentVariableW(L"PATH", newPath.c_str()); } registerMetaTypes(); diff --git a/src/moapplication.cpp b/src/moapplication.cpp index df0fdd09..e25591d8 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -18,7 +18,7 @@ along with Mod Organizer. If not, see . */ #include "moapplication.h" -#include "report.h" +#include #include #include #include @@ -36,6 +36,9 @@ along with Mod Organizer. If not, see . #include +using MOBase::reportError; + + class ProxyStyle : public QProxyStyle { public: ProxyStyle(QStyle *baseStyle = 0) diff --git a/src/modlist.cpp b/src/modlist.cpp index 866445a6..4475e021 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -19,7 +19,6 @@ along with Mod Organizer. If not, see . #include "modlist.h" -#include "report.h" #include "messagedialog.h" #include "installationtester.h" #include "qtgroupingproxy.h" @@ -27,6 +26,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include diff --git a/src/organizer.pro b/src/organizer.pro index e2a0914b..340fbc72 100644 --- a/src/organizer.pro +++ b/src/organizer.pro @@ -31,7 +31,6 @@ SOURCES += \ savegameinfowidget.cpp \ savegamegamebryo.cpp \ savegame.cpp \ - report.cpp \ queryoverwritedialog.cpp \ profilesdialog.cpp \ profile.cpp \ @@ -111,7 +110,6 @@ HEADERS += \ savegameinfowidget.h \ savegamegamebyro.h \ savegame.h \ - report.h \ queryoverwritedialog.h \ profilesdialog.h \ profile.h \ diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 5375cd3a..d8b4b951 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -7,7 +7,6 @@ #include "filedialogmemory.h" #include "lockeddialog.h" #include "modinfodialog.h" -#include "report.h" #include "spawn.h" #include "safewritefile.h" #include "syncoverwritedialog.h" @@ -18,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index a1e694b4..d3ffcdcb 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -18,7 +18,6 @@ along with Mod Organizer. If not, see . */ #include "pluginlist.h" -#include "report.h" #include "inject.h" #include "settings.h" #include "safewritefile.h" @@ -28,6 +27,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include diff --git a/src/profile.cpp b/src/profile.cpp index 09ac0713..e0adbbc6 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -18,7 +18,6 @@ along with Mod Organizer. If not, see . */ #include "profile.h" -#include "report.h" #include "gameinfo.h" #include "windows_error.h" #include "modinfo.h" @@ -28,6 +27,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include diff --git a/src/report.cpp b/src/report.cpp deleted file mode 100644 index cca511a9..00000000 --- a/src/report.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (C) 2012 Sebastian Herbord. All rights reserved. - -This file is part of Mod Organizer. - -Mod Organizer is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Mod Organizer is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Mod Organizer. If not, see . -*/ - -#include "report.h" -#include "utility.h" -#include -#include -#include - - -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(nullptr, 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 -} diff --git a/src/report.h b/src/report.h deleted file mode 100644 index b319f9a0..00000000 --- a/src/report.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (C) 2012 Sebastian Herbord. All rights reserved. - -This file is part of Mod Organizer. - -Mod Organizer is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Mod Organizer is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Mod Organizer. If not, see . -*/ - -#ifndef REPORT_H -#define REPORT_H - -#include -#include - -namespace std { -#ifdef UNICODE -typedef wstring tstring; -#else -typedef string tstring; -#endif -} - -void reportError(QString message); - -std::tstring toTString(const QString& source); - -#endif // REPORT_H diff --git a/src/selfupdater.cpp b/src/selfupdater.cpp index 659233f1..071ee51c 100644 --- a/src/selfupdater.cpp +++ b/src/selfupdater.cpp @@ -20,7 +20,6 @@ along with Mod Organizer. If not, see . #include "selfupdater.h" #include "utility.h" #include "installationmanager.h" -#include "report.h" #include "messagedialog.h" #include "downloadmanager.h" #include "nexusinterface.h" @@ -28,6 +27,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include diff --git a/src/singleinstance.cpp b/src/singleinstance.cpp index dcb0fc78..89332f9b 100644 --- a/src/singleinstance.cpp +++ b/src/singleinstance.cpp @@ -18,13 +18,14 @@ along with Mod Organizer. If not, see . */ #include "singleinstance.h" -#include "report.h" #include "utility.h" +#include #include static const char s_Key[] = "mo-43d1a3ad-eeb0-4818-97c9-eda5216c29b5"; static const int s_Timeout = 5000; +using MOBase::reportError; SingleInstance::SingleInstance(bool forcePrimary, QObject *parent) : QObject(parent), m_PrimaryInstance(false) diff --git a/src/spawn.cpp b/src/spawn.cpp index b1127df3..c79714bb 100644 --- a/src/spawn.cpp +++ b/src/spawn.cpp @@ -22,6 +22,7 @@ along with Mod Organizer. If not, see . #include "utility.h" #include #include +#include #include #include #include -- cgit v1.3.1