mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
64
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9edc39633b | ||
|
|
b415db619e | ||
|
|
bd8267993d | ||
|
|
f5c56efeb3 | ||
|
|
a16e25380f | ||
|
|
b2d04d70fc | ||
|
|
99de80e722 | ||
|
|
78f628e0af | ||
|
|
45a46778fb | ||
|
|
cfb863f6c3 | ||
|
|
f2f9e11fdd | ||
|
|
d23466f036 | ||
|
|
53896e66f1 | ||
|
|
efc77930ad | ||
|
|
01265e9b03 | ||
|
|
9494938534 | ||
|
|
7c1273b246 | ||
|
|
9ab7bada1c | ||
|
|
10cc566081 | ||
|
|
53d1f3e00e | ||
|
|
df0bd3331a | ||
|
|
db0e278817 | ||
|
|
2ce135e0bf | ||
|
|
93bd29c13d | ||
|
|
637ce6bcc1 | ||
|
|
d3d7e30286 | ||
|
|
7d27138086 | ||
|
|
19cb2d4076 | ||
|
|
5aa5c90d39 | ||
|
|
12a57d7f6d | ||
|
|
482f13a50b | ||
|
|
f481a7aae3 | ||
|
|
15b9927cef | ||
|
|
cc42e76f54 | ||
|
|
84598cbcbf | ||
|
|
02973be652 | ||
|
|
fc2591e028 | ||
|
|
9a97098cc3 | ||
|
|
4b1e6683d2 | ||
|
|
06701856f8 | ||
|
|
5d4a55c3a6 | ||
|
|
470b6ed0bf | ||
|
|
0050cb0740 | ||
|
|
f6ef5477e7 | ||
|
|
e24f3fef77 | ||
|
|
0a152ceadf | ||
|
|
5718af3510 | ||
|
|
434b6be69d | ||
|
|
d412060d59 | ||
|
|
84c66727bf | ||
|
|
bfb3385e49 | ||
|
|
f59f52501c | ||
|
|
9b67e338e1 | ||
|
|
7944bacfd9 | ||
|
|
1b4c07eb20 | ||
|
|
d93df95dcf | ||
|
|
46a32ff3b7 | ||
|
|
0046d8710e | ||
|
|
2b5748003d | ||
|
|
a49ed5c33c | ||
|
|
62b0c07a93 | ||
|
|
05c58c8b3d | ||
|
|
9b33e0a970 | ||
|
|
a5b6556d67 |
@@ -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
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@ SUBDIRS = bsatk \
|
||||
nxmhandler \
|
||||
BossDummy \
|
||||
pythonRunner \
|
||||
loot_cli \
|
||||
esptk
|
||||
|
||||
pythonRunner.depends = uibase
|
||||
|
||||
+4
-6
@@ -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));
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
@@ -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
@@ -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
Reference in New Issue
Block a user