Compare commits

...
Author SHA1 Message Date
Tannin 9edc39633b - bugfixes
- moved more functionality to game-plugins
- further decoupled management functionality from the UI
- created another "tutorial" which is only a single page with relevant parts of
  the ui highlighted with info as tooltips
2015-01-06 19:31:53 +01:00
Tannin b415db619e Merge 2015-01-04 10:33:37 +01:00
Tannin bd8267993d - fixes after merge 2015-01-04 10:13:12 +01:00
Tannin f5c56efeb3 re-integrated changes missing from the merge 2015-01-03 16:18:38 +01:00
Tannin a16e25380f Merge with branch1.2 2015-01-03 15:58:52 +01:00
Tannin b2d04d70fc accidentally removed loot_cli from build 2014-11-28 11:51:52 +01:00
Tannin 99de80e722 replaced all uses of NULL with nullptr
fixed a few placed where NULL was used as a number or boolean
2014-11-28 11:19:20 +01:00
Tannin 78f628e0af cleanup und bugfixes after refactoring 2014-11-28 11:06:28 +01:00
Tannin 45a46778fb Merge 2014-11-21 15:07:31 +01:00
Tannin cfb863f6c3 qt5 compatibility 2014-11-21 15:01:47 +01:00
Tannin f2f9e11fdd - started on a refactoring moving functionality out of the MainWindow class
- started on support for game-plugins
2014-11-21 14:45:30 +01:00
Tannin d23466f036 - fixed manifest for qt5
- download messages can now be sent from different user accounts
2014-11-14 23:33:49 +01:00
Tannin 53896e66f1 - updated staging script to use qt5 and to fetch translations from transifex
- removed call to function unavailable in Windows XP
2014-11-11 23:48:22 +01:00
Tannin efc77930ad Merge 2014-11-11 21:52:50 +01:00
Tannin 01265e9b03 - re-enabled use of img-tags in bbcode converter
- addded a workaround for cases where, after a MO update, the stored modlist layout has no size for new columns
- using a webview again for the nexus view of the modinfo dialog
2014-11-11 21:46:16 +01:00
Tannin 9494938534 Merge 2014-11-11 21:42:18 +01:00
Tannin 7c1273b246 some work on installer scripts 2014-11-11 21:41:22 +01:00
Tannin 9ab7bada1c - bsa parser will now cancel in case of a read error. Before, when attempting to parse a broken bsa it could take forever and continuously allocate memory
- better error message when bsa parsing fails
- slightly better support for font colors in bbcode converter
- configurator now also uses pyqt5
- bugfix: bsa hashing function converted backslashes to slashes instead of the other way around. hash calculation is still often wrong on folder names...
2014-11-09 14:01:48 +01:00
Tannin 10cc566081 Merge 2014-11-06 00:07:06 +01:00
Tannin 53d1f3e00e - workaround for GetModuleFileName-calls that supply wrong buffer size
- removed obsoleted calls to GetVersionEx
- bugfix: download urls were potentially not encoded correctly
- bugfixes to tls-based recursion protection
2014-11-06 00:03:44 +01:00
Tannin df0bd3331a - archive library can now query for password during extraction (seems to be necessary for rars)
- process blacklist is now taken from a file if there is one, not hardcoded
- removed workaround for the papyrus compiler
- updated loot client to work with the actual api
- loot client now links with loot32.dll at runtime
- loot client now produces its output in a (json-)file which includes all plugin messages and dirty flags
- fomod installer now tries to parse the xml with several encodings
- fomod installer will now display a diagnostics warning if the jpg imageformat isn't supported
- base preview plugin now tries to be a bit smarter about resizing images to fit the screen
- bugfix: fomod installer no longer tries to open an image even after detecting its invalid
- bugfix: potential null-pointer dereferentiation in getprivateprofile... hooks
- bugfix: potential null-pointer dereferentiation in download manager
- bugfix: internal origin name showed up in one more place
- bugfix: ToString function produced strings that were one (zero-termination-)character too long
2014-11-05 23:48:06 +01:00
Tannin db0e278817 - moved the hook-recursion-protection to tls
- some code cleanup and consolidation
- hook.dll will now report all of its own exceptions
- some more logging during startup
- changed the way urls are encoded for download requests
- now displaying (one of the) process name(s) while waiting for a program to end
- bugfix: spawned processes were forced to leave the job
2014-09-29 20:35:35 +02:00
Tannin 2ce135e0bf updated minimum nmm compatible version number 2014-09-27 19:18:33 +02:00
Tannin 93bd29c13d - several style fixes suggested by static analysis
- will now support up to 4 levels of version numbers (major.minor.subminor.subsubminor
2014-09-24 19:51:51 +02:00
Tannin 637ce6bcc1 - removed a use of wostringstream which seems to have been involved in a bug. Still not sure how
- rewrote widechar <-> multibyte conversion functions to handle arbitrary string lengths
2014-09-19 22:01:37 +02:00
Tannin d3d7e30286 non-mo mods now have a constructed name that cannot conflict with a regular mod 2014-09-10 20:44:39 +02:00
Tannin 7d27138086 when MO fails to overwrite its ini file it tries another method using qt functions 2014-09-10 20:43:33 +02:00
Tannin 19cb2d4076 plugins can now query the list of masters for a plugin 2014-09-10 20:37:17 +02:00
Tannin 5aa5c90d39 profiles are now created with an (empty) archives.txt 2014-09-10 20:35:57 +02:00
Tannin 12a57d7f6d - descriptions for plugin settings are now displayed 2014-09-10 20:34:31 +02:00
Tannin 482f13a50b - re-enabled building of loot_cli and started developing against the new api
- extended set of default categories
- more tolerand bbcode parser
- added a few colors for the bbcode parser
- more fixes to qt5 compatibility
- started work on ability to unloading (and thus re-loading) of plugins
- names of plugins are no longer localizable (because those names are also used to store settings)
- added settings to disable individual diagnosis settings
- path of dependencies is now configured in a .pri file instead of environment variablees
- bugfix: if the modid-input is canceled, the id was saved as -1 and wasn't re-requested from the user
- bugfix: moving files with the SHFileOperation-Api didn't update the vfs correctly (still not perfect but better)
- bugfix: attempt to remove the deleter-file seems to have caused error messages for some users
- bugfix: fixed a couple of cases that might have caused the tutorial to hang
2014-09-08 20:37:23 +02:00
Tannin f481a7aae3 Merge 2014-08-28 18:21:51 +02:00
Tannin 15b9927cef minor fixes 2014-08-28 18:20:40 +02:00
Tannin cc42e76f54 - bugfix: MO would report invalid index errors when downloading while download list is sorted by filetime descending 2014-08-25 21:07:29 +02:00
Tannin 84598cbcbf - processes spawned from MO are now themselves allowed to break away from the job.
Without this the CEF (chromium embedded framework) seems to fail
- bugfix: Fixed an error message when installing a fomod wrapped in an archive
- bugfix: sorting plugins had no effect on non-skyrim games
- bugfix: fomod parser quit installing filelists after one file
- bugfix: function retrieving local appdata path read wrong directory
2014-08-25 20:12:25 +02:00
Tannin 02973be652 - bugfix: mods were specified by internal name in archive and data tab 2014-08-19 18:44:35 +02:00
Tannin fc2591e028 - new plugin-api to determine the origin of a file 2014-08-18 23:01:25 +02:00
Tannin 9a97098cc3 - bugfix: text files weren't displayed in the mod-info-dialog 2014-08-18 23:01:02 +02:00
Tannin 4b1e6683d2 - can now filter by mod content
- all files/directories that require write access can now be placed in AppData instead of the MO directory
2014-08-18 23:00:25 +02:00
Tannin 06701856f8 - login package now also uses a "proper" user-agent 2014-08-18 22:57:00 +02:00
Tannin 5d4a55c3a6 - performance optimizations for detection of file changes in mod directories
- added a workaround for download-link handling in chrome
- MO will now create a profile even if the game-launcher has never been run
- bugfix: files weren't cleanly removed from vfs file register
2014-08-01 12:10:49 +02:00
Tannin 470b6ed0bf - browser dialog now has a hidden url-field (for testing only)
- loot_cli is no longer part of this project. I will probably create a fork of loot that allows command-line usage instead
- loot integration now works with such a modified loot version
- integrated loot will now also integrate incompatibility messages in the MO UI
- overwrite-markers are now updated as the list order is changed
- fnis checker will now always allow the user to ignore fnis errors
- plugin interface now has a function to wait for handles returned from startApplication (which can be job or process handles)
- bugfix: non-mo mods sharing the name with regular mods now have a different internal name
- bugfix: using hotkeys the vanilla game-plugins could be moved
2014-07-27 18:34:32 +02:00
Tannin 0050cb0740 - download-list will no longer show a file as having incomplete data if there is no file version
- added a new mod column with icons displaying the content of the mod
- MO now differentiates between mods using an internal name that disambiguates between foreign and regular mods
2014-07-21 19:14:24 +02:00
Tannin f6ef5477e7 normalized eol style (all files should now have windows line endings) 2014-07-17 22:02:15 +02:00
Tannin e24f3fef77 - bugfix: broke qt4 compatibility in trying to support qt5
- bugfix: overwrite dialog displayed system drives if the overwrite directory didn't exist
- bugfix: ini tweak activation wasn't saved
2014-07-17 20:04:22 +02:00
Tannin 0a152ceadf Merge 2014-07-15 20:45:29 +02:00
Tannin 5718af3510 - Disabled compilation of loot_cli as the current loot version can't be compiled or linked against with vs 2010
- bugfix: some incompatibilities with non-skyrim games
- bugfix: incorrect handling of plurals in translateable strings
2014-07-15 20:37:10 +02:00
Tannin 434b6be69d merged changes by TheBloke 2014-07-15 17:48:43 +02:00
Tannin d412060d59 - qt 5 compatibility fixes
- detection for support of optimized find no longer depends on deprecated api
2014-07-15 17:31:44 +02:00
Tannin 84c66727bf - when highlighting a mod the overwritten and overwriting mods are now highlighted in the list
- when starting an external application MO now wraps the process in a job and waits on that instead. This way MO is not unlocked early when skyrim is started through skse
- mod info dialog no longer offers the esp tab for foreign mods because that caused confusion
- updated translation files
- download directory and mod directory are now created if necessary
- bugfix: staging script created unnecessary copies of translation files
- bugfix: potential invalid array access when trying to determine best mod order
- bugfix: deleter file wasn't removed after esp hiding was disabled
- bugfix: potential access to to un-initialized login reply
- bugfix: changed the initialization order to allow more ui controls to be localized
2014-07-14 21:22:44 +02:00
TheBloke bfb3385e49 deleteSavegame:
- Confirmation question shows number of saves to be deleted, when more than 1
2014-07-13 16:11:30 +01:00
TheBloke f59f52501c savegameList: more minor changes
- Context Menu - can do same job with fewer variables and assignments
- deleteSaveGame_clicked - const reference, not new value, in foreach loop
2014-07-13 15:45:19 +01:00
TheBloke 9b67e338e1 savegameList:
- Context menu bugfix, previous method of getting rows didn't work when items
 were selected in certain ways, e.g. Control-A
- Context menu now uses selectedIndexes(), which always works with all selections.
- Renamed enableFixMods to multipleSelected so same value can be used to decide
 whether to show single or plural version of "Delete save(s)"
2014-07-13 15:24:46 +01:00
TheBloke 7944bacfd9 savegameList: A few cleanups and minor code improvements
- Slight improvements over previous commits, using more appropriate methods and
 removing some unnecessary code. No functional changes.
2014-07-12 11:15:34 +01:00
TheBloke 1b4c07eb20 - savegameList: Improved save game handling from MainWindow
-- Save game deletion now does Recycle Bin delete (wishlist #675)
-- Save game deletion now also deletes .skse file (bug #687)
-- Can select and delete multiple save games (ExtendedSelection) (wishlist #675)
-- Uses new SaveGame->saveFiles() method to get filenames (eg .ess & .skse)
-- Context menu - "Fix Mods.." option only appears if 1 save is selected
-- Context menu - delete menu option labelled "Delete save" or "Delete saves",
 according to 1 or >1 saves selected.
-- Context menu - delete menu confirmation shows list of all selected saves
2014-07-11 01:46:42 +01:00
TheBloke d93df95dcf - Save game management: re-factored getting of filenames including .skse
-- New - SaveGame->saveFiles(), returns all filenames for save (eg. ess + skse)
-- Moved - SaveGameGameBryo->attachedFiles() to SaveGame->attachedFiles()
-- This allows the getting of save file names with just a SaveGame object, not
 a GameBryo object, which would do a full file read including plugins and image etc.
-- Therefore SaveGame is no longer abstract.

- Transfer Saves: re-factored to use new SaveGame->saveFiles() method
-- Removed - TransferSavesDialog->getFilesToProcess, now redundant as information
 is now provided by SaveGame class itself.
2014-07-11 01:29:33 +01:00
TheBloke 46a32ff3b7 Additional 'make install' step - install boost_python DLL to output(d)\DLLs
Extended the new ModOrganizer.pro 'make install' steps, to now also copy
  $$(BOOSTPATH)\stage\lib\boost_python-vc*-mt-1*.dll
 This is the final install step required, so that now ModOrganizer.exe works
  fully when a Qt-Creator "Run" step is performed.
 The wildcard should pick up the right version of the library regardless of
  MSVC compiler version used.

Updated Qt5 version check to the standardised greaterThan check.
2014-07-08 04:05:33 +01:00
TheBloke 0046d8710e Compilation dependency tracking enabled for organizer, hook, bsaExtractor, shared
Previously, qmake did not detect when code was changed in the static libraries
 So for example, changing code in shared/*.cpp and then Build, would not cause
  a re-link and re-deploy of ModOrganizer.exe.
 This has been fixed by adding PRE_TARGETDEPS references to each project that
  depend on static libraries provided by other sub-projects.
 These checks are conditional on debug|release, to point to the correct lib.

 List of currently configured static library dependency checks -
  organizer - mo_shared.lib, bsatk.lib
  hookdll - mo_shared.lib, bsatk.lib
  shared - bsatk.lib
  bsaExtractor - bsatk.lib

 I have tested to confirm that changing a shared file results in re-linking and
  re-deplomyent of both ModOrganizer.exe and hook.dll.

 Note that dependencies have not been configured for DLLs, as these are
  loaded dynamically and so recompilation is not required.
  But there could be an argument for configuring DLLs as dependencies too -
   as if you make a change in DLL code, you might want all clients of the DLL to
    be recompiled to check that they have not been broken by the changes?
  The downside of that would be extra re-compilation every time.
2014-07-08 04:01:24 +01:00
TheBloke 2b5748003d .pro files - formatting/consistency fixes
Many small formatting changes to the majority of .pro files
 Consistent style for Qt version checking, using greaterThan(QT_MAJOR_VERSION, 4)
  This seems safest, as would continue to work for a future Qt 6 etc.
  Note that this makes redudundant the commit before this one, to organizer.pro
 Consistent indenting
 Moved some file configuration sections to be together with related sections
 Moved some installation-related sections (e.g. OUTDIR/DSTDIR) to be at the bottom,
  immediately before the related POST_LINK install lines.
 Similarly, in some cases separated out CONFIG(debug,.. checks into separate
  LIB/INCLUDE sections (high in file) and installation directory sections (low
   in file)
2014-07-07 23:32:18 +01:00
TheBloke a49ed5c33c organizer.pro - tiny tweak to Qt5 version check
Directly checking QT_MAJOR_VERSION instead of pattern matching on QT_VERSION
2014-07-07 21:51:35 +01:00
TheBloke 62b0c07a93 Added 'make install' steps in ModOrganizer.pro -
Added config to install required libraries to output(d) directory
 If the user adds a Deploy step, that runs 'jom install', he will have the
  necessary libraries copied to output(d)\dlls
 These libraries are -
  7z.dll
  Qt4 Core Declarative Gui Network OpenGL Script Sql Svg Webkit Xml XmlPatterns
   Different set configured for Qt5, e.g. adding Widgets, Qml, Quick
   In a debug build, the 'd' DLLs will be used instead.
   Qt4 libraries are copied from system Qt4 installation directory.
 This allows the Qt-Creator user to hit "Run" in Qt-C and end up with a complete
  install, including all DLLs; no manual Exporer copying required.
 This therefore removes the need for post-build steps 10 & 11 in Readme.txt.
 Future thought - Update all current POST_LINK (x)copy steps to make install?

Fixed DESTDIR in ModOrganizer.pro
 It was pointing to source/output(d) before, should be ..\output(d)
 It was not used before so didn't matter, but is now referenced for install.
2014-07-07 21:39:27 +01:00
tomjobbins 05c58c8b3d Added tag release v1.2.9 for changeset d70ead9aea95 2014-07-07 20:23:52 +01:00
Tannin 9b33e0a970 Merge 2014-07-03 17:42:56 +02:00
Tannin a5b6556d67 slight fixes to qt5 compatibility 2014-07-03 17:42:31 +02:00
108 changed files with 18337 additions and 11401 deletions
+3
View File
@@ -31,6 +31,9 @@ html
*.log
*.filters
*.lib
source/organizer/resources/contents/icons
source/plugins/build-*
*/GeneratedFiles/*
syntax: regexp
Makefile\.(Debug|Release)
source/.*/debug/.*
+1566 -1059
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -12,6 +12,7 @@ SUBDIRS = bsatk \
nxmhandler \
BossDummy \
pythonRunner \
loot_cli \
esptk
pythonRunner.depends = uibase
+4 -6
View File
@@ -37,16 +37,14 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent)
m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt";
m_LicenseFiles[LICENSE_APACHE2] = "apache-license-2.0.txt";
addLicense("Qt 4.8.5", LICENSE_LGPL3);
addLicense("Qt 5.3", LICENSE_LGPL3);
addLicense("Qt Json", LICENSE_GPL3);
addLicense("Boost Library", LICENSE_BOOST);
addLicense("Tango Icon Theme", LICENSE_NONE);
addLicense("RRZE Icon Set", LICENSE_CCBY3);
addLicense("7-zip", LICENSE_LGPL3);
addLicense("ZLib", LICENSE_ZLIB);
addLicense("NIF File Format Library", LICENSE_BSD3);
addLicense("BOSS (modified)", LICENSE_GPL3);
addLicense("Alphanum Algorithm", LICENSE_ZLIB);
addLicense("Tango Icon Theme", LICENSE_NONE);
addLicense("RRZE Icon Set", LICENSE_CCBY3);
addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3);
addLicense("Castle Core", LICENSE_APACHE2);
ui->nameLabel->setText(QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>").arg(ui->nameLabel->text()).arg(version));
+2 -2
View File
@@ -72,7 +72,7 @@ std::set<QString> ActivateModsDialog::getModsToActivate()
for (int row = 0; row < modsTable->rowCount(); ++row) {
QComboBox *comboBox = dynamic_cast<QComboBox*>(modsTable->cellWidget(row, 1));
if (comboBox != NULL) {
if (comboBox != nullptr) {
result.insert(comboBox->currentText());
}
}
@@ -87,7 +87,7 @@ std::set<QString> ActivateModsDialog::getESPsToActivate()
for (int row = 0; row < modsTable->rowCount(); ++row) {
QComboBox *comboBox = dynamic_cast<QComboBox*>(modsTable->cellWidget(row, 1));
if (comboBox != NULL) {
if (comboBox != nullptr) {
QLabel *espName = dynamic_cast<QLabel*>(modsTable->cellWidget(row, 0));
result.insert(espName->text());
+1 -1
View File
@@ -80,7 +80,7 @@ public:
if (tagName == "color") {
QString color = tagIter->second.first.cap(1);
QString content = tagIter->second.first.cap(2);
if (color.at(0) == '#') {
if (color.at(0) == "#") {
return temp.replace(tagIter->second.first, QString("<font style=\"color: %1;\">%2</font>").arg(color, content));
} else {
auto colIter = m_ColorMap.find(color.toLower());
+1 -1
View File
@@ -29,7 +29,7 @@ namespace BBCode {
/**
* @brief convert a string with BB Code-Tags to HTML
* @param input the input string with BB tags
* @param replaceOccured if not NULL, this parameter will be set to true if any bb tags were replaced
* @param replaceOccured if not nullptr, this parameter will be set to true if any bb tags were replaced
* @return the same string in html representation
**/
QString convertToHTML(const QString &input);
+10 -11
View File
@@ -24,11 +24,11 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "report.h"
#include "persistentcookiejar.h"
#include <gameinfo.h>
#include "json.h"
#include <utility.h>
#include <gameinfo.h>
#include "settings.h"
#include <QNetworkCookieJar>
#include <QNetworkCookie>
#include <QMenu>
@@ -49,7 +49,7 @@ BrowserDialog::BrowserDialog(QWidget *parent)
ui->setupUi(this);
m_AccessManager->setCookieJar(new PersistentCookieJar(
QDir::fromNativeSeparators(MOBase::ToQString(MOShared::GameInfo::instance().getCacheDir())) + "/cookies.dat", this));
QDir::fromNativeSeparators(Settings::instance().getCacheDirectory() + "/cookies.dat")));
Qt::WindowFlags flags = windowFlags() | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint;
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
@@ -115,7 +115,7 @@ BrowserView *BrowserDialog::getCurrentView()
void BrowserDialog::urlChanged(const QUrl &url)
{
BrowserView *currentView = getCurrentView();
if (currentView != NULL) {
if (currentView != nullptr) {
ui->backBtn->setEnabled(currentView->history()->canGoBack());
ui->fwdBtn->setEnabled(currentView->history()->canGoForward());
}
@@ -192,17 +192,16 @@ void BrowserDialog::unsupportedContent(QNetworkReply *reply)
{
try {
QWebPage *page = qobject_cast<QWebPage*>(sender());
if (page == NULL) {
if (page == nullptr) {
qCritical("sender not a page");
return;
}
BrowserView *view = qobject_cast<BrowserView*>(page->view());
if (view == NULL) {
if (view == nullptr) {
qCritical("no view?");
return;
}
qDebug("unsupported: %s - %s", view->url().toString().toUtf8().constData(), reply->url().toString().toUtf8().constData());
emit requestDownload(view->url(), reply);
} catch (const std::exception &e) {
if (isVisible()) {
@@ -232,7 +231,7 @@ void BrowserDialog::tabCloseRequested(int index)
void BrowserDialog::on_backBtn_clicked()
{
BrowserView *currentView = getCurrentView();
if (currentView != NULL) {
if (currentView != nullptr) {
currentView->back();
}
}
@@ -240,7 +239,7 @@ void BrowserDialog::on_backBtn_clicked()
void BrowserDialog::on_fwdBtn_clicked()
{
BrowserView *currentView = getCurrentView();
if (currentView != NULL) {
if (currentView != nullptr) {
currentView->forward();
}
}
@@ -255,7 +254,7 @@ void BrowserDialog::startSearch()
void BrowserDialog::on_searchEdit_returnPressed()
{
BrowserView *currentView = getCurrentView();
if (currentView != NULL) {
if (currentView != nullptr) {
currentView->findText(ui->searchEdit->text(), QWebPage::FindWrapsAroundDocument);
}
}
@@ -268,7 +267,7 @@ void BrowserDialog::on_refreshBtn_clicked()
void BrowserDialog::on_browserTabWidget_currentChanged(int index)
{
BrowserView *currentView = qobject_cast<BrowserView*>(ui->browserTabWidget->widget(index));
if (currentView != NULL) {
if (currentView != nullptr) {
ui->backBtn->setEnabled(currentView->history()->canGoBack());
ui->fwdBtn->setEnabled(currentView->history()->canGoForward());
}
@@ -277,7 +276,7 @@ void BrowserDialog::on_browserTabWidget_currentChanged(int index)
void BrowserDialog::on_urlEdit_returnPressed()
{
QWebView *currentView = getCurrentView();
if (currentView != NULL) {
if (currentView != nullptr) {
currentView->setUrl(QUrl(ui->urlEdit->text()));
}
}
-1
View File
@@ -23,7 +23,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "browserview.h"
#include "tutorialcontrol.h"
#include <QDialog>
#include <QProgressBar>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QTimer>
+4 -4
View File
@@ -32,12 +32,12 @@ using namespace MOBase;
using namespace MOShared;
CategoryFactory* CategoryFactory::s_Instance = NULL;
CategoryFactory* CategoryFactory::s_Instance = nullptr;
QString CategoryFactory::categoriesFilePath()
{
return QCoreApplication::applicationDirPath() + "/categories.dat";
return qApp->property("dataPath").toString() + "/categories.dat";
}
@@ -93,7 +93,7 @@ CategoryFactory::CategoryFactory()
CategoryFactory &CategoryFactory::instance()
{
if (s_Instance == NULL) {
if (s_Instance == nullptr) {
s_Instance = new CategoryFactory;
}
return *s_Instance;
@@ -133,7 +133,7 @@ void CategoryFactory::setParents()
void CategoryFactory::cleanup()
{
delete s_Instance;
s_Instance = NULL;
s_Instance = nullptr;
}
+6 -6
View File
@@ -31,7 +31,7 @@ using namespace MOShared;
DirectoryRefresher::DirectoryRefresher()
: m_DirectoryStructure(NULL)
: m_DirectoryStructure(nullptr)
{
}
@@ -44,7 +44,7 @@ DirectoryEntry *DirectoryRefresher::getDirectoryStructure()
{
QMutexLocker locker(&m_RefreshLock);
DirectoryEntry *result = m_DirectoryStructure;
m_DirectoryStructure = NULL;
m_DirectoryStructure = nullptr;
return result;
}
@@ -65,12 +65,12 @@ void DirectoryRefresher::setMods(const std::vector<std::tuple<QString, QString,
void DirectoryRefresher::cleanStructure(DirectoryEntry *structure)
{
static wchar_t *files[] = { L"meta.ini", L"readme.txt" };
static const wchar_t *files[] = { L"meta.ini", L"readme.txt" };
for (int i = 0; i < sizeof(files) / sizeof(wchar_t*); ++i) {
structure->removeFile(files[i]);
}
static wchar_t *dirs[] = { L"fomod" };
static const wchar_t *dirs[] = { L"fomod" };
for (int i = 0; i < sizeof(dirs) / sizeof(wchar_t*); ++i) {
structure->removeDir(std::wstring(dirs[i]));
}
@@ -104,7 +104,7 @@ void DirectoryRefresher::addModFilesToStructure(DirectoryEntry *directoryStructu
foreach (const QString &filename, stealFiles) {
QFileInfo fileInfo(filename);
FileEntry::Ptr file = directoryStructure->findFile(ToWString(fileInfo.fileName()));
if (file.get() != NULL) {
if (file.get() != nullptr) {
if (file->getOrigin() == 0) {
// replace data as the origin on this bsa
file->removeOrigin(0);
@@ -134,7 +134,7 @@ void DirectoryRefresher::refresh()
delete m_DirectoryStructure;
m_DirectoryStructure = new DirectoryEntry(L"data", NULL, 0);
m_DirectoryStructure = new DirectoryEntry(L"data", nullptr, 0);
std::wstring dataDirectory = GameInfo::instance().getGameDirectory() + L"\\data";
m_DirectoryStructure->addFromOrigin(L"data", dataDirectory, 0);
+12 -4
View File
@@ -1,19 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="dlls" version="1.0.0.0" processorArchitecture="x86"/>
<file name="icuin52.dll"/>
<file name="icuuc52.dll"/>
<file name="icudt52.dll"/>
<file name="icuin53.dll"/>
<file name="icuuc53.dll"/>
<file name="icudt53.dll"/>
<file name="Qt5Cored.dll"/>
<file name="Qt5Declaratived.dll"/>
<file name="Qt5Quickd.dll"/>
<file name="Qt5Guid.dll"/>
<file name="Qt5Multimediad.dll"/>
<file name="Qt5MultimediaWidgetsd.dll"/>
<file name="Qt5Networkd.dll"/>
<file name="Qt5OpenGLd.dll"/>
<file name="Qt5Positioningd.dll"/>
<file name="Qt5PrintSupportd.dll"/>
<file name="Qt5Qmld.dll"/>
<file name="Qt5Quickd.dll"/>
<file name="Qt5Sensorsd.dll"/>
<file name="Qt5Scriptd.dll"/>
<file name="Qt5Sqld.dll"/>
<file name="Qt5Svgd.dll"/>
<file name="Qt5WebChanneld.dll"/>
<file name="Qt5WebKitd.dll"/>
<file name="Qt5WebKitWidgetsd.dll"/>
<file name="Qt5Widgetsd.dll"/>
<file name="Qt5XmlPatternsd.dll"/>
</assembly>
+4 -3
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="dlls" version="1.0.0.0" processorArchitecture="x86"/>
<file name="icuin52.dll"/>
<file name="icuuc52.dll"/>
<file name="icudt52.dll"/>
<file name="icuin53.dll"/>
<file name="icuuc53.dll"/>
<file name="icudt53.dll"/>
<file name="Qt5Core.dll"/>
<file name="Qt5Declarative.dll"/>
<file name="Qt5Gui.dll"/>
@@ -19,6 +19,7 @@
<file name="Qt5Script.dll"/>
<file name="Qt5Sql.dll"/>
<file name="Qt5Svg.dll"/>
<file name="Qt5WebChannel.dll"/>
<file name="Qt5WebKit.dll"/>
<file name="Qt5WebKitWidgets.dll"/>
<file name="Qt5Widgets.dll"/>
+4 -4
View File
@@ -255,7 +255,7 @@ void DownloadListWidgetDelegate::issueResume()
void DownloadListWidgetDelegate::issueDeleteAll()
{
if (QMessageBox::question(NULL, tr("Are you sure?"),
if (QMessageBox::question(nullptr, tr("Are you sure?"),
tr("This will remove all finished downloads from this list and from disk."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
emit removeDownload(-1, true);
@@ -264,7 +264,7 @@ void DownloadListWidgetDelegate::issueDeleteAll()
void DownloadListWidgetDelegate::issueDeleteCompleted()
{
if (QMessageBox::question(NULL, tr("Are you sure?"),
if (QMessageBox::question(nullptr, tr("Are you sure?"),
tr("This will remove all installed downloads from this list and from disk."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
emit removeDownload(-2, true);
@@ -273,7 +273,7 @@ void DownloadListWidgetDelegate::issueDeleteCompleted()
void DownloadListWidgetDelegate::issueRemoveFromViewAll()
{
if (QMessageBox::question(NULL, tr("Are you sure?"),
if (QMessageBox::question(nullptr, tr("Are you sure?"),
tr("This will remove all finished downloads from this list (but NOT from disk)."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
emit removeDownload(-1, false);
@@ -282,7 +282,7 @@ void DownloadListWidgetDelegate::issueRemoveFromViewAll()
void DownloadListWidgetDelegate::issueRemoveFromViewCompleted()
{
if (QMessageBox::question(NULL, tr("Are you sure?"),
if (QMessageBox::question(nullptr, tr("Are you sure?"),
tr("This will remove all installed downloads from this list (but NOT from disk)."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
emit removeDownload(-2, false);
+6 -6
View File
@@ -90,7 +90,7 @@ void DownloadListWidgetCompactDelegate::paintPendingDownload(int downloadIndex)
{
std::pair<int, int> nexusids = m_Manager->getPendingDownload(downloadIndex);
m_NameLabel->setText(tr("< mod %1 file %2 >").arg(nexusids.first).arg(nexusids.second));
if (m_SizeLabel != NULL) {
if (m_SizeLabel != nullptr) {
m_SizeLabel->setText("???");
}
m_DoneLabel->setVisible(true);
@@ -110,7 +110,7 @@ void DownloadListWidgetCompactDelegate::paintRegularDownload(int downloadIndex)
DownloadManager::DownloadState state = m_Manager->getState(downloadIndex);
if ((m_SizeLabel != NULL) && (state >= DownloadManager::STATE_READY)) {
if ((m_SizeLabel != nullptr) && (state >= DownloadManager::STATE_READY)) {
m_SizeLabel->setText(QString::number(m_Manager->getFileSize(downloadIndex) / 1048576));
}
@@ -242,7 +242,7 @@ void DownloadListWidgetCompactDelegate::issueResume()
void DownloadListWidgetCompactDelegate::issueDeleteAll()
{
if (QMessageBox::question(NULL, tr("Are you sure?"),
if (QMessageBox::question(nullptr, tr("Are you sure?"),
tr("This will remove all finished downloads from this list and from disk."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
emit removeDownload(-1, true);
@@ -251,7 +251,7 @@ void DownloadListWidgetCompactDelegate::issueDeleteAll()
void DownloadListWidgetCompactDelegate::issueDeleteCompleted()
{
if (QMessageBox::question(NULL, tr("Are you sure?"),
if (QMessageBox::question(nullptr, tr("Are you sure?"),
tr("This will remove all installed downloads from this list and from disk."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
emit removeDownload(-2, true);
@@ -260,7 +260,7 @@ void DownloadListWidgetCompactDelegate::issueDeleteCompleted()
void DownloadListWidgetCompactDelegate::issueRemoveFromViewAll()
{
if (QMessageBox::question(NULL, tr("Are you sure?"),
if (QMessageBox::question(nullptr, tr("Are you sure?"),
tr("This will permanently remove all finished downloads from this list (but NOT from disk)."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
emit removeDownload(-1, false);
@@ -269,7 +269,7 @@ void DownloadListWidgetCompactDelegate::issueRemoveFromViewAll()
void DownloadListWidgetCompactDelegate::issueRemoveFromViewCompleted()
{
if (QMessageBox::question(NULL, tr("Are you sure?"),
if (QMessageBox::question(nullptr, tr("Are you sure?"),
tr("This will permanently remove all installed downloads from this list (but NOT from disk)."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
emit removeDownload(-2, false);
+17 -17
View File
@@ -75,7 +75,7 @@ DownloadManager::DownloadInfo *DownloadManager::DownloadInfo::createFromMeta(con
QString metaFileName = filePath + ".meta";
QSettings metaFile(metaFileName, QSettings::IniFormat);
if (!showHidden && metaFile.value("removed", false).toBool()) {
return NULL;
return nullptr;
} else {
info->m_Hidden = metaFile.value("removed", false).toBool();
}
@@ -308,7 +308,7 @@ void DownloadManager::refreshList()
QString fileName = QDir::fromNativeSeparators(m_OutputDirectory) + "/" + file;
DownloadInfo *info = DownloadInfo::createFromMeta(fileName, m_ShowHidden);
if (info != NULL) {
if (info != nullptr) {
m_ActiveDownloads.push_front(info);
}
}
@@ -368,7 +368,7 @@ bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs,
}
if (QFile::exists(m_OutputDirectory + "/" + baseName) &&
(QMessageBox::question(NULL, tr("Download again?"), tr("A file with the same name has already been downloaded. "
(QMessageBox::question(nullptr, tr("Download again?"), tr("A file with the same name has already been downloaded. "
"Do you want to download it again? The new file will receive a different name."),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)) {
removePending(modID, fileID);
@@ -453,7 +453,7 @@ void DownloadManager::addNXMDownload(const QString &url)
qDebug("add nxm download: %s", qPrintable(url));
if (nxmInfo.game().compare(managedGame, Qt::CaseInsensitive) != 0) {
qDebug("download requested for wrong game (game: %s, url: %s)", qPrintable(managedGame), qPrintable(nxmInfo.game()));
QMessageBox::information(NULL, tr("Wrong Game"), tr("The download link is for a mod for \"%1\" but this instance of MO "
QMessageBox::information(nullptr, tr("Wrong Game"), tr("The download link is for a mod for \"%1\" but this instance of MO "
"has been set up for \"%2\".").arg(nxmInfo.game()).arg(managedGame), QMessageBox::Ok);
return;
}
@@ -608,7 +608,7 @@ void DownloadManager::pauseDownload(int index)
DownloadInfo *info = m_ActiveDownloads.at(index);
if (info->m_State == STATE_DOWNLOADING) {
if ((info->m_Reply != NULL) && (info->m_Reply->isRunning())) {
if ((info->m_Reply != nullptr) && (info->m_Reply->isRunning())) {
setState(info, STATE_PAUSING);
} else {
setState(info, STATE_PAUSED);
@@ -664,7 +664,7 @@ DownloadManager::DownloadInfo *DownloadManager::downloadInfoByID(unsigned int id
if (iter != m_ActiveDownloads.end()) {
return *iter;
} else {
return NULL;
return nullptr;
}
}
@@ -694,8 +694,8 @@ void DownloadManager::queryInfo(int index)
if (info->m_FileInfo->modID < 0) {
QString modIDString;
while (modIDString.isEmpty()) {
modIDString = QInputDialog::getText(NULL, tr("Please enter the nexus mod id"), tr("Mod ID:"), QLineEdit::Normal,
QString(), NULL, 0, Qt::ImhFormattedNumbersOnly);
modIDString = QInputDialog::getText(nullptr, tr("Please enter the nexus mod id"), tr("Mod ID:"), QLineEdit::Normal,
QString(), nullptr, 0, Qt::ImhFormattedNumbersOnly);
if (modIDString.isNull()) {
// canceled
return;
@@ -704,7 +704,7 @@ void DownloadManager::queryInfo(int index)
modIDString.clear();
}
}
info->m_FileInfo->modID = modIDString.toInt(NULL, 10);
info->m_FileInfo->modID = modIDString.toInt(nullptr, 10);
}
}
info->m_ReQueried = true;
@@ -962,13 +962,13 @@ DownloadManager::DownloadInfo *DownloadManager::findDownload(QObject *reply, int
// reverse search as newer, thus more relevant, downloads are at the end
for (int i = m_ActiveDownloads.size() - 1; i >= 0; --i) {
if (m_ActiveDownloads[i]->m_Reply == reply) {
if (index != NULL) {
if (index != nullptr) {
*index = i;
}
return m_ActiveDownloads[i];
}
}
return NULL;
return nullptr;
}
@@ -980,7 +980,7 @@ void DownloadManager::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
int index = 0;
try {
DownloadInfo *info = findDownload(this->sender(), &index);
if (info != NULL) {
if (info != nullptr) {
if (info->m_State == STATE_CANCELING) {
setState(info, STATE_CANCELED);
} else if (info->m_State == STATE_PAUSING) {
@@ -1007,7 +1007,7 @@ void DownloadManager::downloadReadyRead()
{
try {
DownloadInfo *info = findDownload(this->sender());
if (info != NULL) {
if (info != nullptr) {
info->m_Output.write(info->m_Reply->readAll());
}
} catch (const std::bad_alloc&) {
@@ -1059,7 +1059,7 @@ void DownloadManager::nxmDescriptionAvailable(int, QVariant userData, QVariant r
QVariantMap result = resultData.toMap();
DownloadInfo *info = downloadInfoByID(userData.toInt());
if (info == NULL) return;
if (info == nullptr) return;
info->m_FileInfo->categoryID = result["category_id"].toInt();
info->m_FileInfo->modName = result["name"].toString().trimmed();
info->m_FileInfo->newestVersion.parse(result["version"].toString());
@@ -1104,7 +1104,7 @@ void DownloadManager::nxmFilesAvailable(int, QVariant userData, QVariant resultD
}
DownloadInfo *info = downloadInfoByID(userData.toInt());
if (info == NULL) return;
if (info == nullptr) return;
QVariantList result = resultData.toList();
@@ -1323,7 +1323,7 @@ void DownloadManager::downloadFinished()
int index = 0;
DownloadInfo *info = findDownload(this->sender(), &index);
if (info != NULL) {
if (info != nullptr) {
QNetworkReply *reply = info->m_Reply;
QByteArray data;
if (reply->isOpen()) {
@@ -1437,7 +1437,7 @@ void DownloadManager::metaDataChanged()
int index = 0;
DownloadInfo *info = findDownload(this->sender(), &index);
if (info != NULL) {
if (info != nullptr) {
QString newName = getFileNameFromNetworkReply(info->m_Reply);
if (!newName.isEmpty() && (newName != info->m_FileName)) {
info->setName(getDownloadFileName(newName), true);
+1 -1
View File
@@ -439,7 +439,7 @@ private:
bool addDownload(const QStringList &URLs, int modID, int fileID, const MOBase::ModRepositoryFileInfo *fileInfo);
// important: the caller has to lock the list-mutex, otherwise the DownloadInfo-pointer might get invalidated at any time
DownloadInfo *findDownload(QObject *reply, int *index = NULL) const;
DownloadInfo *findDownload(QObject *reply, int *index = nullptr) const;
void removeFile(int index, bool deleteFile);
+2 -2
View File
@@ -65,7 +65,7 @@ static unsigned long long genHash(const char* fileName)
fileNameLower[i] = '\0';
char* ext = strrchr(fileNameLower, '.');
if (ext == NULL) {
if (ext == nullptr) {
ext = fileNameLower + strlen(fileNameLower);
}
@@ -117,7 +117,7 @@ static unsigned long long genHash(const char* fileName)
unsigned char *fileNameLowerU = reinterpret_cast<unsigned char*>(fileNameLower);
char* ext = strrchr(fileNameLower, '.');
if (ext == NULL) {
if (ext == nullptr) {
ext = fileNameLower + strlen(fileNameLower);
}
unsigned char *extU = reinterpret_cast<unsigned char*>(ext);
+11 -12
View File
@@ -31,7 +31,7 @@ using namespace MOShared;
EditExecutablesDialog::EditExecutablesDialog(const ExecutablesList &executablesList, QWidget *parent)
: TutorableDialog("EditExecutables", parent),
ui(new Ui::EditExecutablesDialog), m_CurrentItem(NULL), m_ExecutablesList(executablesList)
ui(new Ui::EditExecutablesDialog), m_CurrentItem(nullptr), m_ExecutablesList(executablesList)
{
ui->setupUi(this);
@@ -54,9 +54,7 @@ ExecutablesList EditExecutablesDialog::getExecutablesList() const
void EditExecutablesDialog::refreshExecutablesWidget()
{
QListWidget *executablesWidget = findChild<QListWidget*>("executablesListBox");
executablesWidget->clear();
ui->executablesListBox->clear();
std::vector<Executable>::const_iterator current, end;
m_ExecutablesList.getExecutables(current, end);
@@ -66,7 +64,7 @@ void EditExecutablesDialog::refreshExecutablesWidget()
temp.setValue(*current);
newItem->setData(Qt::UserRole, temp);
newItem->setTextColor(current->m_Custom ? QColor(Qt::black) : QColor(Qt::darkGray));
executablesWidget->addItem(newItem);
ui->executablesListBox->addItem(newItem);
}
ui->addButton->setEnabled(false);
@@ -89,7 +87,7 @@ void EditExecutablesDialog::resetInput()
ui->appIDOverwriteEdit->clear();
ui->overwriteAppIDBox->setChecked(false);
ui->closeCheckBox->setChecked(false);
m_CurrentItem = NULL;
m_CurrentItem = nullptr;
}
@@ -97,7 +95,8 @@ void EditExecutablesDialog::saveExecutable()
{
m_ExecutablesList.addExecutable(ui->titleEdit->text(), QDir::fromNativeSeparators(ui->binaryEdit->text()),
ui->argumentsEdit->text(), QDir::fromNativeSeparators(ui->workingDirEdit->text()),
(ui->closeCheckBox->checkState() == Qt::Checked) ? DEFAULT_CLOSE : DEFAULT_STAY,
(ui->closeCheckBox->checkState() == Qt::Checked) ? ExecutableInfo::CloseMOStyle::DEFAULT_CLOSE
: ExecutableInfo::CloseMOStyle::DEFAULT_STAY,
ui->overwriteAppIDBox->isChecked() ? ui->appIDOverwriteEdit->text() : "",
true, false);
}
@@ -130,7 +129,7 @@ void EditExecutablesDialog::on_browseButton_clicked()
{ // try to find java automatically
std::wstring binaryNameW = ToWString(binaryName);
WCHAR buffer[MAX_PATH];
if (::FindExecutableW(binaryNameW.c_str(), NULL, buffer) > (HINSTANCE)32) {
if (::FindExecutableW(binaryNameW.c_str(), nullptr, buffer) > (HINSTANCE)32) {
DWORD binaryType = 0UL;
if (!::GetBinaryTypeW(binaryNameW.c_str(), &binaryType)) {
qDebug("failed to determine binary type of \"%ls\": %lu", binaryNameW.c_str(), ::GetLastError());
@@ -206,14 +205,14 @@ void EditExecutablesDialog::on_titleEdit_textChanged(const QString &arg1)
bool EditExecutablesDialog::executableChanged()
{
if (m_CurrentItem != NULL) {
if (m_CurrentItem != nullptr) {
const Executable &selectedExecutable = m_CurrentItem->data(Qt::UserRole).value<Executable>();
return selectedExecutable.m_Arguments != ui->argumentsEdit->text()
|| selectedExecutable.m_SteamAppID != ui->appIDOverwriteEdit->text()
|| selectedExecutable.m_WorkingDirectory != QDir::fromNativeSeparators(ui->workingDirEdit->text())
|| selectedExecutable.m_BinaryInfo.absoluteFilePath() != QDir::fromNativeSeparators(ui->binaryEdit->text())
|| (selectedExecutable.m_CloseMO == DEFAULT_CLOSE) != ui->closeCheckBox->isChecked();
|| (selectedExecutable.m_CloseMO == ExecutableInfo::CloseMOStyle::DEFAULT_CLOSE) != ui->closeCheckBox->isChecked();
} else {
return false;
}
@@ -276,8 +275,8 @@ void EditExecutablesDialog::on_executablesListBox_clicked(const QModelIndex &cur
ui->binaryEdit->setText(QDir::toNativeSeparators(selectedExecutable.m_BinaryInfo.absoluteFilePath()));
ui->argumentsEdit->setText(selectedExecutable.m_Arguments);
ui->workingDirEdit->setText(QDir::toNativeSeparators(selectedExecutable.m_WorkingDirectory));
ui->closeCheckBox->setChecked(selectedExecutable.m_CloseMO == DEFAULT_CLOSE);
if (selectedExecutable.m_CloseMO == NEVER_CLOSE) {
ui->closeCheckBox->setChecked(selectedExecutable.m_CloseMO == ExecutableInfo::CloseMOStyle::DEFAULT_CLOSE);
if (selectedExecutable.m_CloseMO == ExecutableInfo::CloseMOStyle::NEVER_CLOSE) {
ui->closeCheckBox->setEnabled(false);
ui->closeCheckBox->setToolTip(tr("MO must be kept running or this application will not work correctly."));
} else {
+23 -15
View File
@@ -31,8 +31,14 @@ using namespace MOShared;
QDataStream &operator<<(QDataStream &out, const Executable &obj)
{
out << obj.m_Title << obj.m_BinaryInfo.absoluteFilePath() << obj.m_Arguments << obj.m_CloseMO
<< obj.m_SteamAppID << obj.m_WorkingDirectory << obj.m_Custom << obj.m_Toolbar;
out << obj.m_Title
<< obj.m_BinaryInfo.absoluteFilePath()
<< obj.m_Arguments
<< static_cast<std::underlying_type<ExecutableInfo::CloseMOStyle>::type>(obj.m_CloseMO)
<< obj.m_SteamAppID
<< obj.m_WorkingDirectory
<< obj.m_Custom
<< obj.m_Toolbar;
return out;
}
@@ -43,7 +49,7 @@ QDataStream &operator>>(QDataStream &in, Executable &obj)
in >> obj.m_Title >> binaryTemp >> obj.m_Arguments >> closeStyleTemp
>> obj.m_SteamAppID >> obj.m_WorkingDirectory >> obj.m_Custom >> obj.m_Toolbar;
obj.m_CloseMO = (CloseMOStyle)closeStyleTemp;
obj.m_CloseMO = static_cast<ExecutableInfo::CloseMOStyle>(closeStyleTemp);
obj.m_BinaryInfo.setFile(binaryTemp);
return in;
}
@@ -64,25 +70,28 @@ ExecutablesList::~ExecutablesList()
{
}
void ExecutablesList::init()
void ExecutablesList::init(IPluginGame *game)
{
std::vector<ExecutableInfo> executables = GameInfo::instance().getExecutables();
for (std::vector<ExecutableInfo>::const_iterator iter = executables.begin(); iter != executables.end(); ++iter) {
addExecutableInternal(ToQString(iter->title),
QDir::fromNativeSeparators(ToQString(GameInfo::instance().getGameDirectory())).append("/").append(ToQString(iter->binary)),
ToQString(iter->arguments), ToQString(iter->workingDirectory),
iter->closeMO, ToQString(iter->steamAppID));
Q_ASSERT(game != nullptr);
m_Executables.clear();
for (const ExecutableInfo &info : game->executables()) {
if (info.isValid()) {
addExecutableInternal(info.title(),
info.binary().absoluteFilePath(),
info.arguments().join(" "),
info.workingDirectory().absolutePath(),
info.closeMO(),
info.steamAppID());
}
}
}
void ExecutablesList::getExecutables(std::vector<Executable>::iterator &begin, std::vector<Executable>::iterator &end)
{
begin = m_Executables.begin();
end = m_Executables.end();
}
void ExecutablesList::getExecutables(std::vector<Executable>::const_iterator &begin,
std::vector<Executable>::const_iterator &end) const
{
@@ -90,7 +99,6 @@ void ExecutablesList::getExecutables(std::vector<Executable>::const_iterator &be
end = m_Executables.end();
}
const Executable &ExecutablesList::find(const QString &title) const
{
for (std::vector<Executable>::const_iterator iter = m_Executables.begin(); iter != m_Executables.end(); ++iter) {
@@ -166,7 +174,7 @@ void ExecutablesList::position(const QString &title, bool toolbar, int pos)
void ExecutablesList::addExecutable(const QString &title, const QString &executableName, const QString &arguments,
const QString &workingDirectory, CloseMOStyle closeMO, const QString &steamAppID,
const QString &workingDirectory, ExecutableInfo::CloseMOStyle closeMO, const QString &steamAppID,
bool custom, bool toolbar, int pos)
{
QFileInfo file(executableName);
@@ -218,7 +226,7 @@ void ExecutablesList::remove(const QString &title)
void ExecutablesList::addExecutableInternal(const QString &title, const QString &executableName,
const QString &arguments, const QString &workingDirectory,
CloseMOStyle closeMO, const QString &steamAppID)
ExecutableInfo::CloseMOStyle closeMO, const QString &steamAppID)
{
QFileInfo file(executableName);
if (file.exists()) {

Some files were not shown because too many files have changed in this diff Show More