summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanninOne <seppleviathan@gmx.de>2015-12-23 11:38:34 +0100
committerTanninOne <seppleviathan@gmx.de>2015-12-23 11:38:34 +0100
commitc037b74b00cc3a20938cd3bbfcd01cfde8ca995c (patch)
treeecaa2106a64b14e46f0b44f030bb1b0c2ca9050c
parent502e950cde5920e4184775c47621cb737696f512 (diff)
parent5adb3b377ecd50a75dd034a49582a1da91b67e1c (diff)
Merge branch 'master' into new_vfs_library
-rw-r--r--massage_messages.py99
-rw-r--r--readme.md2
-rw-r--r--src/downloadmanager.cpp5
-rw-r--r--src/downloadmanager.h4
-rw-r--r--src/main.cpp4
-rw-r--r--src/nxmaccessmanager.cpp1
-rw-r--r--src/profile.h4
-rw-r--r--src/profilesdialog.h1
-rw-r--r--src/settings.cpp1
9 files changed, 72 insertions, 49 deletions
diff --git a/massage_messages.py b/massage_messages.py
index 249068ba..d79f4cea 100644
--- a/massage_messages.py
+++ b/massage_messages.py
@@ -1,3 +1,5 @@
+from collections import defaultdict
+
import fileinput
import re
import subprocess
@@ -28,14 +30,19 @@ class QWidget;
namespace Ui { class AboutDialog; } // lines 31-31
---
"""
+
removing = None
+includes = dict()
-includes = dict
+adding = None
+added = dict()
-foundline = 0
+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
@@ -45,34 +52,53 @@ def process_next_line(line, outfile):
global includes
global foundline
global errors
+ global added
+ global adding
line = line.rstrip()
print >> outfile, line
- if removing:
- if line == '':
- removing = None
- print
- return
+
+ 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:
- # 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:
- # If there is an added line with the same class, print it here
- print '%s(%s) : warning I0001: Unnecessary include of %s' %\
- (removing, m.group(2), m.group(1))
- foundline = m.group(1)
+ 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:
- m = re.match(r'- (.*) +// lines (.*)-', line)
- if m:
- print '%s(%s) : warning I0002: '\
- 'Unnecessary forward ref of %s' %\
- (removing, m.group(2), m.group(1))
- foundline = m.group(1)
- else:
- print '********* I got confused **********'
+ messages[removing].append(
+ '%s(%s) : warning I0001: Unnecessary include of %s' % (
+ removing, m.group(2), m.group(1)))
- if line.startswith('In file included from'):
+ 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)
@@ -88,14 +114,6 @@ def process_next_line(line, outfile):
errors = True
print line
- if line.endswith(' should remove these lines:'):
- removing = (line.split(' '))[0]
- elif line.endswith(' should add these lines:'):
- adding = (line.split(' '))[0]
-
-# also process the other lines
-
- # added lines should come after the first entry with a line number.
outfile = open(sys.argv[1], 'w')
process = subprocess.Popen(sys.argv[2:],
@@ -107,6 +125,21 @@ while True:
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:'
diff --git a/readme.md b/readme.md
index e985a130..9611ee40 100644
--- a/readme.md
+++ b/readme.md
@@ -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
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index cbc1ba45..c551e590 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -1244,14 +1244,13 @@ int DownloadManager::startDownloadURLs(const QStringList &urls)
return m_ActiveDownloads.size() - 1;
}
-/* This doesn't appear to be used by anything
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;
}
-*/
+
QString DownloadManager::downloadPath(int id)
{
return getFilePath(id);
diff --git a/src/downloadmanager.h b/src/downloadmanager.h
index 54db4648..e63a0113 100644
--- a/src/downloadmanager.h
+++ b/src/downloadmanager.h
@@ -329,9 +329,9 @@ public:
virtual int startDownloadURLs(const QStringList &urls);
- /* This doesn't appear to be used anywhere
+
virtual int startDownloadNexusFile(int modID, int fileID);
- */
+
virtual QString downloadPath(int id);
/**
diff --git a/src/main.cpp b/src/main.cpp
index 0258910c..30938485 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -35,7 +35,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <report.h>
#include "modlist.h"
#include "profile.h"
-#include "gameinfo.h"
#include "spawn.h"
#include "executableslist.h"
#include "singleinstance.h"
@@ -556,9 +555,6 @@ int main(int argc, char *argv[])
organizer.setManagedGame(game);
- //*sigh just for making it work
- GameInfo::init(application.applicationDirPath().toStdWString(), game->gameDirectory().absolutePath().toStdWString());
-
organizer.createDefaultProfile();
//See the pragma - we apparently don't use this so not sure why we check it
diff --git a/src/nxmaccessmanager.cpp b/src/nxmaccessmanager.cpp
index cdf50fd8..a7dd6eef 100644
--- a/src/nxmaccessmanager.cpp
+++ b/src/nxmaccessmanager.cpp
@@ -26,7 +26,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "selfupdater.h"
#include "persistentcookiejar.h"
#include "settings.h"
-#include <gameinfo.h>
#include <QMessageBox>
#include <QPushButton>
#include <QNetworkProxy>
diff --git a/src/profile.h b/src/profile.h
index 5d5a3bc5..a7d71251 100644
--- a/src/profile.h
+++ b/src/profile.h
@@ -102,10 +102,6 @@ public:
/**
* @brief activate archive invalidation
- *
- * @param dataDirectory data directory of the game
- * @todo passing the data directory as a parameter is useless, the function should
- * be able to query it from GameInfo
**/
void activateInvalidation();
diff --git a/src/profilesdialog.h b/src/profilesdialog.h
index 26476883..073d92b7 100644
--- a/src/profilesdialog.h
+++ b/src/profilesdialog.h
@@ -48,7 +48,6 @@ public:
*
* @param profileName currently enabled profile
* @param parent parent widget
- * @todo the game path could be retrieved from GameInfo just as easily
**/
explicit ProfilesDialog(const QString &profileName, MOBase::IPluginGame const *game, QWidget *parent = 0);
~ProfilesDialog();
diff --git a/src/settings.cpp b/src/settings.cpp
index 479dd3ab..d493be1d 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -22,7 +22,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "settingsdialog.h"
#include "utility.h"
#include "helper.h"
-#include <gameinfo.h>
#include <appconfig.h>
#include <utility.h>
#include <iplugingame.h>