Compare commits

...
92 Commits
Author SHA1 Message Date
Tannin ddf841400e Merge branch 'new_vfs_library' of https://github.com/TanninOne/modorganizer into new_vfs_library 2015-12-28 14:34:44 +01:00
Tannin 1bfc91046b removed get-prefix from many getters. removed const from managed_game variable.
other fixes
2015-12-28 14:33:30 +01:00
TanninOne d417229e6b executables installed as mods are now run through a proxy (not working yet) 2015-12-28 13:54:16 +01:00
TanninOne 1d1cd36957 slight fixes to transfer saves functionality 2015-12-28 13:50:20 +01:00
TanninOne c037b74b00 Merge branch 'master' into new_vfs_library 2015-12-23 11:38:34 +01:00
TanninOne 5adb3b377e Merge pull request #450 from ThosRTanner/master
Restore start download file method (2 of 3)
2015-12-21 15:12:22 +01:00
TanninOne d4326250fb Update readme.md 2015-12-21 15:11:55 +01:00
Thomas Tanner 2d43645b64 Restore start download file method (2 of 3) 2015-12-20 22:25:11 +00:00
TanninOne 9d260a43f6 Merge pull request #422 from ThosRTanner/master
remove last vestiges of GameInfo
2015-12-19 10:33:36 +01:00
TanninOne 9effaec234 Merge pull request #423 from ThosRTanner/patch-1
Adding fallout4 to the list of repositories
2015-12-19 10:31:59 +01:00
Tannin 502e950cde support for adding directories to the vfs that will act as create target for new files 2015-12-18 20:32:29 +01:00
Tannin 4908affbfc fixed display of savegame widget in case parsing fails 2015-12-18 20:28:03 +01:00
Tannin 8dc51895e3 improved file overwriting in transfersaves dialog 2015-12-18 20:20:06 +01:00
Tannin 568b2abc12 removed close-mo feature 2015-12-18 20:16:28 +01:00
Thomas Tanner c344714661 And found it was unreadable so ordered things a bit and replaced 2 line 'could use forward reference' with 1 2015-12-12 12:35:14 +00:00
Thomas Tanner a3a4d5441d Full details from include what you use for qt creator 'issue' box 2015-12-12 11:51:05 +00:00
Tannin e60e2858d8 Merge branch 'master' into new_vfs_library
Conflicts:
	src/gameinfoimpl.cpp
	src/installationmanager.cpp
	src/mainwindow.cpp
	src/organizercore.cpp
	src/organizercore.h
	src/organizerproxy.cpp
	src/organizerproxy.h
	src/savegamegamebryo.cpp
	src/savegamegamebyro.h
	src/selfupdater.h
	src/shared/fallout3info.cpp
	src/shared/fallout3info.h
	src/shared/falloutnvinfo.cpp
	src/shared/falloutnvinfo.h
	src/shared/gameinfo.cpp
	src/shared/gameinfo.h
	src/shared/oblivioninfo.cpp
	src/shared/oblivioninfo.h
	src/shared/skyriminfo.cpp
	src/shared/skyriminfo.h
	src/spawn.cpp
	src/transfersavesdialog.cpp
2015-12-07 21:00:22 +01:00
Tannin 495846534d - no longer displaying "not logged in". This was too confusing for some
- fixed files missing from vfs if parent directory exists in real destination dir
- implemented plugin api to access current profile
- steam game detection now also works for 64-bit games
- removed reference to archive tab from tutorial
- usvfs log level is now taken from config
- some cleanup
2015-12-07 20:09:34 +01:00
ThosRTanner 4a8c7306be Adding fallout4 to the list 2015-12-06 22:12:39 +00:00
Thomas Tanner 7b087f8f9d Facepalm moments - realised gameinfo init call is no longer needed. Removed all references 2015-12-06 21:10:37 +00:00
Thomas Tanner eff0f46872 Merge remote-tracking branch 'refs/remotes/TanninOne/master' 2015-12-06 17:44:17 +00:00
TanninOne 752bed064c Merge pull request #349 from ThosRTanner/issue/344
Fix for Issue 344 (1 of 4) - add code to get script extender and game versions
2015-12-06 17:32:18 +01:00
Thomas Tanner 750239bebb Merge branch 'master' into issue/344
# Conflicts:
#	src/gameinfoimpl.cpp
#	src/gameinfoimpl.h
#	src/shared/fallout3info.h
#	src/shared/falloutnvinfo.h
#	src/shared/gameinfo.h
#	src/shared/oblivioninfo.h
#	src/shared/skyriminfo.h
2015-12-06 15:49:56 +00:00
TanninOne 865c75a499 Merge branch 'ThosRTanner-master' 2015-12-06 15:10:45 +01:00
TanninOne eca56079d5 Merge branch 'master' of https://github.com/ThosRTanner/modorganizer into ThosRTanner-master 2015-12-06 15:03:38 +01:00
TanninOne e31cf3f2fd Merge pull request #372 from ThosRTanner/issue/356
Refactor gameinfo & 'shared' library to use game plugins (9 of 17)
2015-12-06 13:24:19 +01:00
Thomas Tanner 3670ab2528 Remove debugging code quick! 2015-12-06 12:07:25 +00:00
Thomas Tanner 235d893eb8 Gets rid of last vestiges of GameInfo apart from startup and hookdll
Working on sorting out savegame stuff
2015-12-05 19:13:05 +00:00
Thomas Tanner c2ed844eeb Merge remote-tracking branch 'remotes/TanninOne/master' into issue/356
Conflicts:
	src/downloadmanager.cpp
	src/mainwindow.cpp
	src/modinfo.cpp
	src/modinfo.h
	src/selfupdater.cpp
	src/shared/fallout3info.cpp
	src/shared/fallout3info.h
	src/shared/falloutnvinfo.cpp
	src/shared/falloutnvinfo.h
	src/shared/gameinfo.h
	src/shared/oblivioninfo.cpp
	src/shared/oblivioninfo.h
	src/shared/skyriminfo.cpp
	src/shared/skyriminfo.h
