Make changes for windows build
This commit is contained in:
+11
-3
@@ -9,12 +9,15 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <linux/btrfs.h>
|
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <linux/btrfs.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
int MainWindow::socketPair[2] = {0, 0};
|
int MainWindow::socketPair[2] = {0, 0};
|
||||||
|
|
||||||
@@ -131,6 +134,7 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
|
|||||||
|
|
||||||
void MainWindow::setupSigterm()
|
void MainWindow::setupSigterm()
|
||||||
{
|
{
|
||||||
|
#ifdef __linux__
|
||||||
struct sigaction signal;
|
struct sigaction signal;
|
||||||
|
|
||||||
signal.sa_handler = MainWindow::signalHandler;
|
signal.sa_handler = MainWindow::signalHandler;
|
||||||
@@ -145,6 +149,7 @@ void MainWindow::setupSigterm()
|
|||||||
::socketpair(AF_UNIX, SOCK_STREAM, 0, socketPair);
|
::socketpair(AF_UNIX, SOCK_STREAM, 0, socketPair);
|
||||||
socketNotifier = new QSocketNotifier(socketPair[1], QSocketNotifier::Read, this);
|
socketNotifier = new QSocketNotifier(socketPair[1], QSocketNotifier::Read, this);
|
||||||
connect(socketNotifier, SIGNAL(activated(int)), this, SLOT(socketNotify()));
|
connect(socketNotifier, SIGNAL(activated(int)), this, SLOT(socketNotify()));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::signalHandler(int)
|
void MainWindow::signalHandler(int)
|
||||||
@@ -245,7 +250,7 @@ void MainWindow::copyMarked()
|
|||||||
|
|
||||||
if(progress.wasCanceled())
|
if(progress.wasCanceled())
|
||||||
break;
|
break;
|
||||||
|
#ifdef __linux__
|
||||||
srcFile.open(QIODevice::ReadOnly);
|
srcFile.open(QIODevice::ReadOnly);
|
||||||
dstFile.open(QIODevice::WriteOnly);
|
dstFile.open(QIODevice::WriteOnly);
|
||||||
if(ioctl(dstFile.handle(), BTRFS_IOC_CLONE, srcFile.handle()) < 0)
|
if(ioctl(dstFile.handle(), BTRFS_IOC_CLONE, srcFile.handle()) < 0)
|
||||||
@@ -255,6 +260,9 @@ void MainWindow::copyMarked()
|
|||||||
qDebug() << dstFile.fileName();
|
qDebug() << dstFile.fileName();
|
||||||
srcFile.copy(dstFile.fileName());
|
srcFile.copy(dstFile.fileName());
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
srcFile.copy(dstFile.fileName());
|
||||||
|
#endif
|
||||||
progress.setValue(i++);
|
progress.setValue(i++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ QMAKE_CXXFLAGS += -fopenmp
|
|||||||
|
|
||||||
LIBS += -lraw -lexif -lcfitsio -fopenmp
|
LIBS += -lraw -lexif -lcfitsio -fopenmp
|
||||||
|
|
||||||
|
win32:LIBS += -LC:\msys64\mingw64\lib -LC:\msys64\mingw64\bin
|
||||||
|
win32:INCLUDEPATH += C:\msys64\mingw64\include\ C:\msys64\mingw64\include\cfitsio
|
||||||
|
|
||||||
SOURCES += main.cpp\
|
SOURCES += main.cpp\
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
imagescrollarea.cpp \
|
imagescrollarea.cpp \
|
||||||
|
|||||||
Reference in New Issue
Block a user