summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp38
-rw-r--r--src/mainwindow.cpp46
-rw-r--r--src/modlistsortproxy.cpp8
-rw-r--r--src/modlistsortproxy.h4
-rw-r--r--src/organizercore.h4
-rw-r--r--src/version.rc4
6 files changed, 54 insertions, 50 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a61e3150..0253ad4a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -145,6 +145,41 @@ bool bootstrap()
return true;
}
+void cleanupDir()
+{
+ // files from previous versions of MO that are no longer
+ // required (in that location)
+ QStringList fileNames {
+ "imageformats/",
+ "loot/resources/",
+ "plugins/previewDDS.dll",
+ "dlls/boost_python-vc100-mt-1_55.dll",
+ "dlls/QtCore4.dll",
+ "dlls/QtDeclarative4.dll",
+ "dlls/QtGui4.dll",
+ "dlls/QtNetwork4.dll",
+ "dlls/QtOpenGL4.dll",
+ "dlls/QtScript4.dll",
+ "dlls/QtSql4.dll",
+ "dlls/QtSvg4.dll",
+ "dlls/QtWebKit4.dll",
+ "dlls/QtXml4.dll",
+ "dlls/QtXmlPatterns4.dll",
+ "msvcp100.dll",
+ "msvcr100.dll",
+ "proxy.dll"
+ };
+
+ for (const QString &fileName : fileNames) {
+ QString fullPath = qApp->applicationDirPath() + "/" + fileName;
+ if (QFile::exists(fullPath)
+ && !shellDelete(QStringList(fullPath), true)) {
+ qDebug("failed to remove obsolete %s", qPrintable(fullPath));
+ }
+ }
+}
+
+
bool isNxmLink(const QString &link)
{
return link.startsWith("nxm://", Qt::CaseInsensitive);
@@ -308,6 +343,7 @@ int main(int argc, char *argv[])
#else
QDesktopServices::storageLocation(QDesktopServices::DataLocation)
#endif
+ + "/" + instanceID
);
application.setProperty("dataPath", dataPath);
@@ -348,6 +384,8 @@ int main(int argc, char *argv[])
QSplashScreen splash(pixmap);
splash.show();
+ cleanupDir();
+
{ // extend path to include dll directory so plugins don't need a manifest
// (using AddDllDirectory would be an alternative to this but it seems fairly complicated esp.
// since it isn't easily accessible on Windows < 8
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 56918759..1566bc8a 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -204,7 +204,6 @@ MainWindow::MainWindow(const QString &exeName
ui->modList->sortByColumn(ModList::COL_PRIORITY, Qt::AscendingOrder);
ui->modList->setItemDelegateForColumn(ModList::COL_FLAGS, new ModFlagIconDelegate(ui->modList));
ui->modList->setItemDelegateForColumn(ModList::COL_CONTENT, contentDelegate);
- //ui->modList->setAcceptDrops(true);
ui->modList->header()->installEventFilter(m_OrganizerCore.modList());
if (initSettings.contains("mod_list_state")) {
ui->modList->header()->restoreState(initSettings.value("mod_list_state").toByteArray());
@@ -362,17 +361,10 @@ void MainWindow::resizeLists(bool modListCustom, bool pluginListCustom)
{
if (!modListCustom) {
// resize mod list to fit content
-#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
for (int i = 0; i < ui->modList->header()->count(); ++i) {
ui->modList->header()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
}
ui->modList->header()->setSectionResizeMode(ModList::COL_NAME, QHeaderView::Stretch);
-#else
- for (int i = 0; i < ui->modList->header()->count(); ++i) {
- ui->modList->header()->setResizeMode(i, QHeaderView::ResizeToContents);
- }
- ui->modList->header()->setResizeMode(ModList::COL_NAME, QHeaderView::Stretch);
-#endif
}
// ensure the columns aren't so small you can't see them any more
@@ -384,17 +376,10 @@ void MainWindow::resizeLists(bool modListCustom, bool pluginListCustom)
if (!pluginListCustom) {
// resize plugin list to fit content
-#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
for (int i = 0; i < ui->espList->header()->count(); ++i) {
ui->espList->header()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
}
ui->espList->header()->setSectionResizeMode(0, QHeaderView::Stretch);
-#else
- for (int i = 0; i < ui->espList->header()->count(); ++i) {
- ui->espList->header()->setResizeMode(i, QHeaderView::ResizeToContents);
- }
- ui->espList->header()->setResizeMode(0, QHeaderView::Stretch);
-#endif
}
}
@@ -402,32 +387,19 @@ void MainWindow::resizeLists(bool modListCustom, bool pluginListCustom)
void MainWindow::allowListResize()
{
// allow resize on mod list
-#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
for (int i = 0; i < ui->modList->header()->count(); ++i) {
ui->modList->header()->setSectionResizeMode(i, QHeaderView::Interactive);
}
- ui->modList->header()->setSectionResizeMode(ui->modList->header()->count() - 1, QHeaderView::Stretch);
-#else
- for (int i = 0; i < ui->modList->header()->count(); ++i) {
- ui->modList->header()->setResizeMode(i, QHeaderView::Interactive);
- }
- ui->modList->header()->setResizeMode(ui->modList->header()->count() - 1, QHeaderView::Stretch);
-#endif
+ //ui->modList->header()->setSectionResizeMode(ui->modList->header()->count() - 1, QHeaderView::Stretch);
+ ui->modList->header()->setStretchLastSection(true);
// allow resize on plugin list
-#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
for (int i = 0; i < ui->espList->header()->count(); ++i) {
ui->espList->header()->setSectionResizeMode(i, QHeaderView::Interactive);
}
- ui->espList->header()->setSectionResizeMode(ui->espList->header()->count() - 1, QHeaderView::Stretch);
-#else
- for (int i = 0; i < ui->espList->header()->count(); ++i) {
- ui->espList->header()->setResizeMode(i, QHeaderView::Interactive);
- }
- ui->espList->header()->setResizeMode(ui->espList->header()->count() - 1, QHeaderView::Stretch);
-#endif
-
+ //ui->espList->header()->setSectionResizeMode(ui->espList->header()->count() - 1, QHeaderView::Stretch);
+ ui->espList->header()->setStretchLastSection(true);
}
void MainWindow::updateStyle(const QString&)
@@ -2302,6 +2274,7 @@ void MainWindow::overwriteClosed(int)
m_OrganizerCore.modList()->modInfoChanged(dialog->modInfo());
dialog->deleteLater();
}
+ m_OrganizerCore.refreshDirectoryStructure();
}
@@ -3224,9 +3197,8 @@ void MainWindow::linkToolbar()
void MainWindow::linkDesktop()
{
- QComboBox* executablesList = findChild<QComboBox*>("executablesListBox");
-
- const Executable &selectedExecutable = executablesList->itemData(executablesList->currentIndex()).value<Executable>();
+ const Executable &selectedExecutable =
+ ui->executablesListBox->itemData(ui->executablesListBox->currentIndex()).value<Executable>();
QString linkName = getDesktopDirectory() + "\\" + selectedExecutable.m_Title + ".lnk";
if (QFile::exists(linkName)) {
@@ -3236,7 +3208,7 @@ void MainWindow::linkDesktop()
reportError(tr("failed to remove %1").arg(linkName));
}
} else {
- QFileInfo exeInfo(qApp->arguments().at(0));
+ QFileInfo exeInfo(qApp->applicationFilePath());
// create link
std::wstring targetFile = ToWString(exeInfo.absoluteFilePath());
std::wstring parameter = ToWString(QString("\"%1\" %2").arg(QDir::toNativeSeparators(selectedExecutable.m_BinaryInfo.absoluteFilePath()))
@@ -3270,7 +3242,7 @@ void MainWindow::linkMenu()
reportError(tr("failed to remove %1").arg(linkName));
}
} else {
- QFileInfo exeInfo(qApp->arguments().at(0));
+ QFileInfo exeInfo(qApp->applicationFilePath());
// create link
std::wstring targetFile = ToWString(exeInfo.absoluteFilePath());
std::wstring parameter = ToWString(QString("\"%1\" %2").arg(QDir::toNativeSeparators(selectedExecutable.m_BinaryInfo.absoluteFilePath()))
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index 56783132..d649996f 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -37,7 +37,6 @@ ModListSortProxy::ModListSortProxy(Profile* profile, QObject *parent)
, m_CurrentFilter()
, m_FilterActive(false)
, m_FilterMode(FILTER_AND)
- , m_BeingInvalidated(false)
{
m_EnabledColumns.set(ModList::COL_FLAGS);
m_EnabledColumns.set(ModList::COL_NAME);
@@ -198,10 +197,9 @@ void ModListSortProxy::updateFilter(const QString &filter)
{
m_CurrentFilter = filter;
updateFilterActive();
- // workaround because qt throws a fit if, as a result of this invalidation, another invalidate is called
- m_BeingInvalidated = true;
- invalidateFilter();
- m_BeingInvalidated = false;
+ // using invalidateFilter here should be enough but that crashes the application? WTF?
+ // invalidateFilter();
+ invalidate();
}
bool ModListSortProxy::hasConflictFlag(const std::vector<ModInfo::EFlag> &flags) const
diff --git a/src/modlistsortproxy.h b/src/modlistsortproxy.h
index 05392c0b..35c60235 100644
--- a/src/modlistsortproxy.h
+++ b/src/modlistsortproxy.h
@@ -91,8 +91,6 @@ public:
return rowCount(parent) > 0;
}
- bool beingInvalidated() const { return m_BeingInvalidated; }
-
public slots:
void updateFilter(const QString &filter);
@@ -125,8 +123,6 @@ private:
bool m_FilterActive;
FilterMode m_FilterMode;
- bool m_BeingInvalidated;
-
};
#endif // MODLISTSORTPROXY_H
diff --git a/src/organizercore.h b/src/organizercore.h
index d8a3e232..e4072b38 100644
--- a/src/organizercore.h
+++ b/src/organizercore.h
@@ -121,8 +121,6 @@ public:
void loginSuccessfulUpdate(bool necessary);
void loginFailedUpdate(const QString &message);
- void syncOverwrite();
-
void createDefaultProfile();
MOBase::DelayedFileWriter &pluginsWriter() { return m_PluginListsWriter; }
@@ -172,6 +170,8 @@ public slots:
void profileRefresh();
void externalMessage(const QString &message);
+ void syncOverwrite();
+
void savePluginList();
void refreshLists();
diff --git a/src/version.rc b/src/version.rc
index 9e6492f5..272bdb1c 100644
--- a/src/version.rc
+++ b/src/version.rc
@@ -1,7 +1,7 @@
#include "Winver.h"
-#define VER_FILEVERSION 1,3,2,0
-#define VER_FILEVERSION_STR "1,3,2,0\0"
+#define VER_FILEVERSION 1,3,3,0
+#define VER_FILEVERSION_STR "1,3,3,0\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION