From 09552fe7c704f98d8f4fadb8ebd144376963e0d7 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Wed, 13 Mar 2019 11:44:21 -0400 Subject: [PATCH] group common stuff --- GUI/extenwindow.cpp | 1 - GUI/main.cpp | 1 - GUI/mainwindow.cpp | 1 - GUI/misc.h | 8 -------- GUI/qtcommon.h | 5 +++++ 5 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 GUI/misc.h diff --git a/GUI/extenwindow.cpp b/GUI/extenwindow.cpp index fb09bd9..0c6450d 100644 --- a/GUI/extenwindow.cpp +++ b/GUI/extenwindow.cpp @@ -1,7 +1,6 @@ #include "extenwindow.h" #include "ui_extenwindow.h" #include "defs.h" -#include "misc.h" #include #include #include diff --git a/GUI/main.cpp b/GUI/main.cpp index 9aac425..af40260 100644 --- a/GUI/main.cpp +++ b/GUI/main.cpp @@ -1,5 +1,4 @@ #include "mainwindow.h" -#include "misc.h" #include "host/util.h" #include diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 6fd3145..c9c36c9 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -2,7 +2,6 @@ #include "ui_mainwindow.h" #include "defs.h" #include "extenwindow.h" -#include "misc.h" #include "host/util.h" #include #include diff --git a/GUI/misc.h b/GUI/misc.h deleted file mode 100644 index 524f1fa..0000000 --- a/GUI/misc.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "qtcommon.h" - -struct QTextFile : QFile { QTextFile(QString name, QIODevice::OpenMode mode) : QFile(name) { open(mode | QIODevice::Text); } }; -inline std::wstring S(const QString& S) { return { S.toStdWString() }; } -inline QString S(const std::wstring& S) { return QString::fromStdWString(S); } -inline HMODULE LoadLibraryOnce(std::wstring fileName) { if (HMODULE module = GetModuleHandleW(fileName.c_str())) return module; return LoadLibraryW(fileName.c_str()); } diff --git a/GUI/qtcommon.h b/GUI/qtcommon.h index 91d810c..83594b2 100644 --- a/GUI/qtcommon.h +++ b/GUI/qtcommon.h @@ -11,3 +11,8 @@ #include #include #include + +struct QTextFile : QFile { QTextFile(QString name, QIODevice::OpenMode mode) : QFile(name) { open(mode | QIODevice::Text); } }; +inline std::wstring S(const QString& S) { return { S.toStdWString() }; } +inline QString S(const std::wstring& S) { return QString::fromStdWString(S); } +inline HMODULE LoadLibraryOnce(std::wstring fileName) { if (HMODULE module = GetModuleHandleW(fileName.c_str())) return module; return LoadLibraryW(fileName.c_str()); }