Skip to content

Instantly share code, notes, and snippets.

View kimmoli's full-sized avatar

Kimmo Lindholm kimmoli

View GitHub Profile
@kimmoli
kimmoli / myclass.cpp
Last active August 29, 2015 14:13
Cover animation disable
#include <QDBusConnection>
...
QDBusConnection::sessionBus().connect("", "/com/jolla/lipstick", "com.jolla.lipstick", "coverstatus",
this, SLOT(handleCoverstatus(const QDBusMessage&)));
...
void myclass::handleCoverstatus(const QDBusMessage& msg)
{
QList<QVariant> args = msg.arguments();
m_coverStatus = args.at(0).toInt();
@kimmoli
kimmoli / myclass.cpp
Last active August 29, 2015 14:20
QFileSystemWatcher
void Myclass::start()
{
/* Read the file once */
tmpFileProcess("/tmp/testi");
/* Watch the file */
tmpFileNotifier = new QFileSystemWatcher(QStringList() << "/tmp/testi", this);
/* Connect fileChanged to our slot */
connect(tmpFileNotifier, SIGNAL(fileChanged(QString)), this, SLOT(tmpFileProcess(QString)));
Rectangle
{
color: "transparent"
height: Theme.itemSizeMedium
width: parent.width
Label
{
width: 80
id: bb
@kimmoli
kimmoli / New file.txt
Last active August 29, 2015 14:22
Kokeilu
Resistanssi.
Testi.
Kissa.
Resistanssi.
Testi.
Kissa.
@kimmoli
kimmoli / pidditesti.sh
Last active August 29, 2015 14:22
Pasted from Jolla
dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep -i coveraction | while read -r line
do
a=`echo $line | cut -d "." -f 4`
b=`echo ${a//pid}`
c=`ps -p $b o ucomm --no-heading`
echo $c
grep -Le "NoDisplay=true" /usr/share/applications/*.desktop | while read file
do
grep -le "Exec.*$c.*" $file
done
@kimmoli
kimmoli / main.qml
Last active August 29, 2015 14:22
Test
import QtQuick 2.0
import Sailfish.Silica 1.0
import "pages"
ApplicationWindow
{
initialPage: Component { Fantsucam { } }
cover: Qt.resolvedUrl("cover/CoverPage.qml")
}
/*
Copyright (C) 2013 Jolla Ltd.
Contact: Thomas Perl <thomas.perl@jollamobile.com>
All rights reserved.
You may use this file under the terms of BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
@kimmoli
kimmoli / AnotherTest.qml
Last active August 29, 2015 14:22
Test
Page
{
Timer
{
interval: 100
running: true
repeat: true
onTriggered: k.text += "kissa "
}
Label
@kimmoli
kimmoli / Pinchtest.qml
Last active August 29, 2015 14:22
Test
Item
{
Rectangle
{
id: rect
width: 200; height: 200
color: "red"
y: 280
x: 30
onXChanged: console.log(x + " " + y)
@kimmoli
kimmoli / Ekafile.qml
Last active August 29, 2015 14:22
Edit withgistpud
TextArea
{
id: area
width: showPastePage.width
height: showPastePage.height - dh.height
anchors.top: dh.bottom
selectionMode: TextEdit.SelectCharacters
readOnly: true