2015-12-05 12:49:12 +00:00
Thomas Tanner cb09ace972 Hoist self with own petard - add const 2015-12-05 10:43:19 +00:00
Thomas Tanner 0dedf5a875 Merge remote-tracking branch 'remotes/TanninOne/master' into issue/344
# Conflicts:
#	src/shared/fallout3info.h
#	src/shared/falloutnvinfo.h
#	src/shared/gameinfo.h
#	src/shared/oblivioninfo.h
#	src/shared/skyriminfo.h
2015-12-05 10:32:07 +00:00
Thomas Tanner ec9c78f8fa Merge remote-tracking branch 'TanninOne/master'
# Conflicts:
#	SConstruct
#	src/modinfo.cpp
#	src/modinfo.h
2015-12-05 10:21:44 +00:00
Thomas Tanner c07e48075e Most of work for savegame 2015-12-05 06:51:57 +00:00
TanninOne 688e149c96 Merge pull request #334 from ThosRTanner/issue/308
Allow right click on module to see web link if supplied in fomod
2015-12-04 22:30:35 +01:00
TanninOne 87d5fe28f6 Merge pull request #328 from ThosRTanner/issue/324
Cope with quotes in file- and module- names
2015-12-04 21:55:11 +01:00
TanninOne ce38a3bd33 Merge pull request #3 from ThosRTanner/archive_cleanup
Refactoring archive library (Part 3)
2015-12-04 17:51:45 +01:00
TanninOne 71b8c00592 Merge pull request #402 from ReadmeCritic/master
Update README URLs based on HTTP redirects
2015-12-04 17:49:46 +01:00
ReadmeCritic 20442cd4de Update README URLs based on HTTP redirects 2015-11-29 19:55:03 -08:00
Thomas Tanner c236078aa1 Fix up so that hookdll continues to work properly 2015-11-29 14:44:12 +00:00
Thomas Tanner 9a88a190eb Another cleanup and make the program not crash when looking at saves for the nonce 2015-11-29 12:55:49 +00:00
Thomas Tanner d03e4f45ef Abstract away the xxse_loader manipulation and make use of the 'ScriptExtender' feature instead
A note: This makes loadmechanism.cpp require xxse_loader.exe to exist, not the dll as other places get the version number from the exe.
2015-11-28 23:12:29 +00:00
Thomas Tanner 9e2bcffc32 Reworked startup considerably so now no longer dependant on GameInfo
Did some const correctness to the "managed_game" property as you shouldn't really be altering the plugin details whilst MO is running
2015-11-28 14:53:32 +00:00
Thomas Tanner 2e78a381ea Fix sconstruct issue from main line 2015-11-27 08:13:21 +00:00
Thomas Tanner bb56696f7e Merge remote-tracking branch 'TanninOne/master' into issue/324 2015-11-27 07:58:22 +00:00
Thomas Tanner ca54ee2e9a Renamed getNexusName to getGameShortName as previously because it hopefully isn't too nexus related. 2015-11-26 21:22:47 +00:00
Thomas Tanner 2025145ff6 Replaced the IPluginGame getNexusDisplayURL with some APIs in NexusInterface
It makes more sense to have them here as they have very little to do with the game, more to do with the origin of the mod.
2015-11-26 21:02:45 +00:00
Thomas Tanner 1b1fc247df Remove remaining gameInfo 2015-11-26 17:54:25 +00:00
Thomas Tanner dd37152eae This removes getNexusPage from GameInfo and is currently in the game plugin.
I'm looking to move it to the nexus interface though as it doesn't really relate to the game plugin.

I've also removed the MananagementURL as
- you can log into nexus without needing to specify the game
- See above - it doesn't belong with the game plugin

This gets rid of all dependencies bar game saving and logging in
2015-11-26 17:48:50 +00:00
Thomas Tanner 82e6c98043 Replace last occurrence of GameInfo::getNexusGameID and remove a whole load of gameinfo.h includes 2015-11-26 07:39:35 +00:00
Thomas Tanner 29dadf52f1 Forgot to remove the redundant member 2015-11-25 20:40:34 +00:00
Thomas Tanner 38c5899fef Replace GameInfo::getNexusInfoUrl with IPluginGame::getNexusManagementUrl
also added getNexusDisplayUrl for the other variant of getNexusPage

Removed skyrim static versions

note that Nexusinterface is now passed a game plugin rather than a URL and a game ID if you want to override the current game
2015-11-25 19:31:05 +00:00
Thomas Tanner b9b12ca765 Bunch of const correctness changes. There shouldn't be any update of plugin games once MO has started 2015-11-25 14:23:58 +00:00
Thomas Tanner 78b686b2bc Removes all references to GameInfo::getGameDirectory apart from one during startup
Did some const correctness improvements

