Fix application auto close bug. This happens on Windows and i3wm (no
other are known). But why only them? God knows..
This commit is contained in:
parent
4150551d78
commit
24e186e73b
@ -6,7 +6,8 @@
|
||||
#include <QGraphicsTextItem>
|
||||
#include <QTimer>
|
||||
|
||||
ColorPickerScene::ColorPickerScene(QPixmap *pixmap, QWidget *parentWidget) : QGraphicsScene(), QGraphicsView(this, parentWidget) {
|
||||
ColorPickerScene::ColorPickerScene(QPixmap *pixmap, QWidget *parentWidget)
|
||||
: QGraphicsScene(), QGraphicsView(this, parentWidget) {
|
||||
setFrameShape(QFrame::NoFrame); // Time taken to solve: A george99g and 38 minutes.
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
2
main.cpp
2
main.cpp
@ -1,4 +1,5 @@
|
||||
#include "mainwindow.hpp"
|
||||
#include "screenshotutil.hpp"
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QtGlobal>
|
||||
@ -32,6 +33,7 @@ void handler(QtMsgType type, const QMessageLogContext &, const QString &msg) {
|
||||
int main(int argc, char *argv[]) {
|
||||
qInstallMessageHandler(handler);
|
||||
QApplication a(argc, argv);
|
||||
a.setQuitOnLastWindowClosed(false);
|
||||
a.setApplicationName("KShare");
|
||||
a.setOrganizationName("ArsenArsen");
|
||||
a.setApplicationVersion("3.0");
|
||||
|
@ -39,6 +39,7 @@ CustomUploader::CustomUploader(QString absFilePath) {
|
||||
if (!obj["desc"].isString())
|
||||
/*t*/ error(absFilePath, "desc not a string");
|
||||
else
|
||||
|
||||
desc = obj["desc"].toString();
|
||||
} else
|
||||
desc = absFilePath;
|
||||
@ -78,7 +79,8 @@ CustomUploader::CustomUploader(QString absFilePath) {
|
||||
error(absFilePath, "imageformat not string");
|
||||
}
|
||||
QString imageFormat = imageValue.toString();
|
||||
if (imageFormat == "base64" || QRegExp("base64\\([^+]+\\+[^+]+)").exactMatch(imageFormat) || QRegExp("[^+]+\\+[^+]+").exactMatch(imageFormat)) {
|
||||
if (imageFormat == "base64" || QRegExp("base64\\([^+]+\\+[^+]+)").exactMatch(imageFormat)
|
||||
|| QRegExp("[^+]+\\+[^+]+").exactMatch(imageFormat)) {
|
||||
this->iFormat = imageFormat;
|
||||
} else
|
||||
error(absFilePath, "imageformat invalid");
|
||||
@ -230,7 +232,8 @@ void parseResult(QJsonDocument result, QByteArray data, QString returnPathspec,
|
||||
} else
|
||||
notifications::notify("KShare Custom Uploader " + name, "Upload done, but result empty!");
|
||||
} else {
|
||||
notifications::notify("KShare Custom Uploader " + name, "Upload done, but result is not JSON Object! Result in clipboard.");
|
||||
notifications::notify("KShare Custom Uploader " + name,
|
||||
"Upload done, but result is not JSON Object! Result in clipboard.");
|
||||
QApplication::clipboard()->setText(data);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user