Skip to content

Commit

Permalink
Merge branch 'master' into Eeems-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems authored Jan 15, 2024
2 parents e302ee5 + f4b81ed commit d00d763
Show file tree
Hide file tree
Showing 58 changed files with 1,593 additions and 1,011 deletions.
5 changes: 4 additions & 1 deletion applications/gio/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ class ICommand {

ICommand(bool allowEmpty);
virtual int arguments(){ return EXIT_FAILURE; }
virtual int command(const QStringList& args){ return EXIT_FAILURE; }
virtual int command(const QStringList& args){
Q_UNUSED(args);
return EXIT_FAILURE;
}

protected:
bool allowEmpty = false;
Expand Down
3 changes: 0 additions & 3 deletions applications/launcher/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <QGuiApplication>
#include <QMutableListIterator>
#include <liboxide.h>
#include <liboxide/eventfilter.h>
#include <liboxide/sysobject.h>

#include "appitem.h"
Expand All @@ -19,7 +18,6 @@
using namespace codes::eeems::oxide1;
using codes::eeems::oxide1::Power;
using Oxide::SysObject;
using Oxide::EventFilter;
using namespace Oxide::Sentry;

enum State { Normal, PowerSaving };
Expand Down Expand Up @@ -61,7 +59,6 @@ class Controller : public QObject
Q_PROPERTY(int maxTouchHeight READ maxTouchHeight)
public:
static std::string exec(const char* cmd);
EventFilter* filter;
QObject* stateController;
QObject* root = nullptr;
explicit Controller(QObject* parent = 0)
Expand Down
10 changes: 5 additions & 5 deletions applications/launcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
#include <cstdlib>
#include <signal.h>
#include <liboxide.h>
#include <liboxide/oxideqml.h>
#include <liboxide/eventfilter.h>

#include "controller.h"

using namespace std;
using namespace Oxide;
using namespace Oxide::QML;
using namespace Oxide::Sentry;

function<void(int)> shutdown_handler;
Expand All @@ -30,19 +33,16 @@ int main(int argc, char* argv[]){
deviceSettings.setupQtEnvironment();
QGuiApplication app(argc, argv);
sentry_init("oxide", argv);
auto filter = new EventFilter(&app);
app.setOrganizationName("Eeems");
app.setOrganizationDomain(OXIDE_SERVICE);
app.setApplicationName("oxide");
app.setApplicationDisplayName("Launcher");
app.installEventFilter(filter);
QQmlApplicationEngine engine;
QQmlContext* context = engine.rootContext();
Controller* controller = new Controller();
controller->filter = filter;
qmlRegisterAnonymousType<AppItem>("codes.eeems.oxide", 2);
qmlRegisterAnonymousType<Controller>("codes.eeems.oxide", 2);
context->setContextProperty("screenGeometry", app.primaryScreen()->geometry());
registerQML(&engine);
context->setContextProperty("apps", QVariant::fromValue(controller->getApps()));
context->setContextProperty("controller", controller);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
Expand All @@ -52,7 +52,7 @@ int main(int argc, char* argv[]){
}
QObject* root = engine.rootObjects().first();
controller->root = root;
filter->root = (QQuickItem*)root;
root->installEventFilter(new EventFilter(&app));
QObject* stateController = root->findChild<QObject*>("stateController");
if(!stateController){
qDebug() << "Can't find stateController";
Expand Down
Loading

0 comments on commit d00d763

Please sign in to comment.