Also may have fixed a potential crash as the Profile copy constructor didn't copy the m_GamePlugin membber
2015-11-25 08:22:40 +00:00
Thomas Tanner 42a68689fe Replace GameInfo::getNexusModID with IPluginGame::getNexusModOrganizerID()
Also implement IPluginGame::getNexusGameID() but not hooked it in yet.
2015-11-24 16:16:57 +00:00
Thomas Tanner c7d583bcf1 Replace GameInfo::getLoadorderMechanism with IPluginGame::getLoadOrderMechanism 2015-11-24 14:21:19 +00:00
Thomas Tanner d6da51536f Merge branch 'issue/356' of https://github.com/ThosRTanner/modorganizer into issue/356 2015-11-24 09:52:54 +00:00
Thomas Tanner d4a287a4cc Updated comments so I can see where I'm going 2015-11-24 09:51:46 +00:00
Thomas Tanner 91576257bc Updated comments so I can see where I'm going 2015-11-24 09:50:02 +00:00
Thomas Tanner a7ef089650 Use IPluginGame::getIniFiles throughout.
Also removed the default constructor from Profile class and stopped registering it as a QMetaObject (which it is the only reason it is there).
2015-11-24 09:45:45 +00:00
Thomas Tanner 37c3bea7dd Removes all uses of GameInfo::getShortName, replaced by IPluginGame::getNexustName 2015-11-24 06:58:29 +00:00
Thomas Tanner 3659284ab6 Remove most instances of GameInfo::getname, and transfer getDLCPlugins to the plugingame interface
Also commented out startDownloadNexusFile as it doesn't appear to be used anywhere
2015-11-23 18:32:30 +00:00
Thomas Tanner 2a50683133 Removed 'requiresSteam' which is only used in one place and might or might not be game related 2015-11-23 13:35:48 +00:00
Thomas Tanner efaba90706 Final eradication of igameinfo and adding python wrappers for IPluginGame 2015-11-22 21:18:56 +00:00
Thomas Tanner 159501d076 Removes igameinfo.h from everywhere apart from (sort of) the pythonrunner plugin.
Also comment out the filemapping function because it's large and doesn't appear to be used anywhere
2015-11-22 08:46:46 +00:00
Thomas Tanner 4dbb3b148d Replace some instances of qApp->property("managed_game") with the saved pointer.
Pedantic note: This doesn't help the possibility of supporting multiple executables greatly, we'd have to have a lot of register-for-change events.
2015-11-21 17:26:34 +00:00
Thomas Tanner 408b7933d2 Replace GameInfo::path with iPluginGame::gameDirectory (or dataDirectory where applicable) 2015-11-21 16:32:48 +00:00
Thomas Tanner efb54100dc Removal of (get)BinaryName 2015-11-21 12:30:33 +00:00
Thomas Tanner f339cc8431 Member variable unused so removed it.
Leaves one asking *why* the datapath can be inside the game directory.
2015-11-20 19:34:09 +00:00
Thomas Tanner 49de6e8d25 Get rid of GameIfo::getOrganizerDirectory and associated member variable
qApp->getProperty("dataPath") can be used instead (and is pretty much everywhere else) so it's unnecessary
2015-11-20 18:07:06 +00:00
Thomas Tanner 7f9af7f93e Merge remote-tracking branch 'refs/remotes/TanninOne/master' 2015-11-18 20:51:52 +00:00
Thomas Tanner 9ac845779a Fixup 2015-11-18 20:51:27 +00:00
Thomas Tanner d1932bfc8e Better header matching 2015-11-12 21:48:40 +00:00
Thomas Tanner a284cbf232 Yet more changes for include what you use, including a moderate hack for compiling stackdata with clang 2015-11-09 18:16:58 +00:00
Thomas Tanner fe54b6c46a More cleanups 2015-11-08 23:18:16 +00:00
Thomas Tanner d82ca00733 Separated out the include what you use mappings into separate files, more improvements 2015-11-08 09:46:30 +00:00
Thomas Tanner 1a12b1f1f6 Decided it shouldn't be an error if i can't get information about the file. 2015-11-04 21:39:14 +00:00
Thomas Tanner 184cff8a77 Add support for version dependency checks 2015-11-01 18:27:34 +00:00
Thomas Tanner f1aaf92afb Improve diagnostics if IWYU is enabled
Few small cleanups from clang
2015-10-31 19:40:33 +00:00
Thomas Tanner 8f64a1d136 Proper integraton of IWYU into the build (including massaging clang errors into the issues tab).
Note: There is at least one ug in QT that stops thing s copiling because it doesn't undertand clangs version
2015-10-25 21:07:02 +00:00
Thomas Tanner b1cfc45853 Make the IWYU generation generic 2015-10-25 08:36:30 +00:00
Thomas Tanner 76bee42dd1 umm. windows hardlinks weren't quite working as expected 2015-10-18 19:00:14 +01:00
Thomas Tanner 0f8ae51459 Added support for include-what-you-use in a very simplistic fashion to the Scons build. This isn't exactly production ready because the qt headers are a nightmarish web of interdependencies but it's useful for checking.
I've also removed a few unused include files it detected and corrected some things that upset clang in a big way.
2015-10-17 19:05:00 +01:00
Thomas Tanner dfdf80417e Merge remote-tracking branch 'refs/remotes/TanninOne/master' 2015-10-15 19:09:08 +01:00
Thomas Tanner d4754f4d3c Fix for some nexus fomods having the old version of the mod link and not the new version.
Also fixed a lot of const correctness things
2015-10-15 18:44:39 +01:00
Thomas Tanner 1cb0a49dfc Merge remote-tracking branch 'TanninOne/master' into issue/308 2015-10-15 13:34:32 +01:00
Thomas Tanner 9d88ca13b9 Added functionality to use the web page link in a fomod to supply an optional web page.
Also refactored modinfo into multiple files (as the actual types are opaque anyway) and cleaned up the headers a bit

