1
0
Fork 0

[Launcher] Check for WIN32.

This commit is contained in:
Kitteh 2018-10-31 07:53:38 +00:00
parent 4a519d1b88
commit 24ac3da37e
4 changed files with 10 additions and 5 deletions

View file

@ -34,6 +34,10 @@ add_definitions(-DQRC_SOURCE_PATH="${PROJECT_SOURCE_DIR}/src/qml")
add_definitions(-DQT_QML_DEBUG) add_definitions(-DQT_QML_DEBUG)
endif(DEVELOP) endif(DEVELOP)
if(WIN32)
add_definitions(-DWINDOWS)
endif(WIN32)
add_executable(KittehPlayer ${SOURCES} ${qml_QRC}) add_executable(KittehPlayer ${SOURCES} ${qml_QRC})
# Use the Qml/Quick modules from Qt 5. # Use the Qml/Quick modules from Qt 5.

View file

@ -27,6 +27,10 @@ unix {
INSTALLS += icon INSTALLS += icon
} }
win32 {
DEFINES += WINDOWS
}
INSTALLS += target INSTALLS += target
HEADERS += src/mpvobject.h src/filesavedialog.h src/fileopendialog.h HEADERS += src/mpvobject.h src/filesavedialog.h src/fileopendialog.h

View file

@ -12,11 +12,10 @@
#include "filesavedialog.h" #include "filesavedialog.h"
#include "mpvobject.h" #include "mpvobject.h"
#if defined(MINGW) || defined(__MINGW32__) || defined(__MINGW64__) #ifdef WIN32
#include "setenv_mingw.hpp" #include "setenv_mingw.hpp"
#endif #endif
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
setenv("QT_QPA_PLATFORMTHEME", "gtk3", 0); setenv("QT_QPA_PLATFORMTHEME", "gtk3", 0);
@ -25,7 +24,6 @@ int main( int argc, char *argv[] )
app.setOrganizationName("KittehPlayer"); app.setOrganizationName("KittehPlayer");
app.setOrganizationDomain("namedkitten.pw"); app.setOrganizationDomain("namedkitten.pw");
app.setApplicationName("KittehPlayer"); app.setApplicationName("KittehPlayer");
for (int i = 1; i < argc; ++i) { for (int i = 1; i < argc; ++i) {
if (!qstrcmp(argv[i], "--update")) { if (!qstrcmp(argv[i], "--update")) {
QString program = QProcessEnvironment::systemEnvironment().value("APPDIR", "") + "/usr/bin/appimageupdatetool"; QString program = QProcessEnvironment::systemEnvironment().value("APPDIR", "") + "/usr/bin/appimageupdatetool";
@ -44,8 +42,8 @@ int main( int argc, char *argv[] )
QString newpath = QProcessEnvironment::systemEnvironment().value("APPDIR", "") + "/usr/bin:" + QProcessEnvironment::systemEnvironment().value("PATH", ""); QString newpath = QProcessEnvironment::systemEnvironment().value("APPDIR", "") + "/usr/bin:" + QProcessEnvironment::systemEnvironment().value("PATH", "");
qDebug() << newpath; qDebug() << newpath;
setenv("PATH", newpath.toUtf8().constData(), 1); setenv("PATH", newpath.toUtf8().constData(), 1);
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL );
qmlRegisterType<MpvObject>("player", 1, 0, "MpvObject"); qmlRegisterType<MpvObject>("player", 1, 0, "MpvObject");
qmlRegisterType<FileOpenDialog>("player", 1, 0, "FileOpenDialog"); qmlRegisterType<FileOpenDialog>("player", 1, 0, "FileOpenDialog");
qmlRegisterType<FileSaveDialog>("player", 1, 0, "FileSaveDialog"); qmlRegisterType<FileSaveDialog>("player", 1, 0, "FileSaveDialog");

View file

@ -30,7 +30,6 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
* *
*/ */
#define _POSIX_C_SOURCE 200809L
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>