From f8c683f700a3fff30540ff343df2bfba15080e86 Mon Sep 17 00:00:00 2001
From: Tannin
Date: Thu, 20 Jun 2013 21:55:37 +0200
Subject: - some fixes for qt5 compatibility - hook.dll no longer creates a
dump and uninstalls it if an exception is reported that doesn't originate
from it - NCC used read-only transactions again because otherwise solid
archives become unusably slow. - removed the integrated nexus browser - the
mod description and motd are now rendered in QTextBrowser. This (and the
above) eliminates the dependency on qtwebkit - removed the direct file
download for mod files - reduced CPU usage during downloads by invalidating
only one column of the download list. This widget still needs to be replaced
- added the complete filename as an option for the modname - applications
that require elevation can now be started by invoking an elevated secondary
ModOrganizer instance - MO will now register nexus file servers and provides
a settings dialog to pick preferred servers. (This preference is not used
yet) - worked around 1-2 bugs in QSortFilterProxy - handling of nxm links is
now done by an external application. This allows the registration of
different applications depending on the game - integrated fomod installer now
displays the screenshot in a scalable view - bugfix: integrated fomod
installer didn't name output files correctly if the name differs from the
source name - bugfix: a successful login to nexus was (sometimes?) not
correctly detected as a success - bugfix: top-level entries in
QtGroupingProxy were sometimes incorrectly displayed as groups - bugfix:
GetPrivateProfile... optimization could cause null-pointer indirection -
bugfix: GetCurrentWorkingDirectory caused buffer overflow in case of
pre-flighting (buffer size 0) - bugfix: configurator plugin now also uses qt5
(it's currently broken though)
---
src/ModOrganizer.pro | 3 +-
src/bbcode.cpp | 382 ++++++++++++-------------
src/bbcode.h | 42 +--
src/downloadlist.cpp | 175 ++++++------
src/downloadlistwidget.cpp | 2 +
src/downloadlistwidgetcompact.cpp | 3 +-
src/downloadmanager.cpp | 10 +-
src/downloadmanager.h | 2 +
src/installationmanager.cpp | 2 +
src/main.cpp | 18 +-
src/mainwindow.cpp | 89 +++---
src/mainwindow.h | 7 +-
src/modeltest.cpp | 583 ++++++++++++++++++++++++++++++++++++++
src/modeltest.h | 94 ++++++
src/modinfodialog.cpp | 5 +-
src/modinfodialog.ui | 38 +--
src/modlist.cpp | 18 +-
src/modlist.h | 7 +-
src/modlistsortproxy.h | 12 +
src/motddialog.cpp | 5 +-
src/motddialog.ui | 52 +---
src/nexusdialog.cpp | 339 ----------------------
src/nexusdialog.h | 158 -----------
src/nexusdialog.ui | 306 --------------------
src/nexusinterface.h | 9 -
src/nexusview.cpp | 121 --------
src/nexusview.h | 95 -------
src/nxmaccessmanager.cpp | 7 +-
src/nxmaccessmanager.h | 1 -
src/nxmurl.cpp | 34 ---
src/nxmurl.h | 64 -----
src/organizer.pro | 17 +-
src/qtgroupingproxy.cpp | 18 +-
src/settings.cpp | 107 +++++--
src/settings.h | 18 +-
src/settingsdialog.ui | 75 +++--
src/shared/windows_error.h | 2 +-
src/spawn.cpp | 41 ++-
src/spawn.h | 67 +++--
src/version.rc | 4 +-
40 files changed, 1356 insertions(+), 1676 deletions(-)
create mode 100644 src/modeltest.cpp
create mode 100644 src/modeltest.h
delete mode 100644 src/nexusdialog.cpp
delete mode 100644 src/nexusdialog.h
delete mode 100644 src/nexusdialog.ui
delete mode 100644 src/nexusview.cpp
delete mode 100644 src/nexusview.h
delete mode 100644 src/nxmurl.cpp
delete mode 100644 src/nxmurl.h
(limited to 'src')
diff --git a/src/ModOrganizer.pro b/src/ModOrganizer.pro
index 01c9c146..31f135b3 100644
--- a/src/ModOrganizer.pro
+++ b/src/ModOrganizer.pro
@@ -10,7 +10,8 @@ SUBDIRS = bsatk \
archive \
helper \
plugins \
- proxydll
+ proxydll \
+ nxmhandler
hookdll.depends = shared
organizer.depends = shared, uibase, plugins
diff --git a/src/bbcode.cpp b/src/bbcode.cpp
index 5f134d78..fe7decfd 100644
--- a/src/bbcode.cpp
+++ b/src/bbcode.cpp
@@ -17,193 +17,195 @@ You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see .
*/
-#include "bbcode.h"
-
-#include
-#include
");
- m_TagMap["code"] = std::make_pair(QRegExp("\\[code\\](.*)\\[/code\\]"),
- "\\1
");
- m_TagMap["heading"]= std::make_pair(QRegExp("\\[heading\\](.*)\\[/heading\\]"),
- "\\1
");
-
- // lists
- m_TagMap["list"] = std::make_pair(QRegExp("\\[list\\](.*)\\[/list\\]"),
- "");
- m_TagMap["list="] = std::make_pair(QRegExp("\\[list.*\\](.*)\\[/list\\]"),
- "\\1
");
- m_TagMap["ul"] = std::make_pair(QRegExp("\\[ul\\](.*)\\[/ul\\]"),
- "");
- m_TagMap["ol"] = std::make_pair(QRegExp("\\[ol\\](.*)\\[/ol\\]"),
- "\\1
");
- m_TagMap["li"] = std::make_pair(QRegExp("\\[li\\](.*)\\[/li\\]"),
- "\\1");
- m_TagMap["*"] = std::make_pair(QRegExp("\\[\\*\\](.*)
"),
- "\\1");
-
- // tables
- m_TagMap["table"] = std::make_pair(QRegExp("\\[table\\](.*)\\[/table\\]"),
- "");
- m_TagMap["tr"] = std::make_pair(QRegExp("\\[tr\\](.*)\\[/tr\\]"),
- "\\1
");
- m_TagMap["th"] = std::make_pair(QRegExp("\\[th\\](.*)\\[/th\\]"),
- "\\1 | ");
- m_TagMap["td"] = std::make_pair(QRegExp("\\[td\\](.*)\\[/td\\]"),
- "\\1 | ");
-
- // web content
- m_TagMap["url"] = std::make_pair(QRegExp("\\[url\\](.*)\\[/url\\]"),
- "\\1");
- m_TagMap["url="] = std::make_pair(QRegExp("\\[url=([^\\]]*)\\](.*)\\[/url\\]"),
- "\\2");
- m_TagMap["img"] = std::make_pair(QRegExp("\\[img\\](.*)\\[/img\\]"),
- "
");
- m_TagMap["img="] = std::make_pair(QRegExp("\\[img=([^\\]]*)\\](.*)\\[/img\\]"),
- "
");
- m_TagMap["email="] = std::make_pair(QRegExp("\\[email=\"?([^\\]]*)\"?\\](.*)\\[/email\\]"),
- "\\2");
- m_TagMap["youtube"] = std::make_pair(QRegExp("\\[youtube\\](.*)\\[/youtube\\]"),
- "http://www.youtube.com/v/\\1");
-
- // make all patterns non-greedy and case-insensitive
- for (TagMap::iterator iter = m_TagMap.begin(); iter != m_TagMap.end(); ++iter) {
- iter->second.first.setCaseSensitivity(Qt::CaseInsensitive);
- iter->second.first.setMinimal(true);
- }
- }
-
-
-private:
- QRegExp m_TagNameExp;
- TagMap m_TagMap;
-};
-
-
-QString convertToHTML(const QString &inputParam)
-{
- // this code goes over the input string once and replaces all bbtags
- // it encounters. This function is called recursively for every replaced
- // string to convert nested tags.
- //
- // This could be implemented simpler by applying a set of regular expressions
- // for each recognized bb-tag one after the other but that would probably be
- // very inefficient (O(n^2)).
-
- QString input = inputParam.mid(0).replace("\r\n", "
");
- input.replace("\\\"", "\"").replace("\\'", "'");
-
- QString result;
- int lastBlock = 0;
- int pos = 0;
-
- // iterate over the input buffer
- while ((pos = input.indexOf('[', lastBlock)) != -1) {
- // append everything between the previous tag-block and the current one
- result.append(input.midRef(lastBlock, pos - lastBlock));
-
- // convert the tag and content if necessary
- int length = -1;
- QString replacement = BBCodeMap::instance().convertTag(input.mid(pos), length);
- if (length != 0) {
- QString temp = convertToHTML(replacement);
- result.append(temp);
- // length contains the number of characters in the original tag
- pos += length;
- } else {
- // nothing replaced
- result.append('[');
- ++pos;
- }
- lastBlock = pos;
- }
-
- // append the remainder (everything after the last tag)
- result.append(input.midRef(lastBlock));
- return result;
-}
-
-} // namespace BBCode
-
+#include "bbcode.h"
+
+#include
+#include