I also changed 'visit on nexus' from the menu not to open the downloads tab because it was a little confusing
2015-10-15 13:34:01 +01:00
Thomas Tanner ca6d7c7d11 Merge branch 'master' into archive_cleanup 2015-10-12 12:54:49 +01:00
Thomas Tanner 077a58f410 Merge branch 'master' of https://github.com/TanninOne/modorganizer into archive_cleanup
# Conflicts:
#	src/installationmanager.cpp
2015-10-12 12:54:19 +01:00
Thomas Tanner 9d4b7a1df0 Merge remote-tracking branch 'TanninOne/master' into issue/324 2015-10-11 21:12:59 +01:00
Thomas Tanner 9a7b0ee2c7 Fixes for quotes in module names:
Treat the module name from Nexus as HTML and convert into plain text.
Allow ' in a module name
Also removed the ::tr1:: namespace in the regexs
2015-10-11 21:12:37 +01:00
Thomas Tanner f5c86bc22c Merge branch 'master' of https://github.com/TanninOne/modorganizer into archive_cleanup 2015-10-02 23:01:34 +01:00
Thomas Tanner 2fb4917111 Changes to go with cleaned up archive library 2015-09-27 13:29:04 +01:00
87 changed files with 5559 additions and 3160 deletions
+170 -4
View File
@@ -37,6 +37,14 @@ def setup_config_variables():
if 'ZLIBPATH' in os.environ:
zlibpath = os.environ['ZLIBPATH']
git = 'git'
if 'GIT' in os.environ:
git = os.environ['GIT']
mercurial = 'hg'
if 'MERCURIAL' in os.environ:
hg = os.environ['HG']
vars = Variables('scons_configure.py')
vars.AddVariables(
PathVariable('BOOSTPATH', 'Set to point to your boost directory',
@@ -50,12 +58,14 @@ def setup_config_variables():
PathVariable.PathIsDir),
PathVariable('SEVENZIPPATH', 'Path to 7zip sources', sevenzippath,
PathVariable.PathIsDir),
PathVariable('ZLIBPATH', 'Path to zlib install', zlibpath,
PathVariable.PathIsDir).
PathVariable('ZLIBPATH', 'Path to zlib install', zlibpath,
PathVariable.PathIsDir),
PathVariable('ZLIBPATH', 'Path to zlib install', zlibpath,
PathVariable.PathIsDir)
PathVariable('GIT', 'Path to git executable', git,
PathVariable.PathIsFile),
PathVariable('MERCURIAL', 'Path to hg executable', mercurial,
PathVariable.PathIsFile),
PathVariable('IWYU', 'Path to include-what-you-use executable', None,
PathVariable.PathIsFile)
)
return vars
@@ -235,6 +245,157 @@ def DisableQtModules(self, *modules):
for module in modules:
self['CPPPATH'].remove(os.path.join('$QTDIR', 'include', 'QT' + module))
def setup_IWYU(env):
import SCons.Defaults
import SCons.Builder
original_shared = SCons.Defaults.SharedObjectEmitter
original_static = SCons.Defaults.StaticObjectEmitter
def DoIWYU(env, source, target):
for i in range(len(source)):
s = source[i]
dir, name = os.path.split(str(s)) # I'm sure theres a way of getting this from scons
# Don't bother looking at moc files and 7zip source
if not name.startswith('moc_') and \
not dir.startswith(env['SEVENZIPPATH']):
# Put the .iwyu in the same place as the .obj
targ = os.path.splitext(str(target[i]))[0]
env.Depends(env.IWYU(targ + '.iwyu', s), target[i])
def shared_emitter(target, source, env):
DoIWYU(env, source, target)
return original_shared(target, source, env)
def static_emitter(target, source, env):
DoIWYU(env, source, target)
return original_static(target, source, env)
SCons.Defaults.SharedObjectEmitter = shared_emitter
SCons.Defaults.StaticObjectEmitter = static_emitter
def emitter(target, source, env):
env.Depends(target, env['IWYU_MAPPING_FILE'])
env.Depends(target, env['IWYU_MASSAGE'])
return target, source
def _concat_list(prefixes, list, suffixes, env, f=lambda x: x, target=None, source=None):
""" Creates a new list from 'list' by first interpolating each element
in the list using the 'env' dictionary and then calling f on the
list, and concatenate the 'prefix' and 'suffix' LISTS onto each element of the list.
A trailing space on the last element of 'prefix' or leading space on the
first element of 'suffix' will cause them to be put into separate list
elements rather than being concatenated.
"""
if not list:
return list
l = f(SCons.PathList.PathList(list).subst_path(env, target, source))
if l is not None:
list = l
# This bit replaces current concat_ixes
result = []
def process_stringlist(s):
return [ str(env.subst(p, SCons.Subst.SUBST_RAW))
for p in Flatten([s]) if p != '' ]
# ensure that prefix and suffix are strings
prefixes = process_stringlist(prefixes)
prefix = ''
if len(prefixes) != 0:
if prefixes[-1][-1] != ' ':
prefix = prefixes.pop()
suffixes = process_stringlist(suffixes)
suffix = ''
if len(suffixes) != 0:
if suffixes[-1][0] != ' ':
suffix = suffixes.pop(0)
for x in list:
if isinstance(x, SCons.Node.FS.File):
result.append(x)
continue
x = str(x)
if x:
result.append(prefixes)
if prefix:
if x[:len(prefix)] != prefix:
x = prefix + x
result.append(x)
if suffix:
if x[-len(suffix):] != suffix:
result[-1] = result[-1] + suffix
result.append(suffixes)
return result
env['_concat_list'] = _concat_list
# Note to self: command 2>&1 | other command appears to work as I would hope
# except it eats errors
iwyu = SCons.Builder.Builder(
action=[
'$IWYU_MASSAGE $TARGET $IWYU $IWYU_FLAGS $IWYU_MAPPINGS $IWYU_COMCOM $SOURCE'
],
emitter=emitter,
suffix='.iwyu',
src_suffix='.cpp')
env.Append(BUILDERS={'IWYU': iwyu})
# Sigh - IWYU is a right bum as it doesn't recognise /I so I have to
# duplicate most of the usual stuff
env['IWYU_FLAGS'] = [
# This might turn down the output a bit. I hope
'-Xiwyu', '--transitive_includes_only',
# Seem to be needed for a windows build
'-D_MT', '-D_DLL', '-m32',
# This is something to do with clang, windows and boost headers
'-DBOOST_USE_WINDOWS_H',
# There's a lot of this, disabled for now
'-Wno-inconsistent-missing-override',
# Mark boost and Qt headers as system headers to disable a lot of noise.
# I'm sure there has to be a better way than saying 'prefix=Q'
'--system-header-prefix=Q',
'--system-header-prefix=boost/',
# Should be able to get this info from our setup really
'-fmsc-version=1800', '-D_MSC_VER=1800',
# clang and qt don't agree about these because clang says its gcc 4.2
# and QT doesn't realise it's clang
'-DQ_COMPILER_INITIALIZER_LISTS',
'-DQ_COMPILER_DECLTYPE',
'-DQ_COMPILER_VARIADIC_TEMPLATES',
]
if env['CONFIG'] == 'debug':
env['IWYU_FLAGS'] += [ '-D_DEBUG' ]
env['IWYU_DEFPREFIX'] = '-D'
env['IWYU_DEFSUFFIX'] = ''
env['IWYU_CPPDEFFLAGS'] = '${_defines(IWYU_DEFPREFIX, CPPDEFINES, IWYU_DEFSUFFIX, __env__)}'
env['IWYU_INCPREFIX'] = '-I'
env['IWYU_INCSUFFIX'] = ''
env['IWYU_CPPINCFLAGS'] = '$( ${_concat(IWYU_INCPREFIX, CPPPATH, IWYU_INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
env['IWYU_PCH_PREFIX'] = '-include' # Amazingly this works without a space
env['IWYU_PCH_SUFFIX'] = ''
env['IWYU_PCHFILES'] = '$( ${_concat(IWYU_PCH_PREFIX, PCHSTOP, IWYU_PCH_SUFFIX, __env__, target=TARGET, source=SOURCE)} $)'
env['IWYU_COMCOM'] = '$IWYU_CPPDEFFLAGS $IWYU_CPPINCFLAGS $IWYU_PCHFILES $CCPDBFLAGS'
env['IWYU_MAPPING_PREFIX'] = ['-Xiwyu', '--mapping_file=']
env['IWYU_MAPPING_SUFFIX'] = ''
env['IWYU_MAPPINGS'] = '$( ${_concat_list(IWYU_MAPPING_PREFIX, IWYU_MAPPING_FILE, IWYU_MAPPING_SUFFIX, __env__, f=lambda l: [ str(x) for x in l], target=TARGET, source=SOURCE)} $)'
env['IWYU_MAPPING_FILE'] = [
env.File('#/modorganizer/qt5_4.imp'),
env.File('#/modorganizer/win.imp'),
env.File('#/modorganizer/mappings.imp')
]
env['IWYU_MASSAGE'] = env.File('#/modorganizer/massage_messages.py')
# Create base environment
vars = setup_config_variables()
@@ -351,6 +512,11 @@ else:
env.AppendUnique(CPPFLAGS = [ '/O2', '/MD' ])
env.AppendUnique(LINKFLAGS = [ '/OPT:REF', '/OPT:ICF' ])
# Set up include what you use. Add this as an extra compile step. Note it
# doesn't currently generate an output file (use the output instead!).
if 'IWYU' in env:
setup_IWYU(env)
# /OPT:REF removes unreferenced code
# for release, use /OPT:ICF (comdat folding: coalesce identical blocks of code)
+30
View File
@@ -0,0 +1,30 @@
[
# for boost???
# These are probably correct but might need a revisit as if you look at the boost documentation pages, it
# can give you huge lists of alternate includes...
{ symbol: [ "BOOST_FOREACH", "private", "<boost/foreach.hpp>", "public" ] },
{ include: [ "@\"boost/bind/.*\"", "private", "<boost/bind.hpp>", "public" ] },
{ include: [ "@\"boost/algorithm/string/.*\"", "private", "<boost/algorithm/string.hpp>", "public" ] },
{ include: [ "@\"boost/assign/.*\"", "private", "<boost/assign.hpp>", "public" ] },
{ include: [ "@\"boost/filesystem/.*\"", "private", "<boost/filesystem.hpp>", "public" ] },
{ include: [ "@\"boost/format/.*\"", "private", "<boost/format.hpp>", "public" ] },
{ include: [ "@\"boost/function/.*\"", "private", "<boost/function.hpp>", "public" ] },
{ include: [ "@\"boost/local/.*\"", "private", "<boost/locale.hpp>", "public" ] },
{ include: [ "@\"boost/python/.*\"", "private", "<boost/python.hpp>", "public" ] },
{ include: [ "@\"boost/signals2/.*\"", "private", "<boost/signals2.hpp>", "public" ] },
{ include: [ "\"boost/smart_ptr/scoped_array.hpp\"", "private", "<boost/scoped_array.hpp>", "public" ] },
{ include: [ "\"boost/smart_ptr/shared_ptr.hpp\"", "private", "<boost/shared_ptr.hpp>", "public" ] },
# this appears to be excessive
#{ include: [ "@\"boost/thread/.*\"", "private", "<boost/thread.hpp>", "public" ] },
# And this is specific to us
{ include: [ "\"appconfig.inc\"", "private", "\"appconfig.h\"", "public" ] },
]
# Ones I don't yet know how to deal with
#include "boost/fusion/container/vector/vector10_fwd.hpp" // for fusion
#include "boost/iterator/iterator_facade.hpp" // for operator!=
#include "boost/iterator/iterator_facade.hpp"
+149
View File
@@ -0,0 +1,149 @@
from collections import defaultdict
import fileinput
import re
import subprocess
import sys
"""
source/organizer/aboutdialog.h should add these lines:
#include <QObject> // for Q_OBJECT, slots
#include <QString> // for QString
class QListWidgetItem;
class QWidget;
source/organizer/aboutdialog.h should remove these lines:
- #include <QListWidgetItem> // lines 25-25
- #include <utility> // lines 28-28
- #include <vector> // lines 27-27
- class DownloadManager; // lines 47-47
The full include-list for source/organizer/aboutdialog.h:
#include <QDialog> // for QDialog
#include <QObject> // for Q_OBJECT, slots
#include <QString> // for QString
#include <map> // for map
class QListWidgetItem;
class QWidget;
namespace Ui { class AboutDialog; } // lines 31-31
---
"""
removing = None
includes = dict()
adding = None
added = dict()
foundline = None
errors = False
messages = defaultdict(list)
def process_next_line(line, outfile):
""" Read a line of output/error from include-what-you use
Turn clang errors into a form QT creator recognises
Raise warnings for unneeded includes
"""
global removing
global includes
global foundline
global errors
global added
global adding
line = line.rstrip()
print >> outfile, line
if line.endswith(' should remove these lines:'):
adding = None
removing = (line.split(' '))[0]
elif line.endswith(' should add these lines:'):
removing = None
adding = (line.split(' '))[0]
elif line == '' or line.startswith(' the full include-list'):
adding = None
removing = None
elif adding:
m = re.match(r'.*class (.*);', line)
if m:
added[m.group(1)] = (adding, line)
else:
added[line] = (adding, line)
elif removing:
# Really we should stash these so that if we get a 'class xxx' in
# the add lines we can print it here. also we could do the case
# fixing.
m = re.match(r'- #include [<"](.*)[">] +// lines (.*)-', line)
if m:
foundline = m.group(2)
if m.group(1) in added:
messages[removing].append(
'%s(%s) : warning I0004: Replace include of %s with '
'forward reference %s' % (
removing, m.group(2), m.group(1), added[m.group(1)][1]))
del added[m.group(1)]
else:
messages[removing].append(
'%s(%s) : warning I0001: Unnecessary include of %s' % (
removing, m.group(2), m.group(1)))
else:
m = re.match(r'- (.*) +// lines (.*)-', line)
if m:
messages[removing].append(
'%s(%s) : warning I0002: Unnecessary forward ref of %s' % (
removing, m.group(2), m.group(1)))
else:
print '********* I got confused **********'
elif line.startswith('In file included from'):
line = re.sub(r'^(In file included from)(.*):(\d+):',
r' \2(\3) : \1 here',
line)
# Note; QT Creator seems to be unwilling to let you double click the
# line to select the code in question if you get a string of these, not
# sure why.
elif ': note:' in line:
line = ' ' + re.sub(r':(\d+):\d+: note:', r'(\1) : note:', line)
else:
# Replace clang :line:column: type: with ms (line) : type nnnn:
line = re.sub(r':(\d+):\d+: ([^:]*):', r'(\1) : \2 I1234:', line)
if ' : error I1234:' in line:
errors = True
print line
outfile = open(sys.argv[1], 'w')
process = subprocess.Popen(sys.argv[2:],
stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
while True:
output = process.stdout.readline()
if output == '' and process.poll() is not None:
break
if output:
process_next_line(output, outfile)
# A note: We should probably do some work as we use the source code line for
# messages in include files...
if foundline is None:
foundline = '1'
for add in added:
messages[added[add][0]].append(
'%s(%s) : warning I0003: Need to include %s' % (
added[add][0], foundline, added[add][1]))
for file in sorted(messages.keys(), reverse = True):
for line in messages[file]:
print line
rc = process.poll()
# The return code you get appears to be more to do with the amount of output
# generated than any real error, so instead we should error if any ': error:'
# lines are detected
if errors:
sys.exit(1)
+2478
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -20,7 +20,7 @@ Here is a complete list:
* https://github.com/TanninOne/modorganizer-lootcli
* https://github.com/TanninOne/modorganizer-helper
* https://github.com/TanninOne/modorganizer-tool_nmmimport
* https://github.com/TanninOne/modorganizer-tool_pyniedit
* https://github.com/TanninOne/modorganizer-tool_configurator
* https://github.com/TanninOne/modorganizer-tool_inieditor
* https://github.com/TanninOne/modorganizer-preview_base
* https://github.com/TanninOne/modorganizer-diagnose_basic
@@ -32,9 +32,11 @@ Here is a complete list:
* https://github.com/TanninOne/modorganizer-game_skyrim
* https://github.com/TanninOne/modorganizer-game_oblivion
* https://github.com/TanninOne/modorganizer-game_fallout3
* https://github.com/TanninOne/modorganizer-game_fallout4
* https://github.com/TanninOne/modorganizer-game_falloutnv
* https://github.com/TanninOne/modorganizer-game_gamebryo
* https://github.com/TanninOne/modorganizer-game_features
* https://github.com/TanninOne/modorganizer-check_fnis
* https://github.com/TanninOne/modorganizer-plugin_python
* https://github.com/TanninOne/modorganizer-bsa_extractor
* https://github.com/TanninOne/usvfs
+15 -6
View File
@@ -35,6 +35,11 @@ SET(organizer_SRCS
modlist.cpp
modinfodialog.cpp
modinfo.cpp
modinfobackup.cpp
modinfoforeign.cpp
modinfooverwrite.cpp
modinforegular.cpp
modinfowithconflictinfo.cpp
messagedialog.cpp
mainwindow.cpp
main.cpp
@@ -61,7 +66,6 @@ SET(organizer_SRCS
moapplication.cpp
profileinputdialog.cpp
icondelegate.cpp
gameinfoimpl.cpp
csvbuilder.cpp
savetextasdialog.cpp
qtgroupingproxy.cpp
@@ -127,6 +131,11 @@ SET(organizer_HDRS
modlist.h
modinfodialog.h
modinfo.h
modinfobackup.h
modinfoforeign.h
modinfooverwrite.h
modinforegular.h
modinfowithconflictinfo.h
messagedialog.h
mainwindow.h
loghighlighter.h
@@ -152,7 +161,6 @@ SET(organizer_HDRS
moapplication.h
profileinputdialog.h
icondelegate.h
gameinfoimpl.h
csvbuilder.h
savetextasdialog.h
qtgroupingproxy.h
@@ -279,16 +287,17 @@ SET(project_path "${default_project_path}" CACHE PATH "path to the other mo proj
SET(lib_path "${project_path}/../../install/libs")
MESSAGE(STATUS ${lib_path})
MESSAGE(STATUS ${project_path})
INCLUDE_DIRECTORIES(${project_path}/uibase/src
${project_path}/bsatk/src
${project_path}/esptk/src
${project_path}/archive/src
${project_path}/../usvfs/usvfs
${project_path}/game_gamebryo/src
${project_path}/game_features/src)
MESSAGE(STATUS ${project_path}/gameGamebryo/src)
INCLUDE_DIRECTORIES(shared ${ZLIB_INCLUDE_DIRS})
LINK_DIRECTORIES(${lib_path}
${project_path}/../zlib/lib)
@@ -312,7 +321,7 @@ TARGET_LINK_LIBRARIES(ModOrganizer
SET_TARGET_PROPERTIES(ModOrganizer PROPERTIES COMPILE_FLAGS /GL)
SET_TARGET_PROPERTIES(ModOrganizer PROPERTIES LINK_FLAGS_RELWITHDEBINFO
"/LTCG /INCREMENTAL:NO /LARGEADDRESSAWARE /OPT:REF /OPT:ICF")
"/LARGEADDRESSAWARE ${OPTIMIZE_LINK_FLAGS}")
QT5_USE_MODULES(ModOrganizer Widgets Declarative Network WebKitWidgets)
+14 -4
View File
@@ -67,7 +67,6 @@ env.Uic(env.Glob('*.ui'))
env.RequireLibraries('uibase', 'shared', 'bsatk', 'esptk')
env.AppendUnique(LIBS = [
'shell32',
'user32',
@@ -96,6 +95,12 @@ env['CPPPATH'] += [
'${BOOSTPATH}',
]
#########################FUDGE###############################
env['CPPPATH'] += [
'../plugins/gameGamebryo',
]
#############################################################
env.AppendUnique(CPPDEFINES = [
'_UNICODE',
'_CRT_SECURE_NO_WARNINGS',
@@ -105,7 +110,11 @@ env.AppendUnique(CPPDEFINES = [
'QT_MESSAGELOGCONTEXT'
])
env.AppendUnique(CPPFLAGS = [ '-wd4100', '-wd4127', '-wd4512', '-wd4189' ])
# Boost produces very long names with msvc truncates. Doesn't seem to cause
# problems.
# Also note to remove the -wd4100 I hacked the boost headers (tagged_argument.hpp)
# appropriately.
env.AppendUnique(CPPFLAGS = [ '-wd4503' ])
env.AppendUnique(LINKFLAGS = [
'/SUBSYSTEM:WINDOWS',
@@ -114,8 +123,9 @@ env.AppendUnique(LINKFLAGS = [
# modeltest is optional and it doesn't compile anyway...
cpp_files = [
x for x in Glob('*.cpp')
if x.name != 'modeltest.cpp' and x.name != 'aboutdialog.cpp'
x for x in env.Glob('*.cpp', source = True)
if x.name != 'modeltest.cpp' and x.name != 'aboutdialog.cpp' and \
not x.name.startswith('moc_') # I think this is a strange bug
]
about_env = env.Clone()
+1 -3
View File
@@ -21,8 +21,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QRegExp>
#include <map>
#include <algorithm>
#include <boost/assign.hpp>
namespace BBCode {
@@ -80,7 +78,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());
+2 -4
View File
@@ -18,18 +18,16 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "browserdialog.h"
#include "ui_browserdialog.h"
#include "browserview.h"
#include "messagedialog.h"
#include "report.h"
#include "persistentcookiejar.h"
#include "json.h"
#include <utility.h>
#include <gameinfo.h>
#include "settings.h"
#include <QNetworkCookieJar>
#include <QNetworkCookie>
#include <QMenu>
+3 -1
View File
@@ -21,9 +21,11 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#define NEXUSVIEW_H
class QEvent;
class QUrl;
class QWidget;
#include <QWebView>
#include <QWebPage>
#include <QTabWidget>
/**
* @brief web view used to display a nexus page
+5 -3
View File
@@ -18,9 +18,10 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "categories.h"
#include <utility.h>
#include <report.h>
#include <gameinfo.h>
#include <QObject>
#include <QFile>
#include <QDir>
@@ -29,7 +30,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
using namespace MOBase;
using namespace MOShared;
CategoryFactory* CategoryFactory::s_Instance = nullptr;
@@ -317,9 +317,11 @@ int CategoryFactory::getCategoryIndex(int ID) const
int CategoryFactory::getCategoryID(const QString &name) const
{
auto iter = std::find_if(m_Categories.begin(), m_Categories.end(), [name] (const Category &cat) -> bool {
auto iter = std::find_if(m_Categories.begin(), m_Categories.end(),
[name] (const Category &cat) -> bool {
return cat.m_Name == name;
});
if (iter != m_Categories.end()) {
return iter->m_ID;
} else {
+7 -2
View File
@@ -18,10 +18,13 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "directoryrefresher.h"
#include "iplugingame.h"
#include "utility.h"
#include "report.h"
#include "modinfo.h"
#include <gameinfo.h>
#include <QApplication>
#include <QDir>
#include <QString>
@@ -141,7 +144,9 @@ void DirectoryRefresher::refresh()
m_DirectoryStructure = new DirectoryEntry(L"data", nullptr, 0);
std::wstring dataDirectory = GameInfo::instance().getGameDirectory() + L"\\data";
IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
std::wstring dataDirectory = QDir::toNativeSeparators(game->dataDirectory().absolutePath()).toStdWString();
m_DirectoryStructure->addFromOrigin(L"data", dataDirectory, 0);
// TODO what was the point of having the priority in this tuple? the list is already sorted by priority
+20 -7
View File
@@ -18,18 +18,19 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "downloadmanager.h"
#include "nxmurl.h"
#include "nexusinterface.h"
#include "nxmaccessmanager.h"
#include <gameinfo.h>
#include "iplugingame.h"
#include <nxmurl.h>
#include <taskprogressmanager.h>
#include "utility.h"
#include "json.h"
#include "selectiondialog.h"
#include "bbcode.h"
#include <utility.h>
#include <report.h>
#include <QTimer>
#include <QFileInfo>
#include <QRegExp>
@@ -37,6 +38,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QInputDialog>
#include <QMessageBox>
#include <QCoreApplication>
#include <QTextDocument>
#include <boost/bind.hpp>
#include <regex>
@@ -447,7 +450,7 @@ void DownloadManager::addNXMDownload(const QString &url)
{
NXMUrl nxmInfo(url);
QString managedGame = ToQString(MOShared::GameInfo::instance().getGameShortName());
QString managedGame = m_ManagedGame->gameShortName();
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()));
@@ -909,10 +912,10 @@ QString DownloadManager::getDownloadFileName(const QString &baseName) const
QString DownloadManager::getFileNameFromNetworkReply(QNetworkReply *reply)
{
if (reply->hasRawHeader("Content-Disposition")) {
std::tr1::regex exp("filename=\"(.*)\"");
std::regex exp("filename=\"(.*)\"");
std::tr1::cmatch result;
if (std::tr1::regex_search(reply->rawHeader("Content-Disposition").constData(), result, exp)) {
std::cmatch result;
if (std::regex_search(reply->rawHeader("Content-Disposition").constData(), result, exp)) {
return QString::fromUtf8(result.str(1).c_str());
}
}
@@ -1128,6 +1131,12 @@ void DownloadManager::nxmFilesAvailable(int, QVariant userData, QVariant resultD
if (!info->m_FileInfo->version.isValid()) {
info->m_FileInfo->version = info->m_FileInfo->newestVersion;
}
//Nexus has HTMLd these so unhtml them if necessary
QTextDocument doc;
doc.setHtml(info->m_FileInfo->modName);
info->m_FileInfo->modName = doc.toPlainText();
doc.setHtml(info->m_FileInfo->name);
info->m_FileInfo->name = doc.toPlainText();
info->m_FileInfo->fileCategory = convertFileCategory(fileInfo["category_id"].toInt());
info->m_FileInfo->fileTime = matchDate(fileInfo["date"].toString());
info->m_FileInfo->fileID = fileInfo["id"].toInt();
@@ -1238,7 +1247,7 @@ int DownloadManager::startDownloadURLs(const QStringList &urls)
int DownloadManager::startDownloadNexusFile(int modID, int fileID)
{
int newID = m_ActiveDownloads.size();
addNXMDownload(QString("nxm://%1/mods/%2/files/%3").arg(ToQString(MOShared::GameInfo::instance().getGameName())).arg(modID).arg(fileID));
addNXMDownload(QString("nxm://%1/mods/%2/files/%3").arg(m_ManagedGame->getGameShortName()).arg(modID).arg(fileID));
return newID;
}
@@ -1461,3 +1470,7 @@ void DownloadManager::directoryChanged(const QString&)
refreshList();
}
void DownloadManager::managedGameChanged(MOBase::IPluginGame const *managedGame)
{
m_ManagedGame = managedGame;
}
+6
View File
@@ -35,6 +35,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QFileSystemWatcher>
#include <QSettings>
namespace MOBase { class IPluginGame; }
class NexusInterface;
@@ -328,7 +329,9 @@ public:
virtual int startDownloadURLs(const QStringList &urls);
virtual int startDownloadNexusFile(int modID, int fileID);
virtual QString downloadPath(int id);
/**
@@ -414,6 +417,8 @@ public slots:
void nxmRequestFailed(int modID, int fileID, QVariant userData, int requestID, const QString &errorString);
void managedGameChanged(MOBase::IPluginGame const *gamePlugin);
private slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
@@ -501,6 +506,7 @@ private:
QRegExp m_DateExpression;
MOBase::IPluginGame const *m_ManagedGame;
};
-13
View File
@@ -85,7 +85,6 @@ void EditExecutablesDialog::resetInput()
ui->argumentsEdit->setText("");
ui->appIDOverwriteEdit->clear();
ui->overwriteAppIDBox->setChecked(false);
ui->closeCheckBox->setChecked(false);
ui->useAppIconCheckBox->setChecked(false);
m_CurrentItem = nullptr;
}
@@ -97,9 +96,6 @@ void EditExecutablesDialog::saveExecutable()
QDir::fromNativeSeparators(ui->binaryEdit->text()),
ui->argumentsEdit->text(),
QDir::fromNativeSeparators(ui->workingDirEdit->text()),
(ui->closeCheckBox->checkState() == Qt::Checked) ?
ExecutableInfo::CloseMOStyle::DEFAULT_CLOSE
: ExecutableInfo::CloseMOStyle::DEFAULT_STAY,
ui->overwriteAppIDBox->isChecked() ?
ui->appIDOverwriteEdit->text() : "",
Executable::UseApplicationIcon | Executable::CustomExecutable,
@@ -218,7 +214,6 @@ bool EditExecutablesDialog::executableChanged()
|| 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 == ExecutableInfo::CloseMOStyle::DEFAULT_CLOSE) != ui->closeCheckBox->isChecked()
|| selectedExecutable.usesOwnIcon() != ui->useAppIconCheckBox->isChecked();
} else {
QFileInfo fileInfo(ui->binaryEdit->text());
@@ -291,14 +286,6 @@ 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 == 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 {
ui->closeCheckBox->setEnabled(true);
ui->closeCheckBox->setToolTip(tr("If checked, MO will be closed once the specified executable is run."));
}
ui->removeButton->setEnabled(selectedExecutable.isCustom());
ui->overwriteAppIDBox->setChecked(!selectedExecutable.m_SteamAppID.isEmpty());
if (!selectedExecutable.m_SteamAppID.isEmpty()) {
-17
View File
@@ -164,19 +164,6 @@ Right now the only case I know of where this needs to be overwritten is for the
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="closeCheckBox">
<property name="toolTip">
<string>If checked, MO will be closed once the specified executable is run.</string>
</property>
<property name="whatsThis">
<string>If checked, MO will be closed once the specified executable is run.</string>
</property>
<property name="text">
<string>Close MO when started</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="useAppIconCheckBox">
<property name="text">
@@ -247,10 +234,6 @@ Right now the only case I know of where this needs to be overwritten is for the
</layout>
</item>
</layout>
<zorder>executablesListBox</zorder>
<zorder>closeButton</zorder>
<zorder>closeCheckBox</zorder>
<zorder>useAppIconCheckBox</zorder>
</widget>
<resources/>
<connections/>
+7 -10
View File
@@ -18,16 +18,18 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "executableslist.h"
#include <gameinfo.h>
#include "iplugingame.h"
#include "utility.h"
#include <QFileInfo>
#include <QDir>
#include <QDebug>
#include "utility.h"
#include <algorithm>
using namespace MOBase;
using namespace MOShared;
ExecutablesList::ExecutablesList()
@@ -38,7 +40,7 @@ ExecutablesList::~ExecutablesList()
{
}
void ExecutablesList::init(IPluginGame *game)
void ExecutablesList::init(IPluginGame const *game)
{
Q_ASSERT(game != nullptr);
m_Executables.clear();
@@ -48,7 +50,6 @@ void ExecutablesList::init(IPluginGame *game)
info.binary().absoluteFilePath(),
info.arguments().join(" "),
info.workingDirectory().absolutePath(),
info.closeMO(),
info.steamAppID());
}
}
@@ -133,7 +134,6 @@ void ExecutablesList::updateExecutable(const QString &title,
const QString &executableName,
const QString &arguments,
const QString &workingDirectory,
ExecutableInfo::CloseMOStyle closeMO,
const QString &steamAppID,
Executable::Flags mask,
Executable::Flags flags)
@@ -144,7 +144,6 @@ void ExecutablesList::updateExecutable(const QString &title,
if (existingExe != m_Executables.end()) {
existingExe->m_Title = title;
existingExe->m_CloseMO = closeMO;
existingExe->m_Flags &= ~mask;
existingExe->m_Flags |= flags;
// for pre-configured executables don't overwrite settings we didn't store
@@ -160,7 +159,6 @@ void ExecutablesList::updateExecutable(const QString &title,
} else {
Executable newExe;
newExe.m_Title = title;
newExe.m_CloseMO = closeMO;
newExe.m_BinaryInfo = file;
newExe.m_Arguments = arguments;
newExe.m_WorkingDirectory = workingDirectory;
@@ -184,12 +182,11 @@ void ExecutablesList::remove(const QString &title)
void ExecutablesList::addExecutableInternal(const QString &title, const QString &executableName,
const QString &arguments, const QString &workingDirectory,
ExecutableInfo::CloseMOStyle closeMO, const QString &steamAppID)
const QString &steamAppID)
{
QFileInfo file(executableName);
if (file.exists()) {
Executable newExe;
newExe.m_CloseMO = closeMO;
newExe.m_BinaryInfo = file;
newExe.m_Title = title;
newExe.m_Arguments = arguments;
+6 -9
View File
@@ -20,13 +20,14 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#ifndef EXECUTABLESLIST_H
#define EXECUTABLESLIST_H
#include "executableinfo.h"
#include <vector>
#include <QFileInfo>
#include <QMetaType>
#include <gameinfo.h>
#include <iplugingame.h>
namespace MOBase { class IPluginGame; }
/*!
* @brief Information about an executable
@@ -35,7 +36,6 @@ struct Executable {
QString m_Title;
QFileInfo m_BinaryInfo;
QString m_Arguments;
MOBase::ExecutableInfo::CloseMOStyle m_CloseMO;
QString m_SteamAppID;
QString m_WorkingDirectory;
@@ -78,7 +78,7 @@ public:
/**
* @brief initialise the list with the executables preconfigured for this game
**/
void init(MOBase::IPluginGame *game);
void init(MOBase::IPluginGame const *game);
/**
* @brief find an executable by its name
@@ -125,17 +125,15 @@ public:
* @param title name displayed in the UI
* @param executableName the actual filename to execute
* @param arguments arguments to pass to the executable
* @param closeMO if true, MO will be closed when the binary is started
**/
void addExecutable(const QString &title,
const QString &executableName,
const QString &arguments,
const QString &workingDirectory,
MOBase::ExecutableInfo::CloseMOStyle closeMO,
const QString &steamAppID,
Executable::Flags flags)
{
updateExecutable(title, executableName, arguments, workingDirectory, closeMO, steamAppID, Executable::AllFlags, flags);
updateExecutable(title, executableName, arguments, workingDirectory, steamAppID, Executable::AllFlags, flags);
}
/**
@@ -150,7 +148,6 @@ public:
const QString &executableName,
const QString &arguments,
const QString &workingDirectory,
MOBase::ExecutableInfo::CloseMOStyle closeMO,
const QString &steamAppID,
Executable::Flags mask,
Executable::Flags flags);
@@ -191,7 +188,7 @@ private:
std::vector<Executable>::iterator findExe(const QString &title);
void addExecutableInternal(const QString &title, const QString &executableName, const QString &arguments,
const QString &workingDirectory, MOBase::ExecutableInfo::CloseMOStyle closeMO,
const QString &workingDirectory,
const QString &steamAppID);
private:
-39
View File
@@ -1,39 +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 <http://www.gnu.org/licenses/>.
*/
#ifndef GAMEINFOIMPL_H
#define GAMEINFOIMPL_H
#include <igameinfo.h>
#include <QString>
class GameInfoImpl : public MOBase::IGameInfo
{
public:
GameInfoImpl();
virtual Type type() const;
virtual QString path() const;
virtual QString binaryName() const;
};
#endif // GAMEINFOIMPL_H
+1 -1
View File
@@ -21,7 +21,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#define HELPER_H
#include <QString>
#include <string>
/**

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