summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/aboutdialog.cpp3
-rw-r--r--src/aboutdialog.ui7
-rw-r--r--src/main.cpp5
-rw-r--r--src/shared/util.cpp46
-rw-r--r--src/shared/util.h1
5 files changed, 60 insertions, 2 deletions
diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp
index 41fd24f7..6ae7f56d 100644
--- a/src/aboutdialog.cpp
+++ b/src/aboutdialog.cpp
@@ -20,6 +20,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
+#include "util.h"
#include <utility.h>
#include <QApplication>
@@ -85,6 +86,8 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent)
ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown");
#endif
+
+ ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " + MOShared::getUsvfsVersionString());
ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
}
diff --git a/src/aboutdialog.ui b/src/aboutdialog.ui
index c72a85f8..415ce0a7 100644
--- a/src/aboutdialog.ui
+++ b/src/aboutdialog.ui
@@ -105,6 +105,13 @@
</widget>
</item>
<item>
+ <widget class="QLabel" name="usvfsLabel">
+ <property name="text">
+ <string>usvfs:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/src/main.cpp b/src/main.cpp
index f08ba066..776c3775 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -504,8 +504,9 @@ int runApplication(MOApplication &application, SingleInstance &instance,
const QString &splashPath)
{
log::info(
- "starting Mod Organizer version {} revision {} in {}",
- getVersionDisplayString(), GITID, QCoreApplication::applicationDirPath());
+ "starting Mod Organizer version {} revision {} in {}, usvfs: {}",
+ getVersionDisplayString(), GITID, QCoreApplication::applicationDirPath(),
+ MOShared::getUsvfsVersionString());
preloadSsl();
if (!QSslSocket::supportsSsl()) {
diff --git a/src/shared/util.cpp b/src/shared/util.cpp
index 58f4eb2b..32eb825c 100644
--- a/src/shared/util.cpp
+++ b/src/shared/util.cpp
@@ -20,6 +20,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "windows_error.h"
#include "mainwindow.h"
+#include <usvfs.h>
+#include <usvfs_version.h>
namespace MOShared
{
@@ -244,6 +246,50 @@ MOBase::VersionInfo createVersionInfo()
}
}
+QString getUsvfsDLLVersion()
+{
+ // once 2.2.2 is released, this can be changed to call USVFSVersionString()
+ // directly; until then, using GetProcAddress() allows for mixing up devbuilds
+ // and usvfs dlls
+
+ using USVFSVersionStringType = const char* WINAPI ();
+
+ QString s;
+
+ const auto m = ::LoadLibraryW(L"usvfs_x64.dll");
+
+ if (m) {
+ auto* f = reinterpret_cast<USVFSVersionStringType*>(
+ ::GetProcAddress(m, "USVFSVersionString"));
+
+ if (f) {
+ s = f();
+ }
+
+ ::FreeLibrary(m);
+ }
+
+ if (s.isEmpty()) {
+ s = "?";
+ }
+
+ return s;
+}
+
+QString getUsvfsVersionString()
+{
+ const QString dll = getUsvfsDLLVersion();
+ const QString header = USVFS_VERSION_STRING;
+
+ QString usvfsVersion;
+
+ if (dll == header) {
+ return dll;
+ } else {
+ return "dll is " + dll + ", compiled against " + header;
+ }
+}
+
} // namespace MOShared
diff --git a/src/shared/util.h b/src/shared/util.h
index aea6f200..e87244b6 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -45,6 +45,7 @@ std::wstring ToLower(const std::wstring &text);
bool CaseInsensitiveEqual(const std::wstring &lhs, const std::wstring &rhs);
MOBase::VersionInfo createVersionInfo();
+QString getUsvfsVersionString();
} // namespace MOShared