1
0
Fork 0

Test auto updating.

This commit is contained in:
Kitteh 2018-10-23 11:37:51 +01:00
parent 3790946082
commit a604687b5c
2 changed files with 21 additions and 1 deletions

View file

@ -21,6 +21,7 @@ if [ "$ARCH" == "" ]; then
ARCH="x86_64"
fi
wget "https://github.com/AppImage/AppImageUpdate/releases/download/continuous/appimageupdatetool-382-b61bee3-x86_64.AppImage" -O appdir/usr/bin/appimageupdatetool
cp -f /usr/lib/*/libjack.so.0 appdir/usr/lib
export UPD_INFO="gh-releases-zsync|NamedKitten|KittehPlayer|continuous|KittehPlayer-$ARCH.AppImage.zsync"

View file

@ -1,5 +1,8 @@
#include <stdexcept>
#include <clocale>
#include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#include "mpvobject.h"
@ -15,12 +18,28 @@
#include <QWidget>
#include <QtGui/QOpenGLFramebufferObject>
#include <QQuickView>
#include <QProcessEnvironment>
int main( int argc, char *argv[] )
{
setenv("QT_QUICK_CONTROLS_STYLE","Desktop",1);
QApplication app(argc, argv);
for (int i = 1; i < argc; ++i) {
if (!qstrcmp(argv[i], "--update")) {
QString program = QProcessEnvironment::systemEnvironment().value("APPDIR", "/usr/bin") + "/appimageupdatetool";
QProcess updater;
updater.setProcessChannelMode(QProcess::ForwardedChannels);
updater.start(program, QStringList() << QProcessEnvironment::systemEnvironment().value("APPIMAGE", ""));
if(!updater.waitForStarted())
qDebug() << "Failed to start updater.";
qDebug() << program;
exit(0);
}
}
setenv("QT_QUICK_CONTROLS_STYLE","Desktop",1);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
qmlRegisterType<MpvObject>("player", 1, 0, "MpvObject");