mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-29 19:48:53 +02:00
194 lines
5.3 KiB
Plaintext
194 lines
5.3 KiB
Plaintext
From 37c38cf8bb9b7ec66a4e7adf640b157992469b9b Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Wed, 21 Aug 2019 21:38:36 +1000
|
|
Subject: Fix crush
|
|
|
|
|
|
diff --git a/src/utils/filenamehandler.cpp b/src/utils/filenamehandler.cpp
|
|
index d31bcfd..ae1f03e 100644
|
|
--- a/src/utils/filenamehandler.cpp
|
|
+++ b/src/utils/filenamehandler.cpp
|
|
@@ -23,7 +23,9 @@
|
|
#include <QDir>
|
|
|
|
FileNameHandler::FileNameHandler(QObject *parent) : QObject(parent) {
|
|
+#ifndef __HAIKU__
|
|
std::locale::global(std::locale(""));
|
|
+#endif
|
|
}
|
|
|
|
QString FileNameHandler::parsedPattern() {
|
|
--
|
|
2.28.0
|
|
|
|
|
|
From af6feac4c9b47b4cd73a6307271ecf581c13b3ad Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Fri, 21 Aug 2020 21:37:07 +1000
|
|
Subject: Fix build for Qt 5.15
|
|
|
|
|
|
diff --git a/src/third-party/Qt-Color-Widgets/src/color_wheel.cpp b/src/third-party/Qt-Color-Widgets/src/color_wheel.cpp
|
|
index 335b29c..a9a6fba 100644
|
|
--- a/src/third-party/Qt-Color-Widgets/src/color_wheel.cpp
|
|
+++ b/src/third-party/Qt-Color-Widgets/src/color_wheel.cpp
|
|
@@ -24,6 +24,7 @@
|
|
#include <cmath>
|
|
#include <QMouseEvent>
|
|
#include <QPainter>
|
|
+#include <QPainterPath>
|
|
#include <QLineF>
|
|
#include <QDragEnterEvent>
|
|
#include <QMimeData>
|
|
--
|
|
2.28.0
|
|
|
|
|
|
From 41fc7ded2fbacbefdcb097ed0604f27ad113d944 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Fri, 21 Aug 2020 21:37:53 +1000
|
|
Subject: Fix build for Qt 5.15
|
|
|
|
|
|
diff --git a/src/tools/arrow/arrowtool.h b/src/tools/arrow/arrowtool.h
|
|
index abdbe33..1dd0471 100644
|
|
--- a/src/tools/arrow/arrowtool.h
|
|
+++ b/src/tools/arrow/arrowtool.h
|
|
@@ -19,6 +19,7 @@
|
|
|
|
#include "src/tools/abstracttwopointtool.h"
|
|
#include <QPainter>
|
|
+#include <QPainterPath>
|
|
|
|
class ArrowTool : public AbstractTwoPointTool {
|
|
Q_OBJECT
|
|
--
|
|
2.28.0
|
|
|
|
|
|
From f92403f65f9a4d6a39dc0075a7f9023b11c083e1 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Fri, 21 Aug 2020 21:38:13 +1000
|
|
Subject: Add support for autolaunch
|
|
|
|
|
|
diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp
|
|
index 6eef22a..9b91878 100644
|
|
--- a/src/utils/confighandler.cpp
|
|
+++ b/src/utils/confighandler.cpp
|
|
@@ -240,7 +240,10 @@ void ConfigHandler::setKeepOpenAppLauncher(const bool keepOpen) {
|
|
|
|
bool ConfigHandler::startupLaunchValue() {
|
|
bool res = false;
|
|
-#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
|
|
+#if defined(Q_OS_HAIKU)
|
|
+ QString path = QDir::homePath() + "/config/settings/boot/launch/Flameshot";
|
|
+ res = QFile(path).exists();
|
|
+#elif defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
|
|
QString path = QDir::homePath() + "/.config/autostart/Flameshot.desktop";
|
|
res = QFile(path).exists();
|
|
#elif defined(Q_OS_WIN)
|
|
@@ -254,7 +257,16 @@ bool ConfigHandler::startupLaunchValue() {
|
|
}
|
|
|
|
void ConfigHandler::setStartupLaunch(const bool start) {
|
|
-#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
|
|
+#if defined(Q_OS_HAIKU)
|
|
+ QString linkname = QDir::homePath() + "/config/settings/boot/launch/Flameshot";
|
|
+ QFile appFile(QCoreApplication::applicationFilePath());
|
|
+ QFile linkFile(linkname);
|
|
+ if (start) {
|
|
+ appFile.link(linkname);
|
|
+ } else {
|
|
+ linkFile.remove();
|
|
+ }
|
|
+#elif defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
|
|
QString path = QDir::homePath() + "/.config/autostart/Flameshot.desktop";
|
|
QFile file(path);
|
|
if (start) {
|
|
--
|
|
2.28.0
|
|
|
|
|
|
From fe04c9b90cc719990d8974b38c6bf6533d3d91d3 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Fri, 21 Aug 2020 21:41:02 +1000
|
|
Subject: DBus autostart
|
|
|
|
|
|
diff --git a/src/main.cpp b/src/main.cpp
|
|
index 83fa1c1..4bf0db9 100644
|
|
--- a/src/main.cpp
|
|
+++ b/src/main.cpp
|
|
@@ -28,6 +28,7 @@
|
|
#include <QTextStream>
|
|
#include <QTimer>
|
|
#include <QDir>
|
|
+#include <QProcess>
|
|
|
|
#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
|
|
#include "src/core/flameshotdbusadapter.h"
|
|
@@ -44,7 +45,28 @@ int main(int argc, char *argv[]) {
|
|
|
|
// no arguments, just launch Flameshot
|
|
if (argc == 1) {
|
|
SingleApplication app(argc, argv);
|
|
+#ifdef Q_OS_HAIKU
|
|
+ int status=0;
|
|
+ QProcess dbusProcess;
|
|
+ QString exec = "/bin/dbus-launch";
|
|
+ QStringList params;
|
|
+ dbusProcess.start(exec, params);
|
|
+ dbusProcess.waitForFinished();
|
|
+ QString output(dbusProcess.readAllStandardOutput());
|
|
+
|
|
+ QFile file ("/tmp/flameshot_session");
|
|
+ if (file.open(QFile::WriteOnly | QFile::Truncate)) {
|
|
+ QTextStream outstream(&file);
|
|
+ outstream << output;
|
|
+ file.close();
|
|
+ }
|
|
+
|
|
+ QStringList list = output.split("\n", QString::SkipEmptyParts);
|
|
+ foreach (const QString &str, list)
|
|
+ putenv(str.toLatin1().data());
|
|
+#endif
|
|
+
|
|
|
|
QTranslator translator;
|
|
QStringList trPaths = PathInfo::translationsPaths();
|
|
@@ -77,10 +99,30 @@ int main(int argc, char *argv[]) {
|
|
// Exporting captures must be connected after the dbus interface
|
|
// or the dbus signal gets blocked until we end the exports.
|
|
c->enableExports();
|
|
+#ifdef Q_OS_HAIKU
|
|
+ status = app.exec();
|
|
+ system("kill -3 $DBUS_SESSION_BUS_PID");
|
|
+ return status;
|
|
+#else
|
|
return app.exec();
|
|
+#endif
|
|
}
|
|
|
|
#ifndef Q_OS_WIN
|
|
+
|
|
+#ifdef Q_OS_HAIKU
|
|
+QFile inputFile("/tmp/flameshot_session");
|
|
+if (inputFile.open(QIODevice::ReadOnly))
|
|
+{
|
|
+ QTextStream in(&inputFile);
|
|
+ while (!in.atEnd())
|
|
+ {
|
|
+ QString line = in.readLine();
|
|
+ putenv(line.toLatin1().data());
|
|
+ }
|
|
+ inputFile.close();
|
|
+}
|
|
+#endif
|
|
/*--------------|
|
|
* CLI parsing |
|
|
* ------------*/
|
|
--
|
|
2.28.0
|
